diff --git a/README.md b/README.md index cff0c84..19e47c2 100644 --- a/README.md +++ b/README.md @@ -2,28 +2,26 @@ ![plotly-react-logo](https://static1.squarespace.com/static/5a5adfdea9db09d594a841f3/t/5a5af2c5e2c48307ed4a21b6/1515975253370/) -> A [plotly.js](https://github.com/plotly/plotly.js) React component from [Plotly](https://plot.ly/). The basis of Plotly's [React component suite](https://plot.ly/products/react/). +> A [plotly.js](https://github.com/plotly/plotly.js) React component from +> [Plotly](https://plot.ly/). The basis of Plotly's +> [React component suite](https://plot.ly/products/react/). 👉 [DEMO](http://react-plotly.js-demo.getforge.io/) 👉 [Demo source code](https://github.com/plotly/react-plotly.js-demo-app) -*** +--- ## Contents -- [Installation](#installation) -- [Quick start](#quick-start) -- [Usage](#usage) - * [With local plotly.js](#with-local-plotlyjs) - + [build with webpack](#build-with-webpack) - * [With external plotly.js (for example by ` -``` - -you may then inject Plotly and use the returned React component: - -```javascript -/* global Plotly:true */ - -import createPlotlyComponent from 'react-plotly.js/factory' - -/* (Note that Plotly is already defined from loading plotly.js through a + + ``` And instantiate the component with @@ -176,74 +112,76 @@ const Plot = createPlotlyComponent(Plotly); ReactDOM.render( React.createElement(Plot, { - data: [{x: [1, 2, 3], y: [2, 1, 3]}] + data: [{x: [1, 2, 3], y: [2, 1, 3]}], }), document.getElementById('root') ); ``` -You can see an example of this method in action [here](https://codepen.io/rsreusser/pen/qPgwwJ?editors=1010). +You can see an example of this method in action +[here](https://codepen.io/rsreusser/pen/qPgwwJ?editors=1010). ## API ### Props -**Note**: for the time being, this component may mutate its `layout` and `data` props in response to user input, going against React rules. This behaviour will change in the near future. - -| Prop | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -| `data` | `Array` | `[]` | list of trace objects | -| `layout` | `Object` | `undefined` | layout object | -| `config` | `Object` | `undefined` | config object | -| `style` | `Object` | `{position: 'relative', display: 'inline-block'}` | used to style the `
` into which the plot is rendered | -| `className` | `string` | `undefined` | applied to the `
` into which the plot is rendered | -| `frames` | `Array` | `undefined` | list of frame objects | -| `useResizeHandler` | `Boolean` | `false` | When true, adds a call to `Plotly.Plot.resize()` as a `window.resize` event handler | -| `revision` | `Number` | `undefined` | When provided, causes the plot to update *only* when the revision is incremented. | -| `debug` | `Boolean` | `false` | Assign the graph div to `window.gd` for debugging | -| `onInitialized` | `Function` | `undefined` | Callback executed after plot is initialized | -| `onPurge` | `Function` | `undefined` | Callback executed when component unmounts. Unmounting triggers a Plotly.purge event which strips the graphDiv of all plotly.js related information including data and layout. This hook gives application writers a chance to pull data and layout off the DOM. | -| `onUpdate` | `Function` | `undefined` | Callback executed when a plotly.js API method resolves | -| `onError` | `Function` | `undefined` | Callback executed when a plotly.js API method rejects | -| `fit` | `Boolean` | `false` | *deprecated* When true, will set `layout.height` and `layout.width` to the component's parent's size if they are unspecified, and will update them on `window.resize` | +**Note**: This component will not refresh the plot unless either the `revision` prop is defined and has changed, OR unless a shallow equality check on `data`, `layout`, `frames` and `config` fails. + +**Note**: for the time being, this component may mutate its `layout` and `data` props in response to user input, going against React rules. This behaviour will change in the near future once https://github.com/plotly/plotly.js/issues/2389 is completed. + +| Prop | Type | Default | Description | +| ------------------ | ---------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | `Array` | `[]` | list of trace objects | +| `layout` | `Object` | `undefined` | layout object | +| `config` | `Object` | `undefined` | config object | +| `style` | `Object` | `{position: 'relative', display: 'inline-block'}` | used to style the `
` into which the plot is rendered | +| `id` | `string` | `undefined` | id assigned to the `
` into which the plot is rendered. | +| `className` | `string` | `undefined` | applied to the `
` into which the plot is rendered | +| `frames` | `Array` | `undefined` | list of frame objects | +| `useResizeHandler` | `Boolean` | `false` | When true, adds a call to `Plotly.Plot.resize()` as a `window.resize` event handler | +| `revision` | `Number` | `undefined` | When provided, causes the plot to update _only_ when the revision is incremented. | +| `debug` | `Boolean` | `false` | Assign the graph div to `window.gd` for debugging | +| `onInitialized` | `Function` | `undefined` | Callback executed after plot is initialized. This function recieves a reference to the `
` DOM node as an argument, from which `data`, `layout`, `config`, and `frames` can be extracted and persisted. | +| `onPurge` | `Function` | `undefined` | Callback executed when component unmounts. Unmounting triggers a Plotly.purge event which strips the graphDiv of all plotly.js related information including data and layout. This hook gives application writers a chance to pull data and layout off the DOM. | +| `onUpdate` | `Function` | `undefined` | Callback executed when a plotly.js API method resolves. This function recieves a reference to the `
` DOM node as an argument, from which `data`, `layout`, `config`, and `frames` can be extracted and persisted. | +| `onError` | `Function` | `undefined` | Callback executed when a plotly.js API method rejects | +| `fit` | `Boolean` | `false` | _deprecated_ When true, will set `layout.height` and `layout.width` to the component's parent's size if they are unspecified, and will update them on `window.resize` | To make a plot responsive, i.e. to fill its containing element and resize when the window is resized, use `style` or `className` to set the dimensions of the element (i.e. using `width: 100%; height: 100%` or some similar values) and set `useResizeHandler` to `true` while setting `layout.autosize` to `true` and leaving `layout.height` and `layout.width` undefined. This will implement the behaviour documented here: https://plot.ly/javascript/responsive-fluid-layout/ ### Event handler props -Event handlers for [`plotly.js` events](https://plot.ly/javascript/plotlyjs-events/) may be attached through the following props. - -| Prop | Type | Plotly Event | -| ---- | ---- | ----------- | -| `onAfterExport` | `Function` | `plotly_afterexport` | -| `onAfterPlot` | `Function` | `plotly_afterplot` | -| `onAnimated` | `Function` | `plotly_animated` | -| `onAnimatingFrame` | `Function` | `plotly_animatingframe` | -| `onAnimationInterrupted` | `Function` | `plotly_animationinterrupted` | -| `onAutoSize` | `Function` | `plotly_autosize` | -| `onBeforeExport` | `Function` | `plotly_beforeexport` | -| `onButtonClicked` | `Function` | `plotly_buttonclicked` | -| `onClick` | `Function` | `plotly_click` | -| `onClickAnnotation` | `Function` | `plotly_clickannotation` | -| `onDeselect` | `Function` | `plotly_deselect` | -| `onDoubleClick` | `Function` | `plotly_doubleclick` | -| `onFramework` | `Function` | `plotly_framework` | -| `onHover` | `Function` | `plotly_hover` | -| `onRelayout` | `Function` | `plotly_relayout` | -| `onRestyle` | `Function` | `plotly_restyle` | -| `onRedraw` | `Function` | `plotly_redraw` | -| `onSelected` | `Function` | `plotly_selected` | -| `onSelecting` | `Function` | `plotly_selecting` | -| `onSliderChange` | `Function` | `plotly_sliderchange` | -| `onSliderEnd` | `Function` | `plotly_sliderend` | -| `onSliderStart` | `Function` | `plotly_sliderstart` | -| `onTransitioning` | `Function` | `plotly_transitioning` | +Event handlers for +[`plotly.js` events](https://plot.ly/javascript/plotlyjs-events/) may be +attached through the following props. + +| Prop | Type | Plotly Event | +| ------------------------- | ---------- | ------------------------------ | +| `onAfterExport` | `Function` | `plotly_afterexport` | +| `onAfterPlot` | `Function` | `plotly_afterplot` | +| `onAnimated` | `Function` | `plotly_animated` | +| `onAnimatingFrame` | `Function` | `plotly_animatingframe` | +| `onAnimationInterrupted` | `Function` | `plotly_animationinterrupted` | +| `onAutoSize` | `Function` | `plotly_autosize` | +| `onBeforeExport` | `Function` | `plotly_beforeexport` | +| `onButtonClicked` | `Function` | `plotly_buttonclicked` | +| `onClick` | `Function` | `plotly_click` | +| `onClickAnnotation` | `Function` | `plotly_clickannotation` | +| `onDeselect` | `Function` | `plotly_deselect` | +| `onDoubleClick` | `Function` | `plotly_doubleclick` | +| `onFramework` | `Function` | `plotly_framework` | +| `onHover` | `Function` | `plotly_hover` | +| `onRelayout` | `Function` | `plotly_relayout` | +| `onRestyle` | `Function` | `plotly_restyle` | +| `onRedraw` | `Function` | `plotly_redraw` | +| `onSelected` | `Function` | `plotly_selected` | +| `onSelecting` | `Function` | `plotly_selecting` | +| `onSliderChange` | `Function` | `plotly_sliderchange` | +| `onSliderEnd` | `Function` | `plotly_sliderend` | +| `onSliderStart` | `Function` | `plotly_sliderstart` | +| `onTransitioning` | `Function` | `plotly_transitioning` | | `onTransitionInterrupted` | `Function` | `plotly_transitioninterrupted` | -| `onUnhover` | `Function` | `plotly_unhover` | - -## Roadmap - -This component currently creates a new plot every time the input changes. That makes it stable and good enough for production use, but `plotly.js` will soon gain react-style support for computing and drawing changes incrementally. What does that mean for you? That means you can expect to keep using this component with little modification but that the plotting will simply happen much faster when you upgrade to the first version of `plotly.js` to support this feature. If this component requires any significant changes, a new major version will be released at the same time to ensure stability. See [plotly/react-plotly.js#2](https://github.com/plotly/react-plotly.js/issues/2) for more information about this feature. +| `onUnhover` | `Function` | `plotly_unhover` | ## Development @@ -251,7 +189,6 @@ To get started: ```bash $ npm install -$ npm start ``` To transpile from ES2015 + JSX into the ES5 npm-distributed version: diff --git a/docs/example/assets/codemirror.css b/docs/example/assets/codemirror.css deleted file mode 100644 index b008351..0000000 --- a/docs/example/assets/codemirror.css +++ /dev/null @@ -1,340 +0,0 @@ -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - font-family: monospace; - height: 300px; - color: black; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} -.CodeMirror pre { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; - white-space: nowrap; -} -.CodeMirror-linenumbers {} -.CodeMirror-linenumber { - padding: 0 3px 0 5px; - min-width: 20px; - text-align: right; - color: #999; - white-space: nowrap; -} - -.CodeMirror-guttermarker { color: black; } -.CodeMirror-guttermarker-subtle { color: #999; } - -/* CURSOR */ - -.CodeMirror-cursor { - border-left: 1px solid black; - border-right: none; - width: 0; -} -/* Shown when moving in bi-directional text */ -.CodeMirror div.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} -.cm-fat-cursor .CodeMirror-cursor { - width: auto; - border: 0 !important; - background: #7e7; -} -.cm-fat-cursor div.CodeMirror-cursors { - z-index: 1; -} - -.cm-animate-fat-cursor { - width: auto; - border: 0; - -webkit-animation: blink 1.06s steps(1) infinite; - -moz-animation: blink 1.06s steps(1) infinite; - animation: blink 1.06s steps(1) infinite; - background-color: #7e7; -} -@-moz-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@-webkit-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} - -/* Can style cursor different in overwrite (non-insert) mode */ -.CodeMirror-overwrite .CodeMirror-cursor {} - -.cm-tab { display: inline-block; text-decoration: inherit; } - -.CodeMirror-rulers { - position: absolute; - left: 0; right: 0; top: -50px; bottom: -20px; - overflow: hidden; -} -.CodeMirror-ruler { - border-left: 1px solid #ccc; - top: 0; bottom: 0; - position: absolute; -} - -/* DEFAULT THEME */ - -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -.CodeMirror-composing { border-bottom: 2px solid; } - -/* Default styles for common addons */ - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} -.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } -.CodeMirror-activeline-background {background: #e8f2ff;} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - position: relative; - overflow: hidden; - background: white; -} - -.CodeMirror-scroll { - overflow: scroll !important; /* Things will break if this is overridden */ - /* 30px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror */ - margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; -} -.CodeMirror-sizer { - position: relative; - border-right: 30px solid transparent; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actual scrolling happens, thus preventing shaking and - flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - position: absolute; - z-index: 6; - display: none; -} -.CodeMirror-vscrollbar { - right: 0; top: 0; - overflow-x: hidden; - overflow-y: scroll; -} -.CodeMirror-hscrollbar { - bottom: 0; left: 0; - overflow-y: hidden; - overflow-x: scroll; -} -.CodeMirror-scrollbar-filler { - right: 0; bottom: 0; -} -.CodeMirror-gutter-filler { - left: 0; bottom: 0; -} - -.CodeMirror-gutters { - position: absolute; left: 0; top: 0; - min-height: 100%; - z-index: 3; -} -.CodeMirror-gutter { - white-space: normal; - height: 100%; - display: inline-block; - vertical-align: top; - margin-bottom: -30px; -} -.CodeMirror-gutter-wrapper { - position: absolute; - z-index: 4; - background: none !important; - border: none !important; -} -.CodeMirror-gutter-background { - position: absolute; - top: 0; bottom: 0; - z-index: 4; -} -.CodeMirror-gutter-elt { - position: absolute; - cursor: default; - z-index: 4; -} -.CodeMirror-gutter-wrapper ::selection { background-color: transparent } -.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } - -.CodeMirror-lines { - cursor: text; - min-height: 1px; /* prevents collapsing before first draw */ -} -.CodeMirror pre { - /* Reset some styles that the rest of the page might have set */ - -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; - border-width: 0; - background: transparent; - font-family: inherit; - font-size: inherit; - margin: 0; - white-space: pre; - word-wrap: normal; - line-height: inherit; - color: inherit; - z-index: 2; - position: relative; - overflow: visible; - -webkit-tap-highlight-color: transparent; - -webkit-font-variant-ligatures: contextual; - font-variant-ligatures: contextual; -} -.CodeMirror-wrap pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} - -.CodeMirror-linebackground { - position: absolute; - left: 0; right: 0; top: 0; bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - position: relative; - z-index: 2; - overflow: auto; -} - -.CodeMirror-widget {} - -.CodeMirror-rtl pre { direction: rtl; } - -.CodeMirror-code { - outline: none; -} - -/* Force content-box sizing for the elements where we expect it */ -.CodeMirror-scroll, -.CodeMirror-sizer, -.CodeMirror-gutter, -.CodeMirror-gutters, -.CodeMirror-linenumber { - -moz-box-sizing: content-box; - box-sizing: content-box; -} - -.CodeMirror-measure { - position: absolute; - width: 100%; - height: 0; - overflow: hidden; - visibility: hidden; -} - -.CodeMirror-cursor { - position: absolute; - pointer-events: none; -} -.CodeMirror-measure pre { position: static; } - -div.CodeMirror-cursors { - visibility: hidden; - position: relative; - z-index: 3; -} -div.CodeMirror-dragcursors { - visibility: visible; -} - -.CodeMirror-focused div.CodeMirror-cursors { - visibility: visible; -} - -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } -.CodeMirror-crosshair { cursor: crosshair; } -.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } -.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } - -.cm-searching { - background: #ffa; - background: rgba(255, 255, 0, .4); -} - -/* Used to force a border model for a node */ -.cm-force-border { padding-right: .1px; } - -@media print { - /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursors { - visibility: hidden; - } -} - -/* See issue #2901 */ -.cm-tab-wrap-hack:after { content: ''; } - -/* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } diff --git a/docs/example/assets/example.json b/docs/example/assets/example.json deleted file mode 100644 index 9a428cc..0000000 --- a/docs/example/assets/example.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": [{ - "x": [1, 2, 3, 4], - "y": [1, 3, 2, 5] - }], - "layout": { - "title": "a plotly.js react component" - } -} diff --git a/docs/example/assets/plotly-basic.min.js b/docs/example/assets/plotly-basic.min.js deleted file mode 100644 index abfbedc..0000000 --- a/docs/example/assets/plotly-basic.min.js +++ /dev/null @@ -1,28 +0,0 @@ -/** -* plotly.js (basic - minified) v1.29.2 -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* Licensed under the MIT license -*/ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,n,r){function a(i,l){if(!n[i]){if(!e[i]){var s="function"==typeof require&&require;if(!l&&s)return s(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[i]={exports:{}};e[i][0].call(u.exports,function(t){var n=e[i][1][t];return a(n||t)},u,u.exports,t,e,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;ie?1:t>=e?0:NaN}function o(t){return null===t?NaN:+t}function i(t){return!isNaN(t)}function l(t){return{left:function(e,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=e.length);r>>1;t(e[o],n)<0?r=o+1:a=o}return r},right:function(e,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=e.length);r>>1;t(e[o],n)>0?a=o:r=o+1}return r}}}function s(t){return t.length}function c(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function f(){this._=Object.create(null)}function d(t){return(t+="")===_i||t[0]===wi?wi+t:t}function h(t){return(t+="")[0]===wi?t.slice(1):t}function p(t){return d(t)in this._}function g(t){return(t=d(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(h(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function x(){this._=Object.create(null)}function b(t){return t}function _(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=ki.length;n=e&&(e=a+1);!(i=l[e])&&++e0&&(t=t.slice(0,l));var c=Pi.get(t);return c&&(t=c,s=$),l?e?a:r:e?k:o}function W(t,e){return function(n){var r=ui.event;ui.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{ui.event=r}}}function $(t,e){var n=W(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function Q(t){var n=".dragsuppress-"+ ++Ni,a="click"+n,o=ui.select(r(t)).on("touchmove"+n,T).on("dragstart"+n,T).on("selectstart"+n,T);if(null==Ei&&(Ei=!("onselectstart"in t)&&w(t.style,"userSelect")),Ei){var i=e(t).style,l=i[Ei];i[Ei]="none"}return function(t){if(o.on(n,null),Ei&&(i[Ei]=l),t){var e=function(){o.on(a,null)};o.on(a,function(){T(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var a=n.createSVGPoint();if(Ii<0){var o=r(t);if(o.scrollX||o.scrollY){n=ui.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=n[0][0].getScreenCTM();Ii=!(i.f||i.e),n.remove()}}return Ii?(a.x=e.pageX,a.y=e.pageY):(a.x=e.clientX,a.y=e.clientY),a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}function K(){return ui.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function nt(t){return t>1?0:t<-1?ji:Math.acos(t)}function rt(t){return t>1?qi:t<-1?-qi:Math.asin(t)}function at(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function it(t){return((t=Math.exp(2*t))-1)/(t+1)}function lt(t){return(t=Math.sin(t/2))*t}function st(){}function ct(t,e,n){return this instanceof ct?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof ct?new ct(t.h,t.s,t.l):kt(""+t,Mt,ct):new ct(t,e,n)}function ut(t,e,n){function r(t){return t>360?t-=360:t<0&&(t+=360),t<60?o+(i-o)*t/60:t<180?i:t<240?o+(i-o)*(240-t)/60:o}function a(t){return Math.round(255*r(t))}var o,i;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=n<0?0:n>1?1:n,i=n<=.5?n*(1+e):n+e-n*e,o=2*n-i,new xt(a(t+120),a(t),a(t-120))}function ft(t,e,n){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof ht?gt(t.l,t.a,t.b):gt((t=At((t=ui.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,n)}function dt(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ht(n,Math.cos(t*=Vi)*e,Math.sin(t)*e)}function ht(t,e,n){return this instanceof ht?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof ht?new ht(t.l,t.a,t.b):t instanceof ft?dt(t.h,t.c,t.l):At((t=xt(t)).r,t.g,t.b):new ht(t,e,n)}function pt(t,e,n){var r=(t+16)/116,a=r+e/500,o=r-n/200;return a=vt(a)*Ji,r=vt(r)*Ki,o=vt(o)*tl,new xt(yt(3.2404542*a-1.5371385*r-.4985314*o),yt(-.969266*a+1.8760108*r+.041556*o),yt(.0556434*a-.2040259*r+1.0572252*o))}function gt(t,e,n){return t>0?new ft(Math.atan2(n,e)*Ui,Math.sqrt(e*e+n*n),t):new ft(NaN,NaN,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function xt(t,e,n){return this instanceof xt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof xt?new xt(t.r,t.g,t.b):kt(""+t,xt,ut):new xt(t,e,n)}function bt(t){return new xt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function kt(t,e,n){var r,a,o,i=0,l=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=r[2].split(","),r[1]){case"hsl":return n(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(Lt(a[0]),Lt(a[1]),Lt(a[2]))}return(o=rl.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(i=(3840&o)>>4,i|=i>>4,l=240&o,l|=l>>4,s=15&o,s|=s<<4):7===t.length&&(i=(16711680&o)>>16,l=(65280&o)>>8,s=255&o)),e(i,l,s))}function Mt(t,e,n){var r,a,o=Math.min(t/=255,e/=255,n/=255),i=Math.max(t,e,n),l=i-o,s=(i+o)/2;return l?(a=s<.5?l/(i+o):l/(2-i-o),r=t==i?(e-n)/l+(e0&&s<1?0:r),new ct(r,a,s)}function At(t,e,n){t=Tt(t),e=Tt(e),n=Tt(n);var r=mt((.4124564*t+.3575761*e+.1804375*n)/Ji),a=mt((.2126729*t+.7151522*e+.072175*n)/Ki);return ht(116*a-16,500*(r-a),200*(a-mt((.0193339*t+.119192*e+.9503041*n)/tl)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Lt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),zt(e,n,t,r)}}function zt(t,e,n,r){function a(){var t,e=s.status;if(!e&&Dt(s)||e>=200&&e<300||304===e){try{t=n.call(o,s)}catch(t){return void i.error.call(o,t)}i.load.call(o,t)}else i.error.call(o,s)}var o={},i=ui.dispatch("beforesend","progress","load","error"),l={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=a:s.onreadystatechange=function(){s.readyState>3&&a()},s.onprogress=function(t){var e=ui.event;ui.event=t;try{i.progress.call(o,s)}finally{ui.event=e}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return n=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(di(arguments)))}}),o.send=function(n,r,a){if(2===arguments.length&&"function"==typeof r&&(a=r,r=null),s.open(n,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),s.setRequestHeader)for(var u in l)s.setRequestHeader(u,l[u]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=a&&o.on("error",a).on("load",function(t){a(null,t)}),i.beforesend.call(o,s),s.send(null==r?null:r),o},o.abort=function(){return s.abort(),o},ui.rebind(o,i,"on"),null==r?o:o.get(Ot(r))}function Ot(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,n){var r=arguments.length;r<2&&(e=0),r<3&&(n=Date.now());var a=n+e,o={c:t,t:a,n:null};return ol?ol.n=o:al=o,ol=o,il||(ll=clearTimeout(ll),il=1,sl(Et)),o}function Et(){var t=Nt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(ll),ll=setTimeout(Et,e)),il=0):(il=1,sl(Et))}function Nt(){for(var t=Date.now(),e=al;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function It(){for(var t,e=al,n=1/0;e;)e.c?(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function jt(t){var e=t.decimal,n=t.thousands,r=t.grouping,a=t.currency,o=r&&n?function(t,e){for(var a=t.length,o=[],i=0,l=r[0],s=0;a>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),o.push(t.substring(a-=l,a+l)),!((s+=l+1)>e));)l=r[i=(i+1)%r.length];return o.reverse().join(n)}:b;return function(t){var n=ul.exec(t),r=n[1]||" ",i=n[2]||">",l=n[3]||"-",s=n[4]||"",c=n[5],u=+n[6],f=n[7],d=n[8],h=n[9],p=1,g="",v="",m=!1,y=!0;switch(d&&(d=+d.substring(1)),(c||"0"===r&&"="===i)&&(c=r="0",i="="),h){case"n":f=!0,h="g";break;case"%":p=100,v="%",h="f";break;case"p":p=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+h.toLowerCase());case"c":y=!1;case"d":m=!0,d=0;break;case"s":p=-1,h="r"}"$"===s&&(g=a[0],v=a[1]),"r"!=h||d||(h="g"),null!=d&&("g"==h?d=Math.max(1,Math.min(21,d)):"e"!=h&&"f"!=h||(d=Math.max(0,Math.min(20,d)))),h=fl.get(h)||Bt;var x=c&&f;return function(t){var n=v;if(m&&t%1)return"";var a=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(p<0){var s=ui.formatPrefix(t,d);t=s.scale(t),n=s.symbol+v}else t*=p;t=h(t,d);var b,_,w=t.lastIndexOf(".");if(w<0){var k=y?t.lastIndexOf("e"):-1;k<0?(b=t,_=""):(b=t.substring(0,k),_=t.substring(k))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=o(b,1/0));var M=g.length+b.length+_.length+(x?0:a.length),A=M"===i?A+a+t:"^"===i?A.substring(0,M>>=1)+a+t+A.substring(M):a+(x?t:A+t))+n}}}function Bt(t){return t+""}function Ht(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function qt(t,e,n){function r(e){var n=t(e),r=o(n,1);return e-n1)for(;i=c)return-1;if(37===(a=e.charCodeAt(l++))){if(i=e.charAt(l++),!(o=S[i in gl?e.charAt(l++):i])||(r=o(t,n,r))<0)return-1}else if(a!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=k.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){b.lastIndex=0;var r=b.exec(e.slice(n));return r?(t.w=_.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){T.lastIndex=0;var r=T.exec(e.slice(n));return r?(t.m=L.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){M.lastIndex=0;var r=M.exec(e.slice(n));return r?(t.m=A.get(r[0].toLowerCase()),n+r[0].length):-1}function l(t,e,r){return n(t,C.c.toString(),e,r)}function s(t,e,r){return n(t,C.x.toString(),e,r)}function c(t,e,r){return n(t,C.X.toString(),e,r)}function u(t,e,n){var r=x.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,d=t.date,h=t.time,p=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{hl=Ht;var e=new hl;return e._=t,r(e)}finally{hl=Date}}var r=e(t);return n.parse=function(t){try{hl=Ht;var e=r.parse(t);return e&&e._}finally{hl=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=ue;var x=ui.map(),b=Xt(g),_=Yt(g),w=Xt(v),k=Yt(v),M=Xt(m),A=Yt(m),T=Xt(y),L=Yt(y);p.forEach(function(t,e){x.set(t.toLowerCase(),e)});var C={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+dl.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(dl.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(dl.mondayOfYear(t),e,2)},x:e(d),X:e(h),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},S={a:r,A:a,b:o,B:i,c:l,d:ne,e:ne,H:ae,I:ae,j:re,L:le,m:ee,M:oe,p:u,S:ie,U:Wt,w:Zt,W:$t,x:s,X:c,y:Jt,Y:Qt,Z:Kt,"%":ce};return e}function Gt(t,e,n){var r=t<0?"-":"",a=(r?-t:t)+"",o=a.length;return r+(o68?1900:2e3)}function ee(t,e,n){vl.lastIndex=0;var r=vl.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ne(t,e,n){vl.lastIndex=0;var r=vl.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function re(t,e,n){vl.lastIndex=0;var r=vl.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ae(t,e,n){vl.lastIndex=0;var r=vl.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function oe(t,e,n){vl.lastIndex=0;var r=vl.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ie(t,e,n){vl.lastIndex=0;var r=vl.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function le(t,e,n){vl.lastIndex=0;var r=vl.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function se(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=bi(e)/60|0,a=bi(e)%60;return n+Gt(r,"0",2)+Gt(a,"0",2)}function ce(t,e,n){ml.lastIndex=0;var r=ml.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ue(t){ -for(var e=t.length,n=-1;++n=0?1:-1,l=i*n,s=Math.cos(e),c=Math.sin(e),u=o*c,f=a*s+u*Math.cos(l),d=u*i*Math.sin(l);kl.add(Math.atan2(d,f)),r=t,a=s,o=c}var e,n,r,a,o;Ml.point=function(i,l){Ml.point=t,r=(e=i)*Vi,a=Math.cos(l=(n=l)*Vi/2+ji/4),o=Math.sin(l)},Ml.lineEnd=function(){t(e,n)}}function me(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ke(t){return[Math.atan2(t[1],t[0]),rt(t[2])]}function Me(t,e){return bi(t[0]-e[0])=0;--l)a.point((f=u[l])[0],f[1])}else r(h.x,h.p.x,-1,a);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);a.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,n,r=0,a=t[0];++r0){for(_||(o.polygonStart(),_=!0),o.lineStart();++i1&&2&e&&n.push(n.pop().concat(n.shift())),h.push(n.filter(Ie))}var h,p,g,v=e(o),m=a.invert(r[0],r[1]),y={point:i,lineStart:s,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=d,h=[],p=[]},polygonEnd:function(){y.point=i,y.lineStart=s,y.lineEnd=c,h=ui.merge(h);var t=qe(m,p);h.length?(_||(o.polygonStart(),_=!0),De(h,Fe,t,n,o)):t&&(_||(o.polygonStart(),_=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),h=p=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}},x=Re(),b=e(x),_=!1;return y}}function Ie(t){return t.length>1}function Re(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:k,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Fe(t,e){return((t=t.x)[0]<0?t[1]-qi-Ri:qi-t[1])-((e=e.x)[0]<0?e[1]-qi-Ri:qi-e[1])}function je(t){var e,n=NaN,r=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,i){var l=o>0?ji:-ji,s=bi(o-n);bi(s-ji)0?qi:-qi),t.point(a,r),t.lineEnd(),t.lineStart(),t.point(l,r),t.point(o,r),e=0):a!==l&&s>=ji&&(bi(n-a)Ri?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(a=Math.cos(e))*Math.sin(t))/(a*o*i)):(e+r)/2}function He(t,e,n,r){var a;if(null==t)a=n*qi,r.point(-ji,a),r.point(0,a),r.point(ji,a),r.point(ji,0),r.point(ji,-a),r.point(0,-a),r.point(-ji,-a),r.point(-ji,0),r.point(-ji,a);else if(bi(t[0]-e[0])>Ri){var o=t[0]=0?1:-1,k=w*_,M=k>ji,A=p*x;if(kl.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),o+=M?_+w*Bi:_,M^d>=n^m>=n){var T=xe(me(f),me(t));we(T);var L=xe(a,T);we(L);var C=(M^_>=0?-1:1)*rt(L[2]);(r>C||r===C&&(T[0]||T[1]))&&(i+=M^_>=0?1:-1)}if(!v++)break;d=m,p=x,g=b,f=t}}return(o<-Ri||oo}function n(t){var n,o,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var h,p=[f,d],g=e(f,d),v=i?g?0:a(f,d):g?a(f+(f<0?ji:-ji),d):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(h=r(n,p),(Me(n,h)||Me(p,h))&&(p[0]+=Ri,p[1]+=Ri,g=e(p[0],p[1]))),g!==s)u=0,g?(t.lineStart(),h=r(p,n),t.point(h[0],h[1])):(h=r(n,p),t.point(h[0],h[1]),t.lineEnd()),n=h;else if(l&&n&&i^g){var m;v&o||!(m=r(p,n,!0))||(u=0,i?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||n&&Me(n,p)||t.point(p[0],p[1]),n=p,s=g,o=v},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return u|(c&&s)<<1}}}function r(t,e,n){var r=me(t),a=me(e),i=[1,0,0],l=xe(r,a),s=ye(l,l),c=l[0],u=s-c*c;if(!u)return!n&&t;var f=o*s/u,d=-o*c/u,h=xe(i,l),p=_e(i,f);be(p,_e(l,d));var g=h,v=ye(p,g),m=ye(g,g),y=v*v-m*(ye(p,p)-1);if(!(y<0)){var x=Math.sqrt(y),b=_e(g,(-v-x)/m);if(be(b,p),b=ke(b),!n)return b;var _,w=t[0],k=e[0],M=t[1],A=e[1];k0^b[1]<(bi(b[0]-w)ji^(w<=b[0]&&b[0]<=k)){var S=_e(g,(-v+x)/m);return be(S,p),[b,ke(S)]}}}function a(e,n){var r=i?t:ji-t,a=0;return e<-r?a|=1:e>r&&(a|=2),n<-r?a|=4:n>r&&(a|=8),a}var o=Math.cos(t),i=o>0,l=bi(o)>Ri;return Ne(e,n,mn(t,6*Vi),i?[0,-t]:[-ji,t-ji])}function Ue(t,e,n,r){return function(a){var o,i=a.a,l=a.b,s=i.x,c=i.y,u=l.x,f=l.y,d=0,h=1,p=u-s,g=f-c;if(o=t-s,p||!(o>0)){if(o/=p,p<0){if(o0){if(o>h)return;o>d&&(d=o)}if(o=n-s,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>d&&(d=o)}else if(p>0){if(o0)){if(o/=g,g<0){if(o0){if(o>h)return;o>d&&(d=o)}if(o=r-c,g||!(o<0)){if(o/=g,g<0){if(o>h)return;o>d&&(d=o)}else if(g>0){if(o0&&(a.a={x:s+d*p,y:c+d*g}),h<1&&(a.b={x:s+h*p,y:c+h*g}),a}}}}}}function Ge(t,e,n,r){function a(r,a){return bi(r[0]-t)0?0:3:bi(r[0]-n)0?2:1:bi(r[1]-e)0?1:0:a>0?3:2}function o(t,e){return i(t.x,e.x)}function i(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(l){function s(t){for(var e=0,n=v.length,r=t[1],a=0;ar&&et(c,o,t)>0&&++e:o[1]<=r&&et(c,o,t)<0&&--e,c=o;return 0!==e}function c(o,l,s,c){var u=0,f=0;if(null==o||(u=a(o,s))!==(f=a(l,s))||i(o,l)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==f);else c.point(l[0],l[1])}function u(a,o){return t<=a&&a<=n&&e<=o&&o<=r}function f(t,e){u(t,e)&&l.point(t,e)}function d(){S.point=p,v&&v.push(m=[]),M=!0,k=!1,_=w=NaN}function h(){g&&(p(y,x),b&&k&&L.rejoin(),g.push(L.buffer())),S.point=f,k&&l.lineEnd()}function p(t,e){t=Math.max(-Fl,Math.min(Fl,t)),e=Math.max(-Fl,Math.min(Fl,e));var n=u(t,e);if(v&&m.push([t,e]),M)y=t,x=e,b=n,M=!1,n&&(l.lineStart(),l.point(t,e));else if(n&&k)l.point(t,e);else{var r={a:{x:_,y:w},b:{x:t,y:e}};C(r)?(k||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),n||l.lineEnd(),A=!1):n&&(l.lineStart(),l.point(t,e),A=!1)}_=t,w=e,k=n}var g,v,m,y,x,b,_,w,k,M,A,T=l,L=Re(),C=Ue(t,e,n,r),S={point:f,lineStart:d,lineEnd:h,polygonStart:function(){l=L,g=[],v=[],A=!0},polygonEnd:function(){l=T,g=ui.merge(g);var e=s([t,r]),n=A&&e,a=g.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),c(null,null,1,l),l.lineEnd()),a&&De(g,o,e,c,l),l.polygonEnd()),g=v=m=null}};return S}}function Xe(t){var e=0,n=ji/3,r=cn(t),a=r(e,n);return a.parallels=function(t){return arguments.length?r(e=t[0]*ji/180,n=t[1]*ji/180):[e/ji*180,n/ji*180]},a}function Ye(t,e){function n(t,e){var n=Math.sqrt(o-2*a*Math.sin(e))/a;return[n*Math.sin(t*=a),i-n*Math.cos(t)]}var r=Math.sin(t),a=(r+Math.sin(e))/2,o=1+r*(2*a-r),i=Math.sqrt(o)/a;return n.invert=function(t,e){var n=i-e;return[Math.atan2(t,n)/a,rt((o-(t*t+n*n)*a*a)/(2*a))]},n}function Ze(){function t(t,e){Bl+=a*t-r*e,r=t,a=e}var e,n,r,a;Gl.point=function(o,i){Gl.point=t,e=r=o,n=a=i},Gl.lineEnd=function(){t(e,n)}}function We(t,e){tVl&&(Vl=t),eUl&&(Ul=e)}function $e(){function t(t,e){i.push("M",t,",",e,o)}function e(t,e){i.push("M",t,",",e),l.point=n}function n(t,e){i.push("L",t,",",e)}function r(){l.point=t}function a(){i.push("Z")}var o=Qe(4.5),i=[],l={point:t,lineStart:function(){l.point=e},lineEnd:r,polygonStart:function(){l.lineEnd=a},polygonEnd:function(){l.lineEnd=r,l.point=t},pointRadius:function(t){return o=Qe(t),l},result:function(){if(i.length){var t=i.join("");return i=[],t}}};return l}function Qe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Je(t,e){Ll+=t,Cl+=e,++Sl}function Ke(){function t(t,r){var a=t-e,o=r-n,i=Math.sqrt(a*a+o*o);zl+=i*(e+t)/2,Ol+=i*(n+r)/2,Dl+=i,Je(e=t,n=r)}var e,n;Yl.point=function(r,a){Yl.point=t,Je(e=r,n=a)}}function tn(){Yl.point=Je}function en(){function t(t,e){var n=t-r,o=e-a,i=Math.sqrt(n*n+o*o);zl+=i*(r+t)/2,Ol+=i*(a+e)/2,Dl+=i,i=a*t-r*e,Pl+=i*(r+t),El+=i*(a+e),Nl+=3*i,Je(r=t,a=e)}var e,n,r,a;Yl.point=function(o,i){Yl.point=t,Je(e=r=o,n=a=i)},Yl.lineEnd=function(){t(e,n)}}function nn(t){function e(e,n){t.moveTo(e+i,n),t.arc(e,n,i,0,Bi)}function n(e,n){t.moveTo(e,n),l.point=r}function r(e,n){t.lineTo(e,n)}function a(){l.point=e}function o(){t.closePath()}var i=4.5,l={point:e,lineStart:function(){l.point=n},lineEnd:a,polygonStart:function(){l.lineEnd=o},polygonEnd:function(){l.lineEnd=a,l.point=e},pointRadius:function(t){return i=t,l},result:k};return l}function rn(t){function e(t){return(l?r:n)(t)}function n(e){return ln(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){x=NaN,M.point=o,e.lineStart()}function o(n,r){var o=me([n,r]),i=t(n,r);a(x,b,y,_,w,k,x=i[0],b=i[1],y=n,_=o[0],w=o[1],k=o[2],l,e),e.point(x,b)}function i(){M.point=n,e.lineEnd()}function s(){r(),M.point=c,M.lineEnd=u}function c(t,e){o(f=t,d=e),h=x,p=b,g=_,v=w,m=k,M.point=o}function u(){a(x,b,y,_,w,k,h,p,f,g,v,m,l,e),M.lineEnd=i,i()}var f,d,h,p,g,v,m,y,x,b,_,w,k,M={point:n,lineStart:r,lineEnd:i,polygonStart:function(){e.polygonStart(),M.lineStart=s},polygonEnd:function(){e.polygonEnd(),M.lineStart=r}};return M}function a(e,n,r,l,s,c,u,f,d,h,p,g,v,m){var y=u-e,x=f-n,b=y*y+x*x;if(b>4*o&&v--){var _=l+h,w=s+p,k=c+g,M=Math.sqrt(_*_+w*w+k*k),A=Math.asin(k/=M),T=bi(bi(k)-1)o||bi((y*z+x*O)/b-.5)>.3||l*h+s*p+c*g0&&16,e):Math.sqrt(o)},e}function an(t){var e=rn(function(e,n){return t([e*Ui,n*Ui])});return function(t){return un(e(t))}}function on(t){this.stream=t}function ln(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sn(t){return cn(function(){return t})()}function cn(t){function e(t){return t=l(t[0]*Vi,t[1]*Vi),[t[0]*d+s,c-t[1]*d]}function n(t){return(t=l.invert((t[0]-s)/d,(c-t[1])/d))&&[t[0]*Ui,t[1]*Ui]}function r(){l=ze(i=hn(m,y,x),o);var t=o(g,v);return s=h-t[0]*d,c=p+t[1]*d,a()}function a(){return u&&(u.valid=!1,u=null),e}var o,i,l,s,c,u,f=rn(function(t,e){return t=o(t,e),[t[0]*d+s,c-t[1]*d]}),d=150,h=480,p=250,g=0,v=0,m=0,y=0,x=0,_=Rl,w=b,k=null,M=null;return e.stream=function(t){return u&&(u.valid=!1),u=un(_(i,f(w(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(_=null==t?(k=t,Rl):Ve((k=+t)*Vi),a()):k},e.clipExtent=function(t){return arguments.length?(M=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):b,a()):M},e.scale=function(t){return arguments.length?(d=+t,r()):d},e.translate=function(t){return arguments.length?(h=+t[0],p=+t[1],r()):[h,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Vi,v=t[1]%360*Vi,r()):[g*Ui,v*Ui]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Vi,y=t[1]%360*Vi,x=t.length>2?t[2]%360*Vi:0,r()):[m*Ui,y*Ui,x*Ui]},ui.rebind(e,f,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&n,r()}}function un(t){return ln(t,function(e,n){t.point(e*Vi,n*Vi)})}function fn(t,e){return[t,e]}function dn(t,e){return[t>ji?t-Bi:t<-ji?t+Bi:t,e]}function hn(t,e,n){return t?e||n?ze(gn(t),vn(e,n)):gn(t):e||n?vn(e,n):dn}function pn(t){return function(e,n){return e+=t,[e>ji?e-Bi:e<-ji?e+Bi:e,n]}}function gn(t){var e=pn(t);return e.invert=pn(-t),e}function vn(t,e){function n(t,e){var n=Math.cos(e),l=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),u=c*r+l*a;return[Math.atan2(s*o-u*i,l*r-c*a),rt(u*o+s*i)]}var r=Math.cos(t),a=Math.sin(t),o=Math.cos(e),i=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),l=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),u=c*o-s*i;return[Math.atan2(s*o+c*i,l*r+u*a),rt(u*r-l*a)]},n}function mn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(a,o,i,l){var s=i*e;null!=a?(a=yn(n,a),o=yn(n,o),(i>0?ao)&&(a+=i*Bi)):(a=t+i*Bi,o=t-.5*s);for(var c,u=a;i>0?u>o:u0?e<-qi+Ri&&(e=-qi+Ri):e>qi-Ri&&(e=qi-Ri);var n=i/Math.pow(a(e),o);return[n*Math.sin(o*t),i-n*Math.cos(o*t)]}var r=Math.cos(t),a=function(t){return Math.tan(ji/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(a(e)/a(t)),i=r*Math.pow(a(t),o)/o;return o?(n.invert=function(t,e){var n=i-e,r=tt(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(i/r,1/o))-qi]},n):Cn}function Ln(t,e){function n(t,e){var n=o-e;return[n*Math.sin(a*t),o-n*Math.cos(a*t)]}var r=Math.cos(t),a=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/a+t;return bi(a)1&&et(t[n[r-2]],t[n[r-1]],t[a])<=0;)--r;n[r++]=a}return n.slice(0,r)}function En(t,e){return t[0]-e[0]||t[1]-e[1]}function Nn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function In(t,e,n,r){var a=t[0],o=n[0],i=e[0]-a,l=r[0]-o,s=t[1],c=n[1],u=e[1]-s,f=r[1]-c,d=(l*(s-c)-f*(a-o))/(f*i-l*u);return[a+d*i,s+d*u]}function Rn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Fn(){or(this),this.edge=this.site=this.circle=null}function jn(t){var e=ls.pop()||new Fn;return e.site=t,e}function Bn(t){$n(t),as.remove(t),ls.push(t),or(t)}function Hn(t){var e=t.circle,n=e.x,r=e.cy,a={x:n,y:r},o=t.P,i=t.N,l=[t];Bn(t);for(var s=o;s.circle&&bi(n-s.circle.x)Ri)l=l.L;else{if(!((a=o-Un(l,i))>Ri)){r>-Ri?(e=l.P,n=l):a>-Ri?(e=l,n=l.N):e=n=l;break}if(!l.R){e=l;break}l=l.R}var s=jn(t);if(as.insert(e,s),e||n){if(e===n)return $n(e),n=jn(e.site),as.insert(s,n),s.edge=n.edge=tr(e.site,s.site),Wn(e),void Wn(n);if(!n)return void(s.edge=tr(e.site,s.site));$n(e),$n(n);var c=e.site,u=c.x,f=c.y,d=t.x-u,h=t.y-f,p=n.site,g=p.x-u,v=p.y-f,m=2*(d*v-h*g),y=d*d+h*h,x=g*g+v*v,b={x:(v*y-h*x)/m+u,y:(d*x-g*y)/m+f};nr(n.edge,c,p,b),s.edge=tr(c,t,null,b),n.edge=tr(t,p,null,b),Wn(e),Wn(n)}}function Vn(t,e){var n=t.site,r=n.x,a=n.y,o=a-e;if(!o)return r;var i=t.P;if(!i)return-1/0;n=i.site;var l=n.x,s=n.y,c=s-e;if(!c)return l;var u=l-r,f=1/o-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-o/2)))/f+r:(r+l)/2}function Un(t,e){var n=t.N;if(n)return Vn(n,e);var r=t.site;return r.y===e?r.x:1/0}function Gn(t){this.site=t,this.edges=[]}function Xn(t){for(var e,n,r,a,o,i,l,s,c,u,f=t[0][0],d=t[1][0],h=t[0][1],p=t[1][1],g=rs,v=g.length;v--;)if((o=g[v])&&o.prepare())for(l=o.edges,s=l.length,i=0;iRi||bi(a-n)>Ri)&&(l.splice(i,0,new rr(er(o.site,u,bi(r-f)Ri?{x:f,y:bi(e-f)Ri?{x:bi(n-p)Ri?{x:d,y:bi(e-d)Ri?{x:bi(n-h)=-Fi)){var h=s*s+c*c,p=u*u+f*f,g=(f*h-c*p)/d,v=(s*p-u*h)/d,f=v+l,m=ss.pop()||new Zn;m.arc=t,m.site=a,m.x=g+i,m.y=f+Math.sqrt(g*g+v*v),m.cy=f,t.circle=m;for(var y=null,x=is._;x;)if(m.y=l)return;if(d>p){if(o){if(o.y>=c)return}else o={x:v,y:s};n={x:v,y:c}}else{if(o){if(o.y1)if(d>p){if(o){if(o.y>=c)return}else o={x:(s-a)/r,y:s};n={x:(c-a)/r,y:c}}else{if(o){if(o.y=l)return}else o={x:i,y:r*i+a};n={x:l,y:r*l+a}}else{if(o){if(o.xo||f>i||d=b,k=n>=_,M=k<<1|w,A=M+4;Mo&&(a=e.slice(o,a),l[i]?l[i]+=a:l[++i]=a),(n=n[0])===(r=r[0])?l[i]?l[i]+=r:l[++i]=r:(l[++i]=null,s.push({i:i,x:xr(n,r)})),o=fs.lastIndex;return o=0&&!(n=ui.interpolators[r](t,e)););return n}function wr(t,e){var n,r=[],a=[],o=t.length,i=e.length,l=Math.min(t.length,e.length);for(n=0;n=1?1:t(e)}}function Mr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tr(t){return t*t}function Lr(t){return t*t*t}function Cr(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function Sr(t){return function(e){return Math.pow(e,t)}}function zr(t){return 1-Math.cos(t*qi)}function Or(t){return Math.pow(2,10*(t-1))}function Dr(t){return 1-Math.sqrt(1-t*t)}function Pr(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Bi*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Bi/e)}}function Er(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Nr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Ir(t,e){t=ui.hcl(t),e=ui.hcl(e);var n=t.h,r=t.c,a=t.l,o=e.h-n,i=e.c-r,l=e.l-a;return isNaN(i)&&(i=0,r=isNaN(r)?e.c:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return dt(n+o*t,r+i*t,a+l*t)+""}}function Rr(t,e){t=ui.hsl(t),e=ui.hsl(e);var n=t.h,r=t.s,a=t.l,o=e.h-n,i=e.s-r,l=e.l-a;return isNaN(i)&&(i=0,r=isNaN(r)?e.s:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return ut(n+o*t,r+i*t,a+l*t)+""}}function Fr(t,e){t=ui.lab(t),e=ui.lab(e);var n=t.l,r=t.a,a=t.b,o=e.l-n,i=e.a-r,l=e.b-a;return function(t){return pt(n+o*t,r+i*t,a+l*t)+""}}function jr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Br(t){var e=[t.a,t.b],n=[t.c,t.d],r=qr(e),a=Hr(e,n),o=qr(Vr(n,e,-a))||0;e[0]*n[1]180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(Ur(n)+"rotate(",null,")")-2,x:xr(t,e)})):e&&n.push(Ur(n)+"rotate("+e+")")}function Yr(t,e,n,r){t!==e?r.push({i:n.push(Ur(n)+"skewX(",null,")")-2,x:xr(t,e)}):e&&n.push(Ur(n)+"skewX("+e+")")}function Zr(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var a=n.push(Ur(n)+"scale(",null,",",null,")");r.push({i:a-4,x:xr(t[0],e[0])},{i:a-2,x:xr(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(Ur(n)+"scale("+e+")")}function Wr(t,e){var n=[],r=[];return t=ui.transform(t),e=ui.transform(e),Gr(t.translate,e.translate,n,r),Xr(t.rotate,e.rotate,n,r),Yr(t.skew,e.skew,n,r),Zr(t.scale,e.scale,n,r),t=e=null,function(t){for(var e,a=-1,o=r.length;++a=0;)n.push(a[r])}function sa(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(a=o.length))for(var a,o,i=-1;++ia&&(r=n,a=e);return r}function xa(t){return t.reduce(ba,0)}function ba(t,e){return t+e[1]}function _a(t,e){return wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wa(t,e){for(var n=-1,r=+t[0],a=(t[1]-r)/e,o=[];++n<=e;)o[n]=a*n+r;return o}function ka(t){return[ui.min(t),ui.max(t)]}function Ma(t,e){return t.value-e.value}function Aa(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Ta(t,e){t._pack_next=e,e._pack_prev=t}function La(t,e){var n=e.x-t.x,r=e.y-t.y,a=t.r+e.r;return.999*a*a>n*n+r*r}function Ca(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),d=Math.min(t.y-t.r,d),h=Math.max(t.y+t.r,h)}if((n=t.children)&&(c=n.length)){var n,r,a,o,i,l,s,c,u=1/0,f=-1/0,d=1/0,h=-1/0;if(n.forEach(Sa),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(a=n[1],a.x=a.r,a.y=0,e(a),c>2))for(o=n[2],Da(r,a,o),e(o),Aa(r,o),r._pack_prev=o,Aa(o,a),a=r._pack_next,i=3;i=0;)e=a[o],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Fa(t,e,n){return t.a.parent===e.parent?t.a:n}function ja(t){return 1+ui.max(t,function(t){return t.y})}function Ba(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ha(t){var e=t.children;return e&&e.length?Ha(e[0]):t}function qa(t){var e,n=t.children;return n&&(e=n.length)?qa(n[e-1]):t}function Va(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ua(t,e){var n=t.x+e[3],r=t.y+e[0],a=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return a<0&&(n+=a/2,a=0),o<0&&(r+=o/2,o=0),{x:n,y:r,dx:a,dy:o}}function Ga(t){var e=t[0],n=t[t.length-1];return e2?$a:Ya,s=r?Qr:$r;return i=a(t,e,s,n),l=a(e,t,s,_r),o}function o(t){return i(t)}var i,l;return o.invert=function(t){return l(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},o.range=function(t){return arguments.length?(e=t,a()):e},o.rangeRound=function(t){return o.range(t).interpolate(jr)},o.clamp=function(t){return arguments.length?(r=t,a()):r},o.interpolate=function(t){return arguments.length?(n=t,a()):n},o.ticks=function(e){return eo(t,e)},o.tickFormat=function(e,n){return no(t,e,n)},o.nice=function(e){return Ka(t,e),a()},o.copy=function(){return Qa(t,e,n,r)},a()}function Ja(t,e){return ui.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ka(t,e){return Za(t,Wa(to(t,e)[2])),Za(t,Wa(to(t,e)[2])),t}function to(t,e){null==e&&(e=10);var n=Ga(t),r=n[1]-n[0],a=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*a;return o<=.15?a*=10:o<=.35?a*=5:o<=.75&&(a*=2),n[0]=Math.ceil(n[0]/a)*a,n[1]=Math.floor(n[1]/a)*a+.5*a,n[2]=a,n}function eo(t,e){return ui.range.apply(ui,to(t,e))}function no(t,e,n){var r=to(t,e);if(n){var a=ul.exec(n);if(a.shift(),"s"===a[8]){var o=ui.formatPrefix(Math.max(bi(r[0]),bi(r[1])));return a[7]||(a[7]="."+ro(o.scale(r[2]))),a[8]="f",n=ui.format(a.join("")),function(t){return n(o.scale(t))+o.symbol}}a[7]||(a[7]="."+ao(a[8],r)),n=a.join("")}else n=",."+ro(r[2])+"f";return ui.format(n)}function ro(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ao(t,e){var n=ro(e[2]);return t in ks?Math.abs(n-ro(Math.max(bi(e[0]),bi(e[1]))))+ +("e"!==t):n-2*("%"===t)}function oo(t,e,n,r){function a(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function i(e){return t(a(e))}return i.invert=function(e){return o(t.invert(e))},i.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(a)),i):r},i.base=function(n){return arguments.length?(e=+n,t.domain(r.map(a)),i):e},i.nice=function(){var e=Za(r.map(a),n?Math:As);return t.domain(e),r=e.map(o),i},i.ticks=function(){var t=Ga(r),i=[],l=t[0],s=t[1],c=Math.floor(a(l)),u=Math.ceil(a(s)),f=e%1?2:e;if(isFinite(u-c)){if(n){for(;c0;d--)i.push(o(c)*d);for(c=0;i[c]s;u--);i=i.slice(c,u)}return i},i.tickFormat=function(t,n){if(!arguments.length)return Ms;arguments.length<2?n=Ms:"function"!=typeof n&&(n=ui.format(n));var r=Math.max(1,e*t/i.ticks().length);return function(t){var i=t/o(Math.round(a(t)));return i*e0?l[n-1]:t[0],n0?0:1}function _o(t,e,n,r,a){var o=t[0]-e[0],i=t[1]-e[1],l=(a?r:-r)/Math.sqrt(o*o+i*i),s=l*i,c=-l*o,u=t[0]+s,f=t[1]+c,d=e[0]+s,h=e[1]+c,p=(u+d)/2,g=(f+h)/2,v=d-u,m=h-f,y=v*v+m*m,x=n-r,b=u*h-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,k=(-b*v-m*_)/y,M=(b*m+v*_)/y,A=(-b*v+m*_)/y,T=w-p,L=k-g,C=M-p,S=A-g;return T*T+L*L>C*C+S*S&&(w=M,k=A),[[w-s,k-c],[w*n/x,k*n/x]]}function wo(t){function e(e){function i(){c.push("M",o(t(u),l))}for(var s,c=[],u=[],f=-1,d=e.length,h=Ct(n),p=Ct(r);++f1?t.join("L"):t+"Z"}function Mo(t){return t.join("L")+"Z"}function Ao(t){for(var e=0,n=t.length,r=t[0],a=[r[0],",",r[1]];++e1&&a.push("H",r[0]),a.join("")}function To(t){for(var e=0,n=t.length,r=t[0],a=[r[0],",",r[1]];++e1){l=e[1],o=t[s],s++,r+="C"+(a[0]+i[0])+","+(a[1]+i[1])+","+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1];for(var c=2;c9&&(a=3*e/Math.sqrt(a),i[l]=a*n,i[l+1]=a*r));for(l=-1;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+i[l]*i[l])),o.push([a||0,i[l]*a||0]);return o}function qo(t){return t.length<3?ko(t):t[0]+Oo(t,Ho(t))}function Vo(t){for(var e,n,r,a=-1,o=t.length;++a0;)h[--l].call(t,i);if(o>=1)return g.event&&g.event.end.call(t,t.__data__,e),--p.count?delete p[r]:delete t[n],1}var s,c,u,d,h,p=t[n]||(t[n]={active:0,count:0}),g=p[r];g||(s=a.time,c=Pt(o,0,s),g=p[r]={tween:new f,time:s,timer:c,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++p.count)}function ri(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function ai(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function oi(t){return t.toISOString()}function ii(t,e,n){function r(e){return t(e)}function a(t,n){var r=t[1]-t[0],a=r/n,o=ui.bisect($s,a);return o==$s.length?[e.year,to(t.map(function(t){return t/31536e6}),n)[2]]:o?e[a/$s[o-1]<$s[o]/a?o-1:o]:[Ks,to(t,n)[2]]}return r.invert=function(e){return li(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain(e),r):t.domain().map(li)},r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,li(+n+1),e).length}var o=r.domain(),i=Ga(o),l=null==t?a(i,10):"number"==typeof t&&a(i,t);return l&&(t=l[0],e=l[1]),r.domain(Za(o,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=li(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=li(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Ga(r.domain()),o=null==t?a(n,10):"number"==typeof t?a(n,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(n[0],li(+n[1]+1),e<1?1:e)},r.tickFormat=function(){return n},r.copy=function(){return ii(t.copy(),e,n)},Ja(r,t)}function li(t){return new Date(t)}function si(t){return JSON.parse(t.responseText)}function ci(t){var e=hi.createRange();return e.selectNode(hi.body),e.createContextualFragment(t.responseText)}var ui={version:"3.5.17"},fi=[].slice,di=function(t){return fi.call(t)},hi=this.document;if(hi)try{di(hi.documentElement.childNodes)[0].nodeType}catch(t){di=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),hi)try{hi.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var pi=this.Element.prototype,gi=pi.setAttribute,vi=pi.setAttributeNS,mi=this.CSSStyleDeclaration.prototype,yi=mi.setProperty;pi.setAttribute=function(t,e){gi.call(this,t,e+"")},pi.setAttributeNS=function(t,e,n){vi.call(this,t,e,n+"")},mi.setProperty=function(t,e,n){yi.call(this,t,e+"",n)}}ui.ascending=a,ui.descending=function(t,e){return et?1:e>=t?0:NaN},ui.min=function(t,e){var n,r,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++ar&&(n=r)}else{for(;++a=r){n=r;break}for(;++ar&&(n=r)}return n},ui.max=function(t,e){var n,r,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++an&&(n=r)}else{for(;++a=r){n=r;break}for(;++an&&(n=r)}return n},ui.extent=function(t,e){var n,r,a,o=-1,i=t.length;if(1===arguments.length){for(;++o=r){n=a=r;break}for(;++or&&(n=r),a=r){n=a=r;break}for(;++or&&(n=r),a1)return s/(u-1)},ui.deviation=function(){var t=ui.variance.apply(this,arguments);return t?Math.sqrt(t):t};var xi=l(a);ui.bisectLeft=xi.left,ui.bisect=ui.bisectRight=xi.right,ui.bisector=function(t){return l(1===t.length?function(e,n){return a(t(e),n)}:t)},ui.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,o<2&&(e=0));for(var r,a,o=n-e;o;)a=Math.random()*o--|0,r=t[o+e],t[o+e]=t[a+e],t[a+e]=r;return t},ui.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},ui.pairs=function(t){for(var e=0,n=t.length-1,r=t[0],a=new Array(n<0?0:n);e=0;)for(r=t[a],e=r.length;--e>=0;)n[--i]=r[e];return n};var bi=Math.abs;ui.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var r,a=[],o=c(bi(n)),i=-1;if(t*=o,e*=o,n*=o,n<0)for(;(r=t+n*++i)>e;)a.push(r/o);else for(;(r=t+n*++i)=o.length)return r?r.call(a,i):n?i.sort(n):i;for(var s,c,u,d,h=-1,p=i.length,g=o[l++],v=new f;++h=o.length)return t;var r=[],a=i[n++];return t.forEach(function(t,a){r.push({key:t,values:e(a,n)})}),a?r.sort(function(t,e){return a(t.key,e.key)}):r}var n,r,a={},o=[],i=[];return a.map=function(e,n){return t(n,e,0)},a.entries=function(n){return e(t(ui.map,n,0),0)},a.key=function(t){return o.push(t),a},a.sortKeys=function(t){return i[o.length-1]=t,a},a.sortValues=function(t){return n=t,a},a.rollup=function(t){return r=t,a},a},ui.set=function(t){var e=new x;if(t)for(var n=0,r=t.length;n=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},ui.event=null,ui.requote=function(t){return t.replace(Mi,"\\$&")};var Mi=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ai={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},Ti=function(t,e){return e.querySelector(t)},Li=function(t,e){return e.querySelectorAll(t)},Ci=function(t,e){var n=t.matches||t[w(t,"matchesSelector")];return(Ci=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Ti=function(t,e){return Sizzle(t,e)[0]||null},Li=Sizzle,Ci=Sizzle.matchesSelector),ui.selection=function(){return ui.select(hi.documentElement)};var Si=ui.selection.prototype=[];Si.select=function(t){var e,n,r,a,o=[];t=z(t);for(var i=-1,l=this.length;++i=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Oi.hasOwnProperty(n)?{space:Oi[n],local:t}:t}},Si.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=ui.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Si.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=N(t)).length,a=-1;if(e=n.classList){for(;++a=0;)(n=r[a])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},Si.sort=function(t){t=U.apply(this,arguments);for(var e=-1,n=this.length;++e0&&(e=e.transition().duration(S)),e.call(t.event)}function l(){_&&_.domain(b.range().map(function(t){return(t-M.x)/M.k}).map(b.invert)),k&&k.domain(w.range().map(function(t){return(t-M.y)/M.k}).map(w.invert))}function s(t){z++||t({type:"zoomstart"})}function c(t){l(),t({type:"zoom",scale:M.k,translate:[M.x,M.y]})}function u(t){--z||(t({type:"zoomend"}),v=null)}function f(){function t(){l=1,o(ui.mouse(a),d),c(i)}function n(){f.on(D,null).on(P,null),h(l),u(i)}var a=this,i=N.of(a,arguments),l=0,f=ui.select(r(a)).on(D,t).on(P,n),d=e(ui.mouse(a)),h=Q(a);Bs.call(a),s(i)}function d(){function t(){var t=ui.touches(p);return h=M.k,t.forEach(function(t){ -t.identifier in v&&(v[t.identifier]=e(t))}),t}function n(){var e=ui.event.target;ui.select(e).on(b,r).on(_,l),w.push(e);for(var n=ui.event.changedTouches,a=0,o=n.length;a1){var u=s[0],f=s[1],d=u[0]-f[0],h=u[1]-f[1];m=d*d+h*h}}function r(){var t,e,n,r,i=ui.touches(p);Bs.call(p);for(var l=0,s=i.length;l=c)return i;if(a)return a=!1,o;var e=u;if(34===t.charCodeAt(e)){for(var n=e;n++=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fl=ui.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=ui.round(t,Rt(t,e))).toFixed(Math.max(0,Math.min(20,Rt(t*(1+1e-15),e))))}}),dl=ui.time={},hl=Date;Ht.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(){pl.setUTCDate.apply(this._,arguments)},setDay:function(){pl.setUTCDay.apply(this._,arguments)},setFullYear:function(){pl.setUTCFullYear.apply(this._,arguments)},setHours:function(){pl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){pl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){pl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){pl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){pl.setUTCSeconds.apply(this._,arguments)},setTime:function(){pl.setTime.apply(this._,arguments)}};var pl=Date.prototype;dl.year=qt(function(t){return t=dl.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),dl.years=dl.year.range,dl.years.utc=dl.year.utc.range,dl.day=qt(function(t){var e=new hl(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),dl.days=dl.day.range,dl.days.utc=dl.day.utc.range,dl.dayOfYear=function(t){var e=dl.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=dl[t]=qt(function(t){return(t=dl.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});dl[t+"s"]=n.range,dl[t+"s"].utc=n.utc.range,dl[t+"OfYear"]=function(t){var n=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(n+e)%7)/7)}}),dl.week=dl.sunday,dl.weeks=dl.sunday.range,dl.weeks.utc=dl.sunday.utc.range,dl.weekOfYear=dl.sundayOfYear;var gl={"-":"",_:" ",0:"0"},vl=/^\s*\d+/,ml=/^%/;ui.locale=function(t){return{numberFormat:jt(t),timeFormat:Ut(t)}};var yl=ui.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"]});ui.format=yl.numberFormat,ui.geo={},fe.prototype={s:0,t:0,add:function(t){de(t,this.t,xl),de(xl.s,this.s,this),this.s?this.t+=xl.t:this.s=xl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xl=new fe;ui.geo.stream=function(t,e){t&&bl.hasOwnProperty(t.type)?bl[t.type](t,e):he(t,e)};var bl={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,a=n.length;++rh&&(h=e)}function e(e,n){var r=me([e*Vi,n*Vi]);if(m){var a=xe(m,r),o=[a[1],-a[0],0],i=xe(o,a);we(i),i=ke(i);var s=e-p,c=s>0?1:-1,g=i[0]*Ui*c,v=bi(s)>180;if(v^(c*ph&&(h=y)}else if(g=(g+360)%360-180,v^(c*ph&&(h=n);v?el(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e):d>=u?(ed&&(d=e)):e>p?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e)}else t(e,n);m=r,p=e}function n(){_.point=e}function r(){b[0]=u,b[1]=d,_.point=t,m=null}function a(t,n){if(m){var r=t-p;y+=bi(r)>180?r+(r>0?360:-360):r}else g=t,v=n;Ml.point(t,n),e(t,n)}function o(){Ml.lineStart()}function i(){a(g,v),Ml.lineEnd(),bi(y)>Ri&&(u=-(d=180)),b[0]=u,b[1]=d,m=null}function l(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tRi?h=90:y<-Ri&&(f=-90),b[0]=u,b[1]=d}};return function(t){h=d=-(u=f=1/0),x=[],ui.geo.stream(t,_);var e=x.length;if(e){x.sort(s);for(var n,r=1,a=x[0],o=[a];rl(a[0],a[1])&&(a[1]=n[1]),l(n[0],a[1])>l(a[0],a[1])&&(a[0]=n[0])):o.push(a=n);for(var i,n,p=-1/0,e=o.length-1,r=0,a=o[e];r<=e;a=n,++r)n=o[r],(i=l(a[1],n[0]))>p&&(p=i,u=n[0],d=a[1])}return x=b=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[d,h]]}}(),ui.geo.centroid=function(t){Al=Tl=Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,Il);var e=Pl,n=El,r=Nl,a=e*e+n*n+r*r;return a=.12&&a<.234&&r>=-.425&&r<-.214?i:a>=.166&&a<.234&&r>=-.214&&r<-.115?l:o).invert(t)},t.stream=function(t){var e=o.stream(t),n=i.stream(t),r=l.stream(t);return{point:function(t,a){e.point(t,a),n.point(t,a),r.point(t,a)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(o.precision(e),i.precision(e),l.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),i.scale(.35*e),l.scale(e),t.translate(o.translate())):o.scale()},t.translate=function(e){if(!arguments.length)return o.translate();var c=o.scale(),u=+e[0],f=+e[1];return n=o.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(s).point,r=i.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ri,f+.12*c+Ri],[u-.214*c-Ri,f+.234*c-Ri]]).stream(s).point,a=l.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ri,f+.166*c+Ri],[u-.115*c-Ri,f+.234*c-Ri]]).stream(s).point,t},t.scale(1070)};var jl,Bl,Hl,ql,Vl,Ul,Gl={point:k,lineStart:k,lineEnd:k,polygonStart:function(){Bl=0,Gl.lineStart=Ze},polygonEnd:function(){Gl.lineStart=Gl.lineEnd=Gl.point=k,jl+=bi(Bl/2)}},Xl={point:We,lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k},Yl={point:Je,lineStart:Ke,lineEnd:tn,polygonStart:function(){Yl.lineStart=en},polygonEnd:function(){Yl.point=Je,Yl.lineStart=Ke,Yl.lineEnd=tn}};ui.geo.path=function(){function t(t){return t&&("function"==typeof l&&o.pointRadius(+l.apply(this,arguments)),i&&i.valid||(i=a(o)),ui.geo.stream(t,i)),o.result()}function e(){return i=null,t}var n,r,a,o,i,l=4.5;return t.area=function(t){return jl=0,ui.geo.stream(t,a(Gl)),jl},t.centroid=function(t){return Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,a(Yl)),Nl?[Pl/Nl,El/Nl]:Dl?[zl/Dl,Ol/Dl]:Sl?[Ll/Sl,Cl/Sl]:[NaN,NaN]},t.bounds=function(t){return Vl=Ul=-(Hl=ql=1/0),ui.geo.stream(t,a(Xl)),[[Hl,ql],[Vl,Ul]]},t.projection=function(t){return arguments.length?(a=(n=t)?t.stream||an(t):b,e()):n},t.context=function(t){return arguments.length?(o=null==(r=t)?new $e:new nn(t),"function"!=typeof l&&o.pointRadius(l),e()):r},t.pointRadius=function(e){return arguments.length?(l="function"==typeof e?e:(o.pointRadius(+e),+e),t):l},t.projection(ui.geo.albersUsa()).context(null)},ui.geo.transform=function(t){return{stream:function(e){var n=new on(e);for(var r in t)n[r]=t[r];return n}}},on.prototype={point:function(t,e){this.stream.point(t,e)},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()}},ui.geo.projection=sn,ui.geo.projectionMutator=cn,(ui.geo.equirectangular=function(){return sn(fn)}).raw=fn.invert=fn,ui.geo.rotation=function(t){function e(e){return e=t(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e}return t=hn(t[0]%360*Vi,t[1]*Vi,t.length>2?t[2]*Vi:0),e.invert=function(e){return e=t.invert(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e},e},dn.invert=fn,ui.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hn(-t[0]*Vi,-t[1]*Vi,0).invert,a=[];return n(null,null,1,{point:function(t,n){a.push(t=e(t,n)),t[0]*=Ui,t[1]*=Ui}}),{type:"Polygon",coordinates:[a]}}var e,n,r=[0,0],a=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=mn((e=+r)*Vi,a*Vi),t):e},t.precision=function(r){return arguments.length?(n=mn(e*Vi,(a=+r)*Vi),t):a},t.angle(90)},ui.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Vi,a=t[1]*Vi,o=e[1]*Vi,i=Math.sin(r),l=Math.cos(r),s=Math.sin(a),c=Math.cos(a),u=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*i)*n+(n=c*u-s*f*l)*n),s*u+c*f*l)},ui.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ui.range(Math.ceil(o/v)*v,a,v).map(d).concat(ui.range(Math.ceil(c/m)*m,s,m).map(h)).concat(ui.range(Math.ceil(r/p)*p,n,p).filter(function(t){return bi(t%v)>Ri}).map(u)).concat(ui.range(Math.ceil(l/g)*g,i,g).filter(function(t){return bi(t%m)>Ri}).map(f))}var n,r,a,o,i,l,s,c,u,f,d,h,p=10,g=p,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(o).concat(h(s).slice(1),d(a).reverse().slice(1),h(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],c=+e[0][1],s=+e[1][1],o>a&&(e=o,o=a,a=e),c>s&&(e=c,c=s,s=e),t.precision(y)):[[o,c],[a,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],l=+e[0][1],i=+e[1][1],r>n&&(e=r,r=n,n=e),l>i&&(e=l,l=i,i=e),t.precision(y)):[[r,l],[n,i]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(y=+e,u=xn(l,i,90),f=bn(r,n,y),d=xn(c,s,90),h=bn(o,a,y),t):y},t.majorExtent([[-180,-90+Ri],[180,90-Ri]]).minorExtent([[-180,-80-Ri],[180,80+Ri]])},ui.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||a.apply(this,arguments)]}}var e,n,r=_n,a=wn;return t.distance=function(){return ui.geo.distance(e||r.apply(this,arguments),n||a.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(a=e,n="function"==typeof e?null:e,t):a},t.precision=function(){return arguments.length?t:0},t},ui.geo.interpolate=function(t,e){return kn(t[0]*Vi,t[1]*Vi,e[0]*Vi,e[1]*Vi)},ui.geo.length=function(t){return Zl=0,ui.geo.stream(t,Wl),Zl};var Zl,Wl={sphere:k,point:k,lineStart:Mn,lineEnd:k,polygonStart:k,polygonEnd:k},$l=An(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ui.geo.azimuthalEqualArea=function(){return sn($l)}).raw=$l;var Ql=An(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(ui.geo.azimuthalEquidistant=function(){return sn(Ql)}).raw=Ql,(ui.geo.conicConformal=function(){return Xe(Tn)}).raw=Tn,(ui.geo.conicEquidistant=function(){return Xe(Ln)}).raw=Ln;var Jl=An(function(t){return 1/t},Math.atan);(ui.geo.gnomonic=function(){return sn(Jl)}).raw=Jl,Cn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-qi]},(ui.geo.mercator=function(){return Sn(Cn)}).raw=Cn;var Kl=An(function(){return 1},Math.asin);(ui.geo.orthographic=function(){return sn(Kl)}).raw=Kl;var ts=An(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ui.geo.stereographic=function(){return sn(ts)}).raw=ts,zn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-qi]},(ui.geo.transverseMercator=function(){var t=Sn(zn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=zn,ui.geom={},ui.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,a=Ct(n),o=Ct(r),i=t.length,l=[],s=[];for(e=0;e=0;--e)h.push(t[l[c[e]][2]]);for(e=+f;e=r&&c.x<=o&&c.y>=a&&c.y<=i?[[r,i],[o,i],[o,a],[r,a]]:[]).point=t[l]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Ri)*Ri,y:Math.round(i(t,e)/Ri)*Ri,i:e}})}var r=On,a=Dn,o=r,i=a,l=cs;return t?e(t):(e.links=function(t){return cr(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return cr(n(t)).cells.forEach(function(n,r){for(var a,o=n.site,i=n.edges.sort(Yn),l=-1,s=i.length,c=i[s-1].edge,u=c.l===o?c.r:c.l;++l=c,d=r>=u,h=d<<1|f;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]=pr()),f?a=c:l=c,d?i=u:s=u,o(t,e,n,r,a,i,l,s)}var u,f,d,h,p,g,v,m,y,x=Ct(l),b=Ct(s);if(null!=e)g=e,v=n,m=r,y=a;else if(m=y=-(g=v=1/0),f=[],d=[],p=t.length,i)for(h=0;hm&&(m=u.x),u.y>y&&(y=u.y),f.push(u.x),d.push(u.y);else for(h=0;hm&&(m=_),w>y&&(y=w),f.push(_),d.push(w)}var k=m-g,M=y-v;k>M?y=v+k:m=g+M;var A=pr();if(A.add=function(t){o(A,t,+x(t,++h),+b(t,h),g,v,m,y)},A.visit=function(t){gr(t,A,g,v,m,y)},A.find=function(t){return vr(A,t[0],t[1],g,v,m,y)},h=-1,null==e){for(;++h=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=hs.get(n)||ds,r=ps.get(r)||b,kr(r(n.apply(null,fi.call(arguments,1))))},ui.interpolateHcl=Ir,ui.interpolateHsl=Rr,ui.interpolateLab=Fr,ui.interpolateRound=jr,ui.transform=function(t){var e=hi.createElementNS(ui.ns.prefix.svg,"g");return(ui.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Br(n?n.matrix:gs)})(t)},Br.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gs={a:1,b:0,c:0,d:1,e:0,f:0};ui.interpolateTransform=Wr,ui.layout={},ui.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n0?a=t:(n.c=null,n.t=NaN,n=null,c.end({type:"end",alpha:a=0})):t>0&&(c.start({type:"start",alpha:a=t}),n=Pt(s.tick)),s):a},s.start=function(){function t(t,r){if(!n){for(n=new Array(a),s=0;s=0;)i.push(u=c[s]),u.parent=o,u.depth=o.depth+1;r&&(o.value=0),o.children=c}else r&&(o.value=+r.call(t,o,o.depth)||0),delete o.children;return sa(a,function(t){var n,a;e&&(n=t.children)&&n.sort(e),r&&(a=t.parent)&&(a.value+=t.value)}),l}var e=fa,n=ca,r=ua;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(la(e,function(t){t.children&&(t.value=0)}),sa(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},ui.layout.partition=function(){function t(e,n,r,a){var o=e.children;if(e.x=n,e.y=e.depth*a,e.dx=r,e.dy=a,o&&(i=o.length)){var i,l,s,c=-1;for(r=e.value?r/e.value:0;++cl&&(l=r),i.push(r)}for(n=0;n0)for(o=-1;++o=u[0]&&l<=u[1]&&(i=s[ui.bisect(f,l,1,h)-1],i.y+=p,i.push(t[o]));return s}var e=!0,n=Number,r=ka,a=_a;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Ct(e),t):r},t.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return wa(t,e)}:Ct(e),t):a},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},ui.layout.pack=function(){function t(t,o){var i=n.call(this,t,o),l=i[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,sa(l,function(t){t.r=+u(t.value)}),sa(l,Ca),r){var f=r*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;sa(l,function(t){t.r+=f}),sa(l,Ca),sa(l,function(t){t.r-=f})}return Oa(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),i}var e,n=ui.layout.hierarchy().sort(Ma),r=0,a=[1,1];return t.size=function(e){return arguments.length?(a=e,t):a},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},ia(t,n)},ui.layout.tree=function(){function t(t,a){var u=i.call(this,t,a),f=u[0],d=e(f);if(sa(d,n),d.parent.m=-d.z,la(d,r),c)la(f,o);else{var h=f,p=f,g=f;la(f,function(t){t.xp.x&&(p=t),t.depth>g.depth&&(g=t)});var v=l(h,p)/2-h.x,m=s[0]/(p.x+l(p,h)/2+v),y=s[1]/(g.depth||1);la(f,function(t){t.x=(t.x+v)*m,t.y=t.depth*y})}return u}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var a,o=e.children,i=0,l=o.length;i0&&(Ia(Fa(i,t,n),t,r),c+=r,u+=r),f+=i.m,c+=a.m,d+=s.m,u+=o.m;i&&!Na(o)&&(o.t=i,o.m+=f-u),a&&!Ea(s)&&(s.t=a,s.m+=c-d,n=t)}return n}function o(t){t.x*=s[0],t.y=t.depth*s[1]}var i=ui.layout.hierarchy().sort(null).value(null),l=Pa,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(l=e,t):l},t.size=function(e){return arguments.length?(c=null==(s=e)?o:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:o,t):c?s:null},ia(t,i)},ui.layout.cluster=function(){function t(t,o){var i,l=e.call(this,t,o),s=l[0],c=0;sa(s,function(t){var e=t.children;e&&e.length?(t.x=Ba(e),t.y=ja(e)):(t.x=i?c+=n(t,i):0,t.y=0,i=t)});var u=Ha(s),f=qa(s),d=u.x-n(u,f)/2,h=f.x+n(f,u)/2;return sa(s,a?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-d)/(h-d)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),l}var e=ui.layout.hierarchy().sort(null).value(null),n=Pa,r=[1,1],a=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(a=null==(r=e),t):a?null:r},t.nodeSize=function(e){return arguments.length?(a=null!=(r=e),t):a?r:null},ia(t,e)},ui.layout.treemap=function(){function t(t,e){for(var n,r,a=-1,o=t.length;++a0;)u.push(i=d[s-1]),u.area+=i.area,"squarify"!==h||(l=r(u,g))<=p?(d.pop(),p=l):(u.area-=u.pop().area,a(u,g,c,!1),g=Math.min(c.dx,c.dy),u.length=u.area=0,p=1/0);u.length&&(a(u,g,c,!0),u.length=u.area=0),o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,i=f(e),l=r.slice(),s=[];for(t(l,i.dx*i.dy/e.value),s.area=0;o=l.pop();)s.push(o),s.area+=o.area,null!=o.z&&(a(s,o.z?i.dx:i.dy,i,!l.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,a=0,o=1/0,i=-1,l=t.length;++ia&&(a=n));return r*=r,e*=e,r?Math.max(e*a*p/r,r/(e*o*p)):1/0}function a(t,e,n,r){var a,o=-1,i=t.length,l=n.x,c=n.y,u=e?s(t.area/e):0;if(e==n.dx){for((r||u>n.dy)&&(u=n.dy);++on.dx)&&(u=n.dx);++o1);return t+e*n*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=ui.random.normal.apply(ui,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ui.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;nf?0:1;if(c=Hi)return e(c,h)+(t?e(t,1-h):"")+"Z";var p,g,v,m,y,x,b,_,w,k,M,A,T=0,L=0,C=[];if((m=(+s.apply(this,arguments)||0)/2)&&(v=o===zs?Math.sqrt(t*t+c*c):+o.apply(this,arguments),h||(L*=-1),c&&(L=rt(v/c*Math.sin(m))),t&&(T=rt(v/t*Math.sin(m)))),c){y=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var S=Math.abs(f-u-2*L)<=ji?0:1;if(L&&bo(y,x,b,_)===h^S){var z=(u+f)/2;y=c*Math.cos(z),x=c*Math.sin(z),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),k=t*Math.sin(f-T),M=t*Math.cos(u+T),A=t*Math.sin(u+T);var O=Math.abs(u-f+2*T)<=ji?0:1;if(T&&bo(w,k,M,A)===1-h^O){var D=(u+f)/2;w=t*Math.cos(D),k=t*Math.sin(D),M=A=null}}else w=k=0;if(d>Ri&&(p=Math.min(Math.abs(c-t)/2,+a.apply(this,arguments)))>.001){g=tji)+",1 "+e}function a(t,e,n,r){return"Q 0,0 "+r}var o=_n,i=wn,l=Go,s=mo,c=yo;return t.radius=function(e){return arguments.length?(l=Ct(e),t):l},t.source=function(e){return arguments.length?(o=Ct(e),t):o},t.target=function(e){return arguments.length?(i=Ct(e),t):i},t.startAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.endAngle=function(e){return arguments.length?(c=Ct(e),t):c},t},ui.svg.diagonal=function(){function t(t,a){var o=e.call(this,t,a),i=n.call(this,t,a),l=(o.y+i.y)/2,s=[o,{x:o.x,y:l},{x:i.x,y:l},i];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=_n,n=wn,r=Xo;return t.source=function(n){return arguments.length?(e=Ct(n),t):e},t.target=function(e){return arguments.length?(n=Ct(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},ui.svg.diagonal.radial=function(){var t=ui.svg.diagonal(),e=Xo,n=t.projection;return t.projection=function(t){return arguments.length?n(Yo(e=t)):e},t},ui.svg.symbol=function(){function t(t,r){return(Ns.get(e.call(this,t,r))||$o)(n.call(this,t,r))}var e=Wo,n=Zo;return t.type=function(n){return arguments.length?(e=Ct(n),t):e},t.size=function(e){return arguments.length?(n=Ct(e),t):n},t};var Ns=ui.map({circle:$o,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Rs)),n=e*Rs;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Is),n=e*Is/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Is),n=e*Is/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});ui.svg.symbolTypes=Ns.keys();var Is=Math.sqrt(3),Rs=Math.tan(30*Vi);Si.transition=function(t){for(var e,n,r=Fs||++qs,a=ei(t),o=[],i=js||{time:Date.now(),ease:Cr,delay:0,duration:250},l=-1,s=this.length;++lrect,.s>rect").attr("width",f[1]-f[0])}function a(t){t.select(".extent").attr("y",d[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function o(){function o(){32==ui.event.keyCode&&(S||(x=null,O[0]-=f[1],O[1]-=d[1],S=2),T())}function g(){32==ui.event.keyCode&&2==S&&(O[0]+=f[1],O[1]+=d[1],S=0,T())}function v(){var t=ui.mouse(_),r=!1;b&&(t[0]+=b[0],t[1]+=b[1]),S||(ui.event.altKey?(x||(x=[(f[0]+f[1])/2,(d[0]+d[1])/2]),O[0]=f[+(t[0]0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!a(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},r.prototype.removeListener=function(t,e){var n,r,o,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,r=-1,n===e||a(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(n)){for(l=o;l-- >0;)if(n[l]===e||n[l].listener&&n[l].listener===e){r=l;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],a(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},{}],10:[function(t,e,n){"use strict";function r(t){for(var e,n=t.length,r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0===(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}},{}],11:[function(t,e,n){function r(t,e){var n=e[0],r=e[1],a=e[2],o=e[3],i=n+n,l=r+r,s=a+a,c=n*i,u=r*i,f=r*l,d=a*i,h=a*l,p=a*s,g=o*i,v=o*l,m=o*s;return t[0]=1-f-p,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-c-p,t[6]=h+g,t[7]=0,t[8]=d+v,t[9]=h-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=r},{}],12:[function(t,e,n){(function(n){"use strict";var r,a=t("is-browser");r="function"==typeof n.matchMedia?!n.matchMedia("(hover: none)").matches:a,e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":13}],13:[function(t,e,n){e.exports=!0},{}],14:[function(t,e,n){function r(t,e,n){e=e||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var r=t.clientX||0,o=t.clientY||0,i=a(e);return n[0]=r-i.left,n[1]=o-i.top,n}function a(t){return t===window||t===document||t===document.body?o:t.getBoundingClientRect()}var o={left:0,top:0};e.exports=r},{}],15:[function(t,e,n){function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(d===clearTimeout)return clearTimeout(t);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function l(){v&&p&&(v=!1,p.length?g=p.concat(g):m=-1,g.length&&s())}function s(){if(!v){var t=o(l);v=!0;for(var e=g.length;e;){for(p=g,g=[];++m1)for(var n=1;n.5?s/(2-o-i):s/(o+i),o){case t:r=(e-n)/s+(e1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var a,o,i;if(t=L(t,360),e=L(e,100),n=L(n,100),0===e)a=o=i=n;else{var l=n<.5?n*(1+e):n+e-n*e,s=2*n-l;a=r(s,l,t+1/3),o=r(s,l,t),i=r(s,l,t-1/3)}return{r:255*a,g:255*o,b:255*i}}function s(t,e,n){t=L(t,255),e=L(e,255),n=L(n,255);var r,a,o=U(t,e,n),i=V(t,e,n),l=o,s=o-i;if(a=0===o?0:s/o,o==i)r=0;else{switch(o){case t:r=(e-n)/s+(e>1)+720)%360;--e;)a.h=(a.h+o)%360,i.push(r(a));return i}function A(t,e){e=e||6;for(var n=r(t).toHsv(),a=n.h,o=n.s,i=n.v,l=[],s=1/e;e--;)l.push(r({h:a,s:o,v:i})),i=(i+s)%1;return l}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(t,n){z(t)&&(t="100%");var r=O(t);return t=V(n,U(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),e.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function C(t){return V(1,U(0,t))}function S(t){return parseInt(t,16)}function z(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function O(t){return"string"==typeof t&&-1!=t.indexOf("%")}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function E(t){return e.round(255*parseFloat(t)).toString(16)}function N(t){return S(t)/255}function I(t){return!!Z.CSS_UNIT.exec(t)}function R(t){t=t.replace(j,"").replace(B,"").toLowerCase();var e=!1;if(X[t])t=X[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Z.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=Z.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Z.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=Z.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Z.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=Z.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Z.hex8.exec(t))?{r:S(n[1]),g:S(n[2]),b:S(n[3]),a:N(n[4]),format:e?"name":"hex8"}:(n=Z.hex6.exec(t))?{r:S(n[1]),g:S(n[2]),b:S(n[3]),format:e?"name":"hex"}:(n=Z.hex4.exec(t))?{r:S(n[1]+""+n[1]),g:S(n[2]+""+n[2]),b:S(n[3]+""+n[3]),a:N(n[4]+""+n[4]),format:e?"name":"hex8"}:!!(n=Z.hex3.exec(t))&&{r:S(n[1]+""+n[1]),g:S(n[2]+""+n[2]),b:S(n[3]+""+n[3]),format:e?"name":"hex"}}function F(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==n&&"large"!==n&&(n="small"),{level:e,size:n}}var j=/^\s+/,B=/\s+$/,H=0,q=e.round,V=e.min,U=e.max,G=e.random;r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,n,r,a,o,i,l=this.toRgb();return t=l.r/255,n=l.g/255,r=l.b/255,a=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),o=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),i=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),.2126*a+.7152*o+.0722*i},setAlpha:function(t){return this._a=T(t),this._roundA=q(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=q(360*t.h),n=q(100*t.s),r=q(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=i(this._r,this._g,this._b),e=q(360*t.h),n=q(100*t.s),r=q(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return f(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:q(this._r),g:q(this._g),b:q(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+q(this._r)+", "+q(this._g)+", "+q(this._b)+")":"rgba("+q(this._r)+", "+q(this._g)+", "+q(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:q(100*L(this._r,255))+"%",g:q(100*L(this._g,255))+"%",b:q(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+q(100*L(this._r,255))+"%, "+q(100*L(this._g,255))+"%, "+q(100*L(this._b,255))+"%)":"rgba("+q(100*L(this._r,255))+"%, "+q(100*L(this._g,255))+"%, "+q(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),n=e,a=this._gradientType?"GradientType = 1, ":"";if(t){var o=r(t);n="#"+d(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]="a"===a?t[a]:P(t[a]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:G(),g:G(),b:G()})},r.mix=function(t,e,n){n=0===n?0:n||50;var a=r(t).toRgb(),o=r(e).toRgb(),i=n/100;return r({r:(o.r-a.r)*i+a.r,g:(o.g-a.g)*i+a.g,b:(o.b-a.b)*i+a.b,a:(o.a-a.a)*i+a.a})},r.readability=function(t,n){var a=r(t),o=r(n);return(e.max(a.getLuminance(),o.getLuminance())+.05)/(e.min(a.getLuminance(),o.getLuminance())+.05)},r.isReadable=function(t,e,n){var a,o,i=r.readability(t,e);switch(o=!1,a=F(n),a.level+a.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},r.mostReadable=function(t,e,n){var a,o,i,l,s=null,c=0;n=n||{},o=n.includeFallbackColors,i=n.level,l=n.size;for(var u=0;uc&&(c=a,s=r(e[u]));return r.isReadable(t,s,{level:i,size:l})||!o?s:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var X=r.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=r.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(X),Z=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==n&&n.exports?n.exports=r:"function"==typeof t&&t.amd?t(function(){return r}):window.tinycolor=r}(Math)},{}],17:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./common_defaults"),i=t("./attributes") -;e.exports=function(t,e,n,l,s){function c(n,a){return r.coerce(t,e,i,n,a)}l=l||{},s=s||{};var u=c("visible",!s.itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;o(t,e,n,c);for(var d=e.showarrow,h=["x","y"],p=[-10,-30],g={_fullLayout:n},v=0;v<2;v++){var m=h[v],y=a.coerceRef(t,e,g,m,"","paper");if(a.coercePosition(e,g,c,y,m,.5),d){var x="a"+m,b=a.coerceRef(t,e,g,x,"pixel");"pixel"!==b&&b!==y&&(b=e[x]="pixel");var _="pixel"===b?p[v]:.4;a.coercePosition(e,g,c,b,x,_)}c(m+"anchor"),c(m+"shift")}if(r.noneOrAll(t,e,["x","y"]),d&&r.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),k=c("yclick");e._xclick=void 0===w?e.x:a.cleanPosition(w,g,e.xref),e._yclick=void 0===k?e.y:a.cleanPosition(k,g,e.yref)}return e}},{"../../lib":147,"../../plots/cartesian/axes":183,"./attributes":19,"./common_defaults":22}],18:[function(t,e,n){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],19:[function(t,e,n){"use strict";var r=t("./arrow_paths"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/constants"),i=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:i({},a,{}),width:{valType:"number",min:1,dflt:null},height:{valType:"number",min:1,dflt:null},opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},xshift:{valType:"number",dflt:0},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},yshift:{valType:"number",dflt:0},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},hovertext:{valType:"string"},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:i({},a,{})},captureevents:{valType:"boolean"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":142,"../../plots/cartesian/constants":188,"../../plots/font_attributes":207,"./arrow_paths":18}],20:[function(t,e,n){"use strict";function r(t){var e=t._fullLayout;a.filterVisible(e.annotations).forEach(function(e){var n,r,a=o.getFromId(t,e.xref),i=o.getFromId(t,e.yref),l=3*e.arrowsize*e.arrowwidth||0;a&&a.autorange&&(n=l+e.xshift,r=l-e.xshift,e.axref===e.xref?(o.expand(a,[a.r2c(e.x)],{ppadplus:n,ppadminus:r}),o.expand(a,[a.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):o.expand(a,[a.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,n),ppadminus:Math.max(e._xpadminus,r)})),i&&i.autorange&&(n=l-e.yshift,r=l+e.yshift,e.ayref===e.yref?(o.expand(i,[i.r2c(e.y)],{ppadplus:n,ppadminus:r}),o.expand(i,[i.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):o.expand(i,[i.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,n),ppadminus:Math.max(e._ypadminus,r)}))})}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,n=a.filterVisible(e.annotations);if(n.length&&t._fullData.length){var l={};n.forEach(function(t){l[t.xref]=!0,l[t.yref]=!0});if(o.list(t).filter(function(t){return t.autorange&&l[t._id]}).length)return a.syncOrAsync([i,r],t)}}},{"../../lib":147,"../../plots/cartesian/axes":183,"./draw":25}],21:[function(t,e,n){"use strict";function r(t,e){var n=o(t,e);return n.on.length>0||n.explicitOff.length>0}function a(t,e){var n,r=o(t,e),a=r.on,i=r.off.concat(r.explicitOff),s={};if(a.length||i.length){for(n=0;n2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var i=F.selectAll("a");if(1===i.size()&&i.text()===F.text()){z.insert("a",":first-child").attr({"xlink:xlink:href":i.attr("xlink:href"),"xlink:xlink:show":i.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(E.node())}var s=z.select(".annotation-text-math-group"),u=!s.empty(),h=d.bBox((u?s:F).node()),y=h.width,S=h.height,D=e.width||y,R=e.height||S,j=Math.round(D+2*P),B=Math.round(R+2*P);e._w=D,e._h=R;for(var H=!1,q=["x","y"],V=0;V1)&&(Q===$?((it=J.r2fraction(e["a"+W]))<0||it>1)&&(H=!0):H=!0,H))continue;U=J._offset+J.r2p(e[W]),Y=.5}else"x"===W?(X=e[W],U=_.l+_.w*X):(X=1-e[W],U=_.t+_.h*X),Y=e.showarrow?.5:X;if(e.showarrow){ot.head=U;var lt=e["a"+W];Z=tt*n(.5,e.xanchor)-et*n(.5,e.yanchor),Q===$?(ot.tail=J._offset+J.r2p(lt),G=Z):(ot.tail=U+lt,G=Z+lt),ot.text=ot.tail+Z;var st=b["x"===W?"width":"height"];if("paper"===$&&(ot.head=c.constrain(ot.head,1,st-1)),"pixel"===Q){var ct=-Math.max(ot.tail-3,ot.text),ut=Math.min(ot.tail+3,ot.text)-st;ct>0?(ot.tail+=ct,ot.text+=ct):ut>0&&(ot.tail-=ut,ot.text-=ut)}ot.tail+=at,ot.head+=at}else Z=nt*n(Y,rt),G=Z,ot.text=U+Z;ot.text+=at,Z+=at,G+=at,e["_"+W+"padplus"]=nt/2+G,e["_"+W+"padminus"]=nt/2-G,e["_"+W+"size"]=nt,e["_"+W+"shift"]=Z}if(H)return void z.remove();var ft=0,dt=0;if("left"!==e.align&&(ft=(D-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(dt=(R-S)*("middle"===e.valign?.5:1)),u)s.select("svg").attr({x:P+ft-1,y:P+dt}).call(d.setClipUrl,N?k:null);else{var ht=P+dt-h.top,pt=P+ft-h.left;F.call(p.positionText,pt,ht).call(d.setClipUrl,N?k:null)}I.select("rect").call(d.setRect,P,P,D,R),E.call(d.setRect,O/2,O/2,j-O,B-O),z.call(d.setTranslate,Math.round(M.x.text-j/2),Math.round(M.y.text-B/2)),L.attr({transform:"rotate("+A+","+M.x.text+","+M.y.text+")"});var gt=function(n,i){T.selectAll(".annotation-arrow-g").remove();var s=M.x.head,u=M.y.head,h=M.x.tail+n,p=M.y.tail+i,g=M.x.text+n,y=M.y.text+i,b=c.rotationXYMatrix(A,g,y),k=c.apply2DTransform(b),C=c.apply2DTransform2(b),S=+E.attr("width"),O=+E.attr("height"),D=g-.5*S,P=D+S,N=y-.5*O,I=N+O,R=[[D,N,D,I],[D,I,P,I],[P,I,P,N],[P,N,D,N]].map(C);if(!R.reduce(function(t,e){return t^!!c.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=c.segmentsIntersect(h,p,s,u,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)});var F=e.arrowwidth,j=e.arrowcolor,B=T.append("g").style({opacity:f.opacity(j)}).classed("annotation-arrow-g",!0),H=B.append("path").attr("d","M"+h+","+p+"L"+s+","+u).style("stroke-width",F+"px").call(f.stroke,f.rgb(j));if(m(H,e.arrowhead,"end",e.arrowsize,e.standoff),w.annotationPosition&&H.node().parentNode&&!r){var q=s,V=u;if(e.standoff){var U=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-p,2));q+=e.standoff*(h-s)/U,V+=e.standoff*(p-u)/U}var G,X,Y,Z=B.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-q)+","+(p-V),transform:"translate("+q+","+V+")"}).style("stroke-width",F+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");v.init({element:Z.node(),gd:t,prepFn:function(){var t=d.getTranslate(z);X=t.x,Y=t.y,G={},a&&a.autorange&&(G[a._name+".autorange"]=!0),o&&o.autorange&&(G[o._name+".autorange"]=!0)},moveFn:function(t,n){var r=k(X,Y),i=r[0]+t,l=r[1]+n;z.call(d.setTranslate,i,l),G[x+".x"]=a?a.p2r(a.r2p(e.x)+t):e.x+t/_.w,G[x+".y"]=o?o.p2r(o.r2p(e.y)+n):e.y-n/_.h,e.axref===e.xref&&(G[x+".ax"]=a.p2r(a.r2p(e.ax)+t)),e.ayref===e.yref&&(G[x+".ay"]=o.p2r(o.r2p(e.ay)+n)),B.attr("transform","translate("+t+","+n+")"),L.attr({transform:"rotate("+A+","+i+","+l+")"})},doneFn:function(e){if(e){l.relayout(t,G);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}};if(e.showarrow&>(0,0),C){var vt,mt;v.init({element:z.node(),gd:t,prepFn:function(){mt=L.attr("transform"),vt={}},moveFn:function(t,n){var i="pointer";if(e.showarrow)e.axref===e.xref?vt[x+".ax"]=a.p2r(a.r2p(e.ax)+t):vt[x+".ax"]=e.ax+t,e.ayref===e.yref?vt[x+".ay"]=o.p2r(o.r2p(e.ay)+n):vt[x+".ay"]=e.ay+n,gt(t,n);else{if(r)return;if(a)vt[x+".x"]=e.x+t/a._m;else{var l=e._xsize/_.w,s=e.x+(e._xshift-e.xshift)/_.w-l/2;vt[x+".x"]=v.align(s+t/_.w,l,0,1,e.xanchor)}if(o)vt[x+".y"]=e.y+n/o._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;vt[x+".y"]=v.align(u-n/_.h,c,0,1,e.yanchor)}a&&o||(i=v.getCursor(a?.5:vt[x+".x"],o?.5:vt[x+".y"],e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+n+")"+mt}),g(z,i)},doneFn:function(e){if(g(z),e){l.relayout(t,vt);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}var y,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;r?(y="annotation-"+r,x=r+".annotations["+n+"]"):(y="annotation",x="annotations["+n+"]"),b._infolayer.selectAll("."+y+'[data-index="'+n+'"]').remove();var k="clip"+b._uid+"_ann"+n;if(!e._input||!1===e.visible)return void i.selectAll("#"+k).remove();var M={x:{},y:{}},A=+e.textangle||0,T=b._infolayer.append("g").classed(y,!0).attr("data-index",String(n)).style("opacity",e.opacity),L=T.append("g").classed("annotation-text-g",!0),C=w[e.showarrow?"annotationTail":"annotationPosition"],S=e.captureevents||w.annotationText||C,z=L.append("g").style("pointer-events",S?"all":null).call(g,"default").on("click",function(){t._dragging=!1;var a={index:n,annotation:e._input,fullAnnotation:e,event:i.event};r&&(a.subplotId=r),t.emit("plotly_clickannotation",a)});e.hovertext&&z.on("mouseover",function(){var n=e.hoverlabel,r=n.font,a=this.getBoundingClientRect(),o=t.getBoundingClientRect();h.loneHover({x0:a.left-o.left,x1:a.right-o.left,y:(a.top+a.bottom)/2-o.top,text:e.hovertext,color:n.bgcolor,borderColor:n.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){h.loneUnhover(b._hoverlayer.node())});var O=e.borderwidth,D=e.borderpad,P=O+D,E=z.append("rect").attr("class","bg").style("stroke-width",O+"px").call(f.stroke,e.bordercolor).call(f.fill,e.bgcolor),N=e.width||e.height,I=b._defs.select(".clips").selectAll("#"+k).data(N?[0]:[]);I.enter().append("clipPath").classed("annclip",!0).attr("id",k).append("rect"),I.exit().remove();var R=e.font,F=z.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?F.call(p.makeEditable,{delegate:z,gd:t}).call(s).on("edit",function(n){e.text=n,this.call(s);var r={};r[x+".text"]=e.text,a&&a.autorange&&(r[a._name+".autorange"]=!0),o&&o.autorange&&(r[o._name+".autorange"]=!0),l.relayout(t,r)}):F.call(s)}var i=t("d3"),l=t("../../plotly"),s=t("../../plots/plots"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),h=t("../fx"),p=t("../../lib/svg_text_utils"),g=t("../../lib/setcursor"),v=t("../dragelement"),m=t("./draw_arrow_head");e.exports={draw:r,drawOne:a,drawRaw:o}},{"../../lib":147,"../../lib/setcursor":162,"../../lib/svg_text_utils":164,"../../plotly":178,"../../plots/cartesian/axes":183,"../../plots/plots":212,"../color":34,"../dragelement":55,"../drawing":58,"../fx":75,"./draw_arrow_head":26,d3:7}],26:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../color"),i=t("../drawing"),l=t("./arrow_paths");e.exports=function(t,e,n,s,c){function u(){t.style("stroke-dasharray","0px,100px")}function f(n,a){h.path&&(e>5&&(a=0),r.select(d.parentNode).append("path").attr({class:t.attr("class"),d:h.path,transform:"translate("+n.x+","+n.y+")rotate("+180*a/Math.PI+")scale("+y+")"}).style({fill:x,opacity:b,"stroke-width":0}))}a(s)||(s=1);var d=t.node(),h=l[e||0];"string"==typeof n&&n||(n="end");var p,g,v,m,y=(i.getPx(t,"stroke-width")||1)*s,x=t.style("stroke")||o.defaultLine,b=t.style("stroke-opacity")||1,_=n.indexOf("start")>=0,w=n.indexOf("end")>=0,k=h.backoff*y+c;if("line"===d.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},g={x:+t.attr("x2"),y:+t.attr("y2")};var M=p.x-g.x,A=p.y-g.y;if(v=Math.atan2(A,M),m=v+Math.PI,k){if(k*k>M*M+A*A)return void u();var T=k*Math.cos(v),L=k*Math.sin(v);_&&(p.x-=T,p.y-=L,t.attr({x1:p.x,y1:p.y})),w&&(g.x+=T,g.y+=L,t.attr({x2:g.x,y2:g.y}))}}else if("path"===d.nodeName){var C=d.getTotalLength(),S="";if(C1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s.pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*n[0],e.yaxis.r2l(s.y)*n[1],e.zaxis.r2l(s.z)*n[2]]),r(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":209,"../annotations/draw":25}],32:[function(t,e,n){"use strict";e.exports={moduleType:"component",name:"annotations3d",schema:{layout:{"scene.annotations":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),convert:t("./convert"),draw:t("./draw")}},{"./attributes":28,"./convert":29,"./defaults":30,"./draw":31}],33:[function(t,e,n){"use strict";n.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],n.defaultLine="#444",n.lightLine="#eee",n.background="#fff",n.borderLine="#BEC8D9",n.lightFraction=1e3/11},{}],34:[function(t,e,n){"use strict";function r(t){if(o(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var n=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!n)return t;var r=n[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===r.length;if(!a&&3!==r.length)return t;for(var i=0;i=0))return t;if(3===i)r[i]>1&&(r[i]=1);else if(r[i]>=1)return t}var l=Math.round(255*r[0])+", "+Math.round(255*r[1])+", "+Math.round(255*r[2]);return a?"rgba("+l+", "+r[3]+")":"rgb("+l+")"}var a=t("tinycolor2"),o=t("fast-isnumeric"),i=e.exports={},l=t("./attributes");i.defaults=l.defaults;var s=i.defaultLine=l.defaultLine;i.lightLine=l.lightLine;var c=i.background=l.background;i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(a(t))},i.opacity=function(t){return t?a(t).getAlpha():0},i.addOpacity=function(t,e){var n=a(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},i.combine=function(t,e){var n=a(t).toRgb();if(1===n.a)return a(t).toRgbString();var r=a(e||c).toRgb(),o=1===r.a?r:{r:255*(1-r.a)+r.r*r.a,g:255*(1-r.a)+r.g*r.a,b:255*(1-r.a)+r.b*r.a},i={r:o.r*(1-n.a)+n.r*n.a,g:o.g*(1-n.a)+n.g*n.a,b:o.b*(1-n.a)+n.b*n.a};return a(i).toRgbString()},i.contrast=function(t,e,n){var r=a(t);return 1!==r.getAlpha()&&(r=a(i.combine(t,c))),(r.isDark()?e?r.lighten(e):c:n?r.darken(n):s).toString()},i.stroke=function(t,e){var n=a(e);t.style({stroke:i.tinyRGB(n),"stroke-opacity":n.getAlpha()})},i.fill=function(t,e){var n=a(e);t.style({fill:i.tinyRGB(n),"fill-opacity":n.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,n,a,o,l=Object.keys(t);for(e=0;el&&(o[1]-=(ut-l)/2):n.node()&&!n.classed("js-placeholder")&&(ut=h.bBox(n.node()).height),ut){if(ut+=5,"top"===k.titleside)nt.domain[1]-=ut/C.h,o[1]*=-1;else{nt.domain[0]+=ut/C.h;var c=v.lineCount(n);o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),nt.setScale()}}st.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(C.h*(1-nt.domain[1]))+")");var f=st.select(".cbfills").selectAll("rect.cbfill").data(P);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var n=[0===e?O[0]:(P[e]+P[e-1])/2,e===P.length-1?O[1]:(P[e]+P[e+1])/2].map(nt.c2p).map(Math.round);e!==P.length-1&&(n[1]+=n[1]>n[0]?1:-1);var o=N(t).replace("e-",""),i=a(o).toHexString();r.select(this).attr({x:$,width:Math.max(V,2),y:r.min(n),height:Math.max(r.max(n)-r.min(n),2),fill:i})});var d=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?D:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){r.select(this).attr("d","M"+$+","+(Math.round(nt.c2p(t))+k.line.width/2%1)+"h"+V).call(h.lineGroupStyle,k.line.width,E(t),k.line.dash)}),nt._axislayer.selectAll("g."+nt._id+"tick,path").remove(),nt._pos=$+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),nt.side="right",u.syncOrAsync([function(){return s.doTicks(t,nt,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=nt.titlefont.size,n=nt._offset+nt._length/2,a=C.l+(nt.position||0)*C.w+("right"===nt.side?10+e*(nt.showticklabels?1:.5):-10-e*(nt.showticklabels?.5:0));A("h"+nt._id+"title",{avoid:{selection:r.select(t).selectAll("g."+nt._id+"tick"),side:k.titleside,offsetLeft:C.l,offsetTop:C.t,maxShift:L.width},attributes:{x:a,y:n,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function A(e,n){var r,a=w();r=l.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:nt,propName:r,traceIndex:a.index,dfltName:"colorscale",containerGroup:st.select(".cbtitle")},i="h"===e.charAt(0)?e.substr(1):"h"+e;st.selectAll("."+i+",."+i+"-math-group").remove(),g.draw(t,e,f(o,n||{}))}function T(){var n=V+k.outlinewidth/2+h.bBox(nt._axislayer.node()).width;if(B=ct.select("text"),B.node()&&!B.classed("js-placeholder")){var r,a=ct.select(".h"+nt._id+"title-math-group").node();r=a&&-1!==["top","bottom"].indexOf(k.titleside)?h.bBox(a).width:h.bBox(ct.node()).right-$-C.l,n=Math.max(n,r)}var o=2*k.xpad+n+k.borderwidth+k.outlinewidth/2,l=K-tt;st.select(".cbbg").attr({x:$-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:tt-Z,width:Math.max(o,2),height:Math.max(l+2*Z,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:$,y:tt+k.ypad+("top"===k.titleside?ut:0),width:Math.max(V,2),height:Math.max(l-2*k.ypad-ut,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var s=({center:.5,right:1}[k.xanchor]||0)*o;st.attr("transform","translate("+(C.l-s)+","+C.t+")"),i.autoMargin(t,e,{x:k.x,y:k.y,l:o*({right:1,center:.5}[k.xanchor]||0),r:o*({left:1,center:.5}[k.xanchor]||0),t:l*({bottom:1,middle:.5}[k.yanchor]||0),b:l*({top:1,middle:.5}[k.yanchor]||0)})}var L=t._fullLayout,C=L._size;if("function"!=typeof k.fillcolor&&"function"!=typeof k.line.color)return void L._infolayer.selectAll("g."+e).remove();var S,z,O=r.extent(("function"==typeof k.fillcolor?k.fillcolor:k.line.color).domain()),D=[],P=[],E="function"==typeof k.line.color?k.line.color:function(){return k.line.color},N="function"==typeof k.fillcolor?k.fillcolor:function(){return k.fillcolor},I=k.levels.end+k.levels.size/100,R=k.levels.size,F=1.001*O[0]-.001*O[1],j=1.001*O[1]-.001*O[0];for(z=0;z<1e5&&(S=k.levels.start+z*R,!(R>0?S>=I:S<=I));z++)S>F&&S0?S>=I:S<=I));z++)S>O[0]&&S1){var lt=Math.pow(10,Math.floor(Math.log(it)/Math.LN10)) -;at*=lt*u.roundUp(it/lt,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(nt.tick0=0)}nt.dtick=at}nt.domain=[J+W,J+X-W],nt.setScale();var st=L._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).each(function(){var t=r.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(C.l)+","+Math.round(C.t)+")");var ct=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(C.l)+",-"+Math.round(C.t)+")");nt._axislayer=st.select(".cbaxis");var ut=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ft,dt=C.l+(k.x+Y)*C.w,ht=nt.titlefont.size;ft="top"===k.titleside?(1-(J+X-W))*C.h+C.t+3+.75*ht:(1-(J+W))*C.h+C.t-3-.25*ht,A(nt._id+"title",{attributes:{x:dt,y:ft,"text-anchor":"start"}})}var pt=u.syncOrAsync([i.previousPromises,M,i.previousPromises,T],t);if(pt&&pt.then&&(t._promises||[]).push(pt),t._context.edits.colorbarPosition){var gt,vt,mt;c.init({element:st.node(),gd:t,prepFn:function(){gt=st.attr("transform"),d(st)},moveFn:function(t,e){st.attr("transform",gt+" translate("+t+","+e+")"),vt=c.align(Q+t/C.w,U,0,1,k.xanchor),mt=c.align(J-e/C.h,X,0,1,k.yanchor);var n=c.getCursor(vt,mt,k.xanchor,k.yanchor);d(st,n)},doneFn:function(e){d(st),e&&void 0!==vt&&void 0!==mt&&o.restyle(t,{"colorbar.x":vt,"colorbar.y":mt},w().index)}})}return pt}function w(){var n,r,a=e.substr(2);for(n=0;n=0?a.Reds:a.Blues,s.colorscale=g,l.reversescale&&(g=o(g)),l.colorscale=g)}},{"../../lib":147,"./flip_scale":45,"./scales":52}],41:[function(t,e,n){"use strict";var r=t("./attributes"),a=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:a({},r.colorscale,{}),cauto:a({},r.zauto,{}),cmax:a({},r.zmax,{}),cmin:a({},r.zmin,{}),autocolorscale:a({},r.autocolorscale,{}),reversescale:a({},r.reversescale,{})}}},{"../../lib/extend":142,"./attributes":39,"./scales.js":52}],42:[function(t,e,n){"use strict";var r=t("./scales");e.exports=r.RdBu},{"./scales":52}],43:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../colorbar/has_colorbar"),i=t("../colorbar/defaults"),l=t("./is_valid_scale"),s=t("./flip_scale");e.exports=function(t,e,n,c,u){var f=u.prefix,d=u.cLetter,h=f.slice(0,f.length-1),p=f?a.nestedProperty(t,h).get()||{}:t,g=f?a.nestedProperty(e,h).get()||{}:e,v=p[d+"min"],m=p[d+"max"],y=p.colorscale;c(f+d+"auto",!(r(v)&&r(m)&&v=0;a--,o++)e=t[a],r[o]=[1-e[0],e[1]];return r}},{}],46:[function(t,e,n){"use strict";var r=t("./scales"),a=t("./default_scale"),o=t("./is_valid_scale_array");e.exports=function(t,e){function n(){try{t=r[t]||JSON.parse(t)}catch(n){t=e}}return e||(e=a),t?("string"==typeof t&&(n(),"string"==typeof t&&n()),o(t)?t:e):e}},{"./default_scale":42,"./is_valid_scale_array":50,"./scales":52}],47:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("./is_valid_scale");e.exports=function(t,e){var n=e?a.nestedProperty(t,e).get()||{}:t,i=n.color,l=!1;if(Array.isArray(i))for(var s=0;s4/3-l?i:l}},{}],54:[function(t,e,n){"use strict";var r=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,n,o){return t="left"===n?0:"center"===n?1:"right"===n?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:r.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":147}],55:[function(t,e,n){"use strict";function r(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function a(t){t._dragging=!1,t._replotPending&&s.plot(t)}function o(t){return i(t.changedTouches?t.changedTouches[0]:t,document.body)}var i=t("mouse-event-offset"),l=t("has-hover"),s=t("../../plotly"),c=t("../../lib"),u=t("../../plots/cartesian/constants"),f=t("../../constants/interactions"),d=e.exports={};d.align=t("./align"),d.getCursor=t("./cursor");var h=t("./unhover");d.unhover=h.wrapped,d.unhoverRaw=h.raw,d.init=function(t){function e(e){y._dragged=!1,y._dragging=!0;var a=o(e);return s=a[0],h=a[1],m=e.target,p=(new Date).getTime(),p-y._mouseDownTimeb&&(x=Math.max(x-1,1)),t.doneFn&&t.doneFn(y._dragged,x,e),!y._dragged){var r;try{r=new MouseEvent("click",e)}catch(t){var s=o(e);r=document.createEvent("MouseEvents"),r.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,s[0],s[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}m.dispatchEvent(r)}return a(y),y._dragged=!1,c.pauseEvent(e)}var s,h,p,g,v,m,y=t.gd,x=1,b=f.DBLCLICKDELAY;y._mouseDownTime||(y._mouseDownTime=0),t.element.style.pointerEvents="all",t.element.onmousedown=e,t.element.ontouchstart=e},d.coverSlip=r},{"../../constants/interactions":131,"../../lib":147,"../../plotly":178,"../../plots/cartesian/constants":188,"./align":53,"./cursor":54,"./unhover":56,"has-hover":12,"mouse-event-offset":14}],56:[function(t,e,n){"use strict";var r=t("../../lib/events"),a=e.exports={};a.wrapped=function(t,e,n){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),a.raw(t,e,n)},a.raw=function(t,e){var n=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===r.triggerHandler(t,"plotly_beforehover",e)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":141}],57:[function(t,e,n){"use strict";n.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},{}],58:[function(t,e,n){"use strict";function r(t,e,n,r,a,o,i,l){if(c.traceIs(n,"symbols")){var s=y(n);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:m.isBubble(n)?s(t.ms):(o.size||6)/2,t.mrc=e;var r=x.symbolNumber(t.mx||o.symbol)||0,a=r%100;return t.om=r%200>=100,x.symbolFuncs[a](e)+(r>=200?w:"")}).style("opacity",function(t){return(t.mo+1||o.opacity+1)-1})}var f,d,h,p=!1;if(t.so?(h=i.outlierwidth,d=i.outliercolor,f=o.outliercolor):(h=(t.mlw+1||i.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(i.color)?u.defaultLine:i.color,Array.isArray(o.color)&&(f=u.defaultLine,p=!0),f="mc"in t?t.mcc=r(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(u.stroke,f).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",h+"px");var g=o.gradient,v=t.mgt;if(v?p=!0:v=g&&g.type,v&&"none"!==v){var b=t.mgc;b?p=!0:b=g.color;var _="g"+l._fullLayout._uid+"-"+n.uid;p&&(_+="-"+t.i),e.call(x.gradient,l,_,v,f,b)}else e.call(u.fill,f);h&&e.call(u.stroke,d)}}function a(t,e,n,r){var a=t[0]-e[0],o=t[1]-e[1],l=n[0]-e[0],s=n[1]-e[1],c=Math.pow(a*a+o*o,T/2),u=Math.pow(l*l+s*s,T/2),f=(u*u*a-c*c*l)*r,d=(u*u*o-c*c*s)*r,h=3*u*(c+u),p=3*c*(c+u);return[[i.round(e[0]+(h&&f/h),2),i.round(e[1]+(h&&d/h),2)],[i.round(e[0]-(p&&f/p),2),i.round(e[1]-(p&&d/p),2)]]}function o(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var i=t("d3"),l=t("fast-isnumeric"),s=t("tinycolor2"),c=t("../../registry"),u=t("../color"),f=t("../colorscale"),d=t("../../lib"),h=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),g=t("../../constants/alignment"),v=g.LINE_SPACING,m=t("../../traces/scatter/subtypes"),y=t("../../traces/scatter/make_bubble_size_func"),x=e.exports={};x.font=function(t,e,n,r){d.isPlainObject(e)&&(r=e.color,n=e.size,e=e.family),e&&t.style("font-family",e),n+1&&t.style("font-size",n+"px"),r&&t.call(u.fill,r)},x.setPosition=function(t,e,n){t.attr("x",e).attr("y",n)},x.setSize=function(t,e,n){t.attr("width",e).attr("height",n)},x.setRect=function(t,e,n,r,a){t.call(x.setPosition,e,n).call(x.setSize,r,a)},x.translatePoint=function(t,e,n,r){var a=n.c2p(t.x),o=r.c2p(t.y);return!!(l(a)&&l(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},x.translatePoints=function(t,e,n){t.each(function(t){var r=i.select(this);x.translatePoint(t,r,e,n)})},x.hideOutsideRangePoint=function(t,e,n,r){e.attr("display",n.isPtWithinRange(t)&&r.isPtWithinRange(t)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var n=e.xaxis,r=e.yaxis;t.each(function(t){x.hideOutsideRangePoint(t,i.select(this),n,r)})}},x.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},x.crispRound=function(t,e,n){return e&&l(e)?t._context.staticPlot?e:e<1?1:Math.round(e):n||0},x.singleLineStyle=function(t,e,n,r,a){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},i=n||o.width||0,l=a||o.dash||"";u.stroke(e,r||o.color),x.dashLine(e,l,i)},x.lineGroupStyle=function(t,e,n,r){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=r||a.dash||"";i.select(this).call(u.stroke,n||a.color).call(x.dashLine,l,o)})},x.dashLine=function(t,e,n){n=+n||0,e=x.dashStyle(e,n),t.style({"stroke-dasharray":e,"stroke-width":n+"px"})},x.dashStyle=function(t,e){e=+e||1;var n=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=n+"px,"+n+"px":"dash"===t?t=3*n+"px,"+3*n+"px":"longdash"===t?t=5*n+"px,"+5*n+"px":"dashdot"===t?t=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===t&&(t=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t},x.singleFillStyle=function(t){var e=i.select(t.node()),n=e.data(),r=(((n[0]||[])[0]||{}).trace||{}).fillcolor;r&&t.call(u.fill,r)},x.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var n=i.select(this);try{n.call(u.fill,e[0].trace.fillcolor)}catch(e){d.error(e,t),n.remove()}})};var b=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolList=[],Object.keys(b).forEach(function(t){var e=b[t];x.symbolList=x.symbolList.concat([e.n,t,e.n+100,t+"-open"]),x.symbolNames[e.n]=t,x.symbolFuncs[e.n]=e.f,e.needLine&&(x.symbolNeedLines[e.n]=!0),e.noDot?x.symbolNoDot[e.n]=!0:x.symbolList=x.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var _=x.symbolNames.length,w="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";x.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=x.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0};x.gradient=function(t,e,n,r,a,o){var l=e._fullLayout._defs.select(".gradients").selectAll("#"+n).data([r+a+o],d.identity);l.exit().remove(),l.enter().append("radial"===r?"radialGradient":"linearGradient").each(function(){var t=i.select(this);"horizontal"===r?t.attr(k):"vertical"===r&&t.attr(M),t.attr("id",n);var e=s(a),l=s(o);t.append("stop").attr({offset:"0%","stop-color":u.tinyRGB(l),"stop-opacity":l.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":u.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+n+")","fill-opacity":null})},x.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},x.singlePointStyle=function(t,e,n,a,o,i){var l=n.marker;r(t,e,n,a,o,l,l.line,i)},x.pointStyle=function(t,e,n){if(t.size()){var r=e.marker,a=x.tryColorscale(r,""),o=x.tryColorscale(r,"line");t.each(function(t){x.singlePointStyle(t,i.select(this),e,a,o,n)})}},x.tryColorscale=function(t,e){var n=e?d.nestedProperty(t,e).get():t,r=n.colorscale,a=n.color;return r&&Array.isArray(a)?f.makeColorScaleFunc(f.extractScale(r,n.cmin,n.cmax)):d.identity};var A={start:1,end:-1,middle:0,bottom:1,top:-1};x.textPointStyle=function(t,e,n){t.each(function(t){var r=i.select(this),a=t.tx||e.text;if(!a||Array.isArray(a))return void r.remove();var o=t.tp||e.textposition,s=-1!==o.indexOf("top")?"top":-1!==o.indexOf("bottom")?"bottom":"middle",c=-1!==o.indexOf("left")?"end":-1!==o.indexOf("right")?"start":"middle",u=t.ts||e.textfont.size,f=t.mrc?t.mrc/.8+1:0;u=l(u)&&u>0?u:0,r.call(x.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",c).text(a).call(h.convertToTspans,n);var d=i.select(this.parentNode),p=(h.lineCount(r)-1)*v+1,g=A[c]*f,m=.75*u+A[s]*f+(A[s]-1)*p*u/2;d.attr("transform","translate("+g+","+m+")")})};var T=.5;x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var n,r="M"+t[0],o=[];for(n=1;n=1e4&&(x.savedBBoxes={},S=0),n&&(x.savedBBoxes[n]=m),S++,d.extendFlat({},m)},x.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var n="#"+e,r=i.select("base");r.size()&&r.attr("href")&&(n=window.location.href.split("#")[0]+n),t.attr("clip-path","url("+n+")")},x.getTranslate=function(t){var e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,n=t.attr?"attr":"getAttribute",r=t[n]("transform")||"",a=r.replace(e,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+a[0]||0,y:+a[1]||0}},x.setTranslate=function(t,e,n){var r=/(\btranslate\(.*?\);?)/,a=t.attr?"attr":"getAttribute",o=t.attr?"attr":"setAttribute",i=t[a]("transform")||"";return e=e||0,n=n||0,i=i.replace(r,"").trim(),i+=" translate("+e+", "+n+")",i=i.trim(),t[o]("transform",i),i},x.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,n=t.attr?"attr":"getAttribute",r=t[n]("transform")||"",a=r.replace(e,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+a[0]||1,y:+a[1]||1}},x.setScale=function(t,e,n){var r=/(\bscale\(.*?\);?)/,a=t.attr?"attr":"getAttribute",o=t.attr?"attr":"setAttribute",i=t[a]("transform")||"";return e=e||1,n=n||1,i=i.replace(r,"").trim(),i+=" scale("+e+", "+n+")",i=i.trim(),t[o]("transform",i),i},x.setPointGroupScale=function(t,e,n){var r,a,o;return e=e||1,n=n||1,a=1===e&&1===n?"":" scale("+e+","+n+")",o=/\s*sc.*/,t.each(function(){r=(this.getAttribute("transform")||"").replace(o,""),r+=a,r=r.trim(),this.setAttribute("transform",r)}),a};var z=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(t,e,n){t.each(function(){var t,r=i.select(this),a=r.select("text"),o=parseFloat(a.attr("x")||0),l=parseFloat(a.attr("y")||0),s=(r.attr("transform")||"").match(z);t=1===e&&1===n?[]:["translate("+o+","+l+")","scale("+e+","+n+")","translate("+-o+","+-l+")"],s&&t.push(s),r.attr("transform",t.join(" "))})}},{"../../constants/alignment":130,"../../constants/xmlns_namespaces":134,"../../lib":147,"../../lib/svg_text_utils":164,"../../registry":219,"../../traces/scatter/make_bubble_size_func":268,"../../traces/scatter/subtypes":273,"../color":34,"../colorscale":48,"./symbol_defs":59,d3:7,"fast-isnumeric":10,tinycolor2:16}],59:[function(t,e,n){"use strict";var r=t("d3");e.exports={circle:{n:0,f:function(t){var e=r.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=r.round(.4*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H"+e+"V"+n+"H-"+e+"V"+e+"H-"+n+"V-"+e+"H-"+e+"V-"+n+"H"+e+"V-"+e+"H"+n+"Z"}},x:{n:4,f:function(t){var e=r.round(.8*t/Math.sqrt(2),2),n="l"+e+","+e,a="l"+e+",-"+e,o="l-"+e+",-"+e,i="l-"+e+","+e;return"M0,"+e+n+a+o+a+o+i+o+i+n+i+n+"Z"}},"triangle-up":{n:5,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+e+","+r.round(t/2,2)+"H"+e+"L0,-"+r.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+r.round(t/2,2)+"H"+e+"L0,"+r.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M"+r.round(t/2,2)+",-"+e+"V"+e+"L-"+r.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+r.round(t/2,2)+",-"+e+"V"+e+"L"+r.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+n+",-"+e+"H"+e+"V"+n+"Z"}},"triangle-se":{n:10,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+e+",-"+n+"V"+e+"H-"+n+"Z"}},"triangle-sw":{n:11,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H-"+e+"V-"+n+"Z"}},"triangle-nw":{n:12,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+e+","+n+"V-"+e+"H"+n+"Z"}},pentagon:{n:13,f:function(t){var e=r.round(.951*t,2),n=r.round(.588*t,2),a=r.round(-t,2),o=r.round(-.309*t,2);return"M"+e+","+o+"L"+n+","+r.round(.809*t,2)+"H-"+n+"L-"+e+","+o+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),a=r.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+n+"V"+n+"L0,"+e+"L-"+a+","+n+"V-"+n+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),a=r.round(t*Math.sqrt(3)/2,2);return"M-"+n+","+a+"H"+n+"L"+e+",0L"+n+",-"+a+"H-"+n+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=r.round(.924*t,2),n=r.round(.383*t,2);return"M-"+n+",-"+e+"H"+n+"L"+e+",-"+n+"V"+n+"L"+n+","+e+"H-"+n+"L-"+e+","+n+"V-"+n+"Z"}},star:{n:17,f:function(t){var e=1.4*t,n=r.round(.225*e,2),a=r.round(.951*e,2),o=r.round(.363*e,2),i=r.round(.588*e,2),l=r.round(-e,2),s=r.round(-.309*e,2),c=r.round(.118*e,2),u=r.round(.809*e,2);return"M"+n+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+r.round(.382*e,2)+"L-"+i+","+u+"L-"+o+","+c+"L-"+a+","+s+"H-"+n+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=r.round(.66*t,2),n=r.round(.38*t,2),a=r.round(.76*t,2);return"M-"+a+",0l-"+n+",-"+e+"h"+a+"l"+n+",-"+e+"l"+n+","+e+"h"+a+"l-"+n+","+e+"l"+n+","+e+"h-"+a+"l-"+n+","+e+"l-"+n+",-"+e+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),a=r.round(1.6*t,2),o=r.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+n+i+e+","+n+i+"0,-"+a+i+"-"+e+","+n+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),a=r.round(1.6*t,2),o=r.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+n+i+"-"+e+",-"+n+i+"0,"+a+i+e+",-"+n+"Z"}},"star-square":{n:21,f:function(t){var e=r.round(1.1*t,2),n=r.round(2*t,2),a="A "+n+","+n+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=r.round(1.4*t,2),n=r.round(1.9*t,2),a="A "+n+","+n+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=r.round(.7*t,2),n=r.round(1.4*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=r.round(1.4*t,2),n=r.round(.7*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=r.round(t,2),n=r.round(t/Math.sqrt(2),2);return"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=r.round(1.3*t,2),n=r.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+n+",-"+n+"L"+n+","+n+"M-"+n+","+n+"L"+n+",-"+n},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=r.round(1.2*t,2),n=r.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=r.round(t/2,2),n=r.round(t,2);return"M"+e+","+n+"V-"+n+"m-"+n+",0V"+n+"M"+n+","+e+"H-"+n+"m0,-"+n+"H"+n},needLine:!0},"y-up":{n:37,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+n+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2) -;return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+n+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+n+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+n+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=r.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=r.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:7}],60:[function(t,e,n){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],61:[function(t,e,n){"use strict";function r(t,e,n,r){var o=e["error_"+r]||{},s=o.visible&&-1!==["linear","log"].indexOf(n.type),c=[];if(s){for(var u=l(o),f=0;f0;t.each(function(t){var d,h=t[0].trace,p=h.error_x||{},g=h.error_y||{};h.ids&&(d=function(t){return t.id});var v=l.hasMarkers(h)&&h.marker.maxdisplayed>0;if(g.visible||p.visible){var m=a.select(this).selectAll("g.errorbar").data(t,d);m.exit().remove(),m.style("opacity",1);var y=m.enter().append("g").classed("errorbar",!0);f&&y.style("opacity",0).transition().duration(n.duration).style("opacity",1),i.setClipUrl(m,e.layerClipId),m.each(function(t){var e=a.select(this),i=r(t,c,u);if(!v||t.vis){var l;if(g.visible&&o(i.x)&&o(i.yh)&&o(i.ys)){var d=g.width;l="M"+(i.x-d)+","+i.yh+"h"+2*d+"m-"+d+",0V"+i.ys,i.noYS||(l+="m-"+d+",0h"+2*d);var h=e.select("path.yerror");s=!h.size(),s?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):f&&(h=h.transition().duration(n.duration).ease(n.easing)),h.attr("d",l)}if(p.visible&&o(i.y)&&o(i.xh)&&o(i.xs)){var m=(p.copy_ystyle?g:p).width;l="M"+i.xh+","+(i.y-m)+"v"+2*m+"m0,-"+m+"H"+i.xs,i.noXS||(l+="m0,-"+m+"v"+2*m);var y=e.select("path.xerror");s=!y.size(),s?y=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):f&&(y=y.transition().duration(n.duration).ease(n.easing)),y.attr("d",l)}}})}})}},{"../../traces/scatter/subtypes":273,"../drawing":58,d3:7,"fast-isnumeric":10}],66:[function(t,e,n){"use strict";var r=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,n=e.error_y||{},o=e.error_x||{},i=r.select(this);i.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(a.stroke,n.color),o.copy_ystyle&&(o=n),i.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(a.stroke,o.color)})}},{"../color":34,d3:7}],67:[function(t,e,n){"use strict";var r=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0},bordercolor:{valType:"color",arrayOk:!0},font:{family:r({},a.family,{arrayOk:!0}),size:r({},a.size,{arrayOk:!0}),color:r({},a.color,{arrayOk:!0})},namelength:{valType:"integer",min:-1,arrayOk:!0}}}},{"../../lib/extend":142,"../../plots/font_attributes":207}],68:[function(t,e,n){"use strict";function r(t,e,n,r){r=r||a.identity,Array.isArray(t)&&(e[0][n]=r(t))}var a=t("../../lib"),o=t("../../registry");e.exports=function(t){for(var e=t.calcdata,n=t._fullLayout,i=0;i=0&&n.indexJ.width||$<0||$>J.height)return x.unhoverRaw(t,e)}if(E="xval"in e?w.flat(d,e.xval):w.p2c(L,W),N="yval"in e?w.flat(d,e.yval):w.p2c(C,$),!f(E[0])||!f(N[0]))return h.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var K=1/0;for(R=0;RX&&(Y.splice(0,X),K=Y[0].distance)}if(0===Y.length)return x.unhoverRaw(t,e);Y.sort(function(t,e){return t.distance-e.distance});var at=t._hoverdata,ot=[];for(I=0;I1,ct=y.combine(g.plot_bgcolor||y.background,g.paper_bgcolor),ut={hovermode:P,rotateLabels:st,bgColor:ct,container:g._hoverlayer,outerContainer:g._paperdiv,commonLabelOpts:g.hoverlabel},ft=a(Y,ut,t);if(o(Y,st?"xa":"ya"),i(ft,st),e.target&&e.target.tagName){var dt=_.getComponentMethod("annotations","hasClickToShow")(t,ot);v(u.select(e.target),dt?"pointer":"")}e.target&&!r&&c(t,e,at)&&(at&&t.emit("plotly_unhover",{event:e,points:at}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:L,yaxes:C,xvals:E,yvals:N}))}function a(t,e,n){var r,a,o=e.hovermode,i=e.rotateLabels,l=e.bgColor,s=e.container,c=e.outerContainer,f=e.commonLabelOpts||{},d=e.fontFamily||k.HOVERFONT,h=e.fontSize||k.HOVERFONTSIZE,p=t[0],v=p.xa,x=p.ya,b="y"===o?"yLabel":"xLabel",_=p[b],w=(String(_)||"").split(" ")[0],A=c.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,O=p.distance<=k.MAXDIST&&("x"===o||"y"===o);for(r=0;r-1&&r.length>p&&(r=p>3?r.substr(0,p-3)+"...":r.substr(0,p))}void 0!==t.extraText&&(a+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(a+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(a+="y: "+t.yLabel+"
"),a+=(a?"z: ":"")+t.zLabel):O&&t[o+"Label"]===_?a=t[("x"===o?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(a=t.yLabel):a=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(a+=(a?"
":"")+t.text),""===a&&(""===r&&e.remove(),a=r);var v=e.select("text.nums").call(m.font,t.fontFamily||d,t.fontSize||h,t.fontColor||f).text(a).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,n),x=e.select("text.name"),b=0;r&&r!==a?(x.call(m.font,t.fontFamily||d,t.fontSize||h,c).text(r).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,n),b=x.node().getBoundingClientRect().width+2*z):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:c,stroke:f});var w,k,A=v.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,P=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),N=Math.abs(t.y1-t.y0),I=A.width+S+z+b;t.ty0=T-A.top,t.bx=A.width+2*z,t.by=A.height+2*z,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,i?(t.pos=D,w=P+N/2+I<=C,k=P-N/2-I>=0,"top"!==t.idealAlign&&w||!k?w?(P+=N/2,t.anchor="start"):t.anchor="middle":(P-=N/2,t.anchor="end")):(t.pos=P,w=D+E/2+I<=L,k=D-E/2-I>=0,"left"!==t.idealAlign&&w||!k?w?(D+=E/2,t.anchor="start"):t.anchor="middle":(D-=E/2,t.anchor="end")),v.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+P+")"+(i?"rotate("+M+")":""))}),E}function o(t,e){function n(t){var e=t[0],n=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=n.pos+n.dp+n.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;r=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;r=!1}if(r){var c=0;for(i=0;ie.pmax&&c++;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var r,a,o,i,l,s,c,u=0,f=t.map(function(t,n){var r=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===r._id.charAt(0)?T:1)/2,pmin:r._offset,pmax:r._offset+r._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!r&&u<=t.length;){for(u++,r=!0,i=0;i.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(d.push.apply(d,h),f.splice(i+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(o=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;r=!1}else i++}f.forEach(n)}for(i=f.length-1;i>=0;i--){var v=f[i];for(l=v.length-1;l>=0;l--){var m=v[l],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function i(t,e){t.each(function(t){var n=u.select(this);if(t.del)return void n.remove();var r="end"===t.anchor?-1:1,a=n.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],i=o*(S+z),l=i+o*(t.txwidth+z),s=0,c=t.offset;"middle"===t.anchor&&(i-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),n.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(r*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+r*t.bx+"v-"+t.by+"H"+(r*S+s)+"V"+(c-S)+"Z"),a.call(g.positionText,i+s,c+t.ty0-t.by/2+z),t.tx2width&&(n.select("text.name").call(g.positionText,l+o*z+s,c+t.ty0-t.by/2+z),n.select("rect").call(m.setRect,l+(o-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function n(e,n,i){var l;if(o[n])l=o[n];else if(a[n]){var s=a[n];Array.isArray(s)&&Array.isArray(s[t.index[0]])&&(l=s[t.index[0]][t.index[1]])}else l=h.nestedProperty(r,i).get();l&&(t[e]=l)}var r=t.trace||{},a=t.cd[0],o=t.cd[t.index]||{};n("hoverinfo","hi","hoverinfo"),n("color","hbg","hoverlabel.bgcolor"),n("borderColor","hbc","hoverlabel.bordercolor"),n("fontFamily","htf","hoverlabel.font.family"),n("fontSize","hts","hoverlabel.font.size"),n("fontColor","htc","hoverlabel.font.color"),n("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=h.constrain(t.x0,0,t.xa._length),t.x1=h.constrain(t.x1,0,t.xa._length),t.y0=h.constrain(t.y0,0,t.ya._length),t.y1=h.constrain(t.y1,0,t.ya._length);var i;if(void 0!==t.xLabelVal){i="log"===t.xa.type&&t.xLabelVal<=0;var l=b.tickText(t.xa,t.xa.c2l(i?-t.xLabelVal:t.xLabelVal),"hover");i?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+l.text:t.xLabel=l.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){i="log"===t.ya.type&&t.yLabelVal<=0;var s=b.tickText(t.ya,t.ya.c2l(i?-t.yLabelVal:t.yLabelVal),"hover");i?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+s.text:t.yLabel=s.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return"all"!==f&&(f=f.split("+"),-1===f.indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function s(t,e){var n=e.hovermode,r=e.container,a=t[0],o=a.xa,i=a.ya,l=o.showspikes,s=i.showspikes;if(r.selectAll(".spikeline").remove(),"closest"===n&&(l||s)){var c=e.fullLayout,u=o._offset+(a.x0+a.x1)/2,f=i._offset+(a.y0+a.y1)/2,h=y.combine(c.plot_bgcolor,c.paper_bgcolor),p=d.readability(a.color,h)<1.5?y.contrast(h):a.color;if(s){var g=i.spikemode,v=i.spikethickness,x=i.spikecolor||p,b=i._boundingBox,_=(b.left+b.right)/2=0;r--){var a=n[r],o=t._hoverdata[r];if(a.curveNumber!==o.curveNumber||String(a.pointNumber)!==String(o.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),h=t("../../lib"),p=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),m=t("../drawing"),y=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=k.HOVERARROWSIZE,z=k.HOVERTEXTPAD;n.hover=function(t,e,n,a){if("string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+k.HOVERMINTIME)return r(t,e,n,a),void(t._lastHoverTime=Date.now());t._hoverTimer=setTimeout(function(){r(t,e,n,a),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME)},n.loneHover=function(t,e){var n={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},r=u.select(e.container),o=e.outerContainer?u.select(e.outerContainer):r,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:r,outerContainer:o},s=a([n],l,e.gd);return i(s,l.rotateLabels),s.node()}},{"../../lib":147,"../../lib/events":141,"../../lib/override_cursor":156,"../../lib/svg_text_utils":164,"../../plots/cartesian/axes":183,"../../registry":219,"../color":34,"../dragelement":55,"../drawing":58,"./constants":70,"./helpers":72,d3:7,"fast-isnumeric":10,tinycolor2:16}],74:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e,n,a){a=a||{},n("hoverlabel.bgcolor",a.bgcolor),n("hoverlabel.bordercolor",a.bordercolor),n("hoverlabel.namelength",a.namelength),r.coerceFont(n,"hoverlabel.font",a.font)}},{"../../lib":147}],75:[function(t,e,n){"use strict";function r(t){var e=l.isD3Selection(t)?t:i.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,n){return l.castOption(t,e,"hoverlabel."+n)}function o(t,e,n){function r(n){return l.coerceHoverinfo({hoverinfo:n},{_module:t._module},e)}return l.castOption(t,n,"hoverinfo",r)}var i=t("d3"),l=t("../../lib"),s=t("../dragelement"),c=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:a,castHoverinfo:o,hover:t("./hover").hover,unhover:s.unhover,loneHover:t("./hover").loneHover,loneUnhover:r,click:t("./click")}},{"../../lib":147,"../dragelement":55,"./attributes":67,"./calc":68,"./click":69,"./constants":70,"./defaults":71,"./helpers":72,"./hover":73,"./layout_attributes":76,"./layout_defaults":77,"./layout_global_defaults":78,d3:7}],76:[function(t,e,n){"use strict";var r=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes"),o=t("./constants");e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:{family:r({},a.family,{dflt:o.HOVERFONT}),size:r({},a.size,{dflt:o.HOVERFONTSIZE}),color:r({},a.color)},namelength:{valType:"integer",min:-1,dflt:15}}}},{"../../lib/extend":142,"../../plots/font_attributes":207,"./constants":70}],77:[function(t,e,n){"use strict";function r(t){for(var e=!0,n=0;n=2/3},n.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},n.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},n.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],85:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},r,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":142,"../../plots/font_attributes":207,"../color/attributes":33}],86:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],87:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,n){function s(t,e){return a.coerce(h,p,o,t,e)}for(var c,u,f,d,h=t.legend||{},p=e.legend={},g=0,v="normal",m=0;m1)){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(h,p,["x","y"])}}},{"../../lib":147,"../../plots/layout_attributes":210,"../../registry":219,"./attributes":85,"./helpers":90}],88:[function(t,e,n){"use strict";function r(t,e){function n(n){y.convertToTspans(n,e,function(){i(t,e)})}var r=t.data()[0][0],a=e._fullLayout,o=r.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?r.label:o.name,u=t.selectAll("text.legendtext").data([0]);u.enter().append("text").classed("legendtext",!0),u.attr("text-anchor","start").classed("user-select-none",!0).call(v.font,a.legend.font).text(c),e._context.edits.legendText&&!l?u.call(y.makeEditable,{gd:e}).call(n).on("edit",function(t){this.text(t).call(n),this.text()||(t=" ");var a,o=r.trace._fullInput||{};if(-1!==["ohlc","candlestick"].indexOf(o.type)){var i=r.trace.transforms;a=i[i.length-1].direction+".name"}else a="name";f.restyle(e,a,t,s)}):u.call(n)}function a(t,e){var n,r=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(m.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){n=(new Date).getTime(),n-e._legendMouseDownTimeL&&(r=Math.max(r-1,1)),1===r?n._clickTimeout=setTimeout(function(){o(t,e,r)},L):2===r&&(n._clickTimeout&&clearTimeout(n._clickTimeout),e._legendMouseDownTime=0,o(t,e,r))}})}function o(t,e,n){if(!e._dragged&&!e._editing){var r,a,o=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],i=t.data()[0][0],l=e._fullData,s=i.trace,c=s.legendgroup,u=[];if(1===n&&T&&e.data&&e._context.showTips?(d.notifier("Double click on legend to isolate individual trace","long"),T=!1):T=!1,p.traceIs(s,"pie")){var h=i.label,g=o.indexOf(h);1===n?-1===g?o.push(h):o.splice(g,1):2===n&&(o=[],e.calcdata[0].forEach(function(t){h!==t.label&&o.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===o.length&&-1===g&&(o=[])),f.relayout(e,"hiddenlabels",o)}else{var v,m=[],y=[];for(v=0;vr.width-(r.margin.r+r.margin.l)&&(x=0,g+=m,a.height=a.height+m,m=0),v.setTranslate(this,o+x,5+o+e.height/2+g),a.width+=i+n,a.height=Math.max(a.height,e.height),x+=i+n,m=Math.max(e.height,m)}),a.width+=2*o,a.height+=10+2*o}a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),n.each(function(e){var n=e[0];u.select(this).select(".legendtoggle").call(v.setRect,0,-n.height/2,(t._context.edits.legendText?0:a.width)+l,n.height)})}function s(t){var e=t._fullLayout,n=e.legend,r="left";A.isRightAnchor(n)?r="right":A.isCenterAnchor(n)&&(r="center");var a="top";A.isBottomAnchor(n)?a="bottom":A.isMiddleAnchor(n)&&(a="middle"),h.autoMargin(t,"legend",{x:n.x,y:n.y,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:n.height*({top:1,middle:.5}[a]||0),t:n.height*({bottom:1,middle:.5}[a]||0)})}function c(t){var e=t._fullLayout,n=e.legend,r="left";A.isRightAnchor(n)?r="right":A.isCenterAnchor(n)&&(r="center"),h.autoMargin(t,"legend",{x:n.x,y:.5,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:0,t:0})}var u=t("d3"),f=t("../../plotly"),d=t("../../lib"),h=t("../../plots/plots"),p=t("../../registry"),g=t("../dragelement"),v=t("../drawing"),m=t("../color"),y=t("../../lib/svg_text_utils"),x=t("./constants"),b=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),k=t("./style"),M=t("./helpers"),A=t("./anchor_utils"),T=!0,L=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(v.setTranslate,0,e),z.call(v.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),T.select("rect").attr({y:y.borderwidth-e})}var n=t._fullLayout,i="legend"+n._uid;if(n._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=n.legend,b=n.showlegend&&w(t.calcdata,y),_=n.hiddenlabels||[];if(!n.showlegend||!b.length)return n._infolayer.selectAll(".legend").remove(),n._topdefs.select("#"+i).remove(),void h.autoMargin(t,"legend");var M=n._infolayer.selectAll("g.legend").data([0]);M.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=n._topdefs.selectAll("#"+i).data([0]);T.enter().append("clipPath").attr("id",i).append("rect");var C=M.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(m.stroke,y.bordercolor),C.call(m.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var S=M.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var z=M.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(m.fill,"#808BA4");var O=S.selectAll("g.groups").data(b);O.enter().append("g").attr("class","groups"),O.exit().remove();var D=O.selectAll("g.traces").data(d.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(k,t).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(r,t).call(a,t)});var P=0!==M.enter().size();P&&(l(t,O,D),s(t));var E=n.width,N=n.height;l(t,O,D),y.height>N?c(t):s(t);var I=n._size,R=I.l+I.w*y.x,F=I.t+I.h*(1-y.y);A.isRightAnchor(y)?R-=y.width:A.isCenterAnchor(y)&&(R-=y.width/2),A.isBottomAnchor(y)?F-=y.height:A.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=I.w;j>B?(R=I.l,j=B):(R+j>E&&(R=E-j),R<0&&(R=0),j=Math.min(E-R,y.width));var H=y.height,q=I.h;H>q?(F=I.t,H=q):(F+H>N&&(F=N-H),F<0&&(F=0),H=Math.min(N-F,y.height)),v.setTranslate(M,R,F);var V,U,G=H-x.scrollBarHeight-2*x.scrollBarMargin,X=y.height-H;if(y.height<=H||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:H-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),v.setTranslate(S,0,0),T.select("rect").attr({width:j-2*y.borderwidth,height:H-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),S.call(v.setClipUrl,i);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:H-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),T.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:H-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),S.call(v.setClipUrl,i),P&&e(V,U),M.on("wheel",null),M.on("wheel",function(){U=d.constrain(S.attr("data-scroll")-u.event.deltaY/G*X,-X,0),V=x.scrollBarMargin-U/X*G,e(V,U),0!==U&&U!==-X&&u.event.preventDefault()}),z.on(".drag",null),S.on(".drag",null);var Y=u.behavior.drag().on("drag",function(){V=d.constrain(u.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+G),U=-(V-x.scrollBarMargin)/G*X,e(V,U)});z.call(Y),S.call(Y)}if(t._context.edits.legendPosition){var Z,W,$,Q;M.classed("cursor-move",!0),g.init({element:M.node(),gd:t,prepFn:function(){var t=v.getTranslate(M);$=t.x,Q=t.y},moveFn:function(t,e){var n=$+t,r=Q+e;v.setTranslate(M,n,r),Z=g.align(n,0,I.l,I.l+I.w,y.xanchor),W=g.align(r,0,I.t+I.h,I.t,y.yanchor)},doneFn:function(e,r,a){if(e&&void 0!==Z&&void 0!==W)f.relayout(t,{"legend.x":Z,"legend.y":W});else{var i=n._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===r?M._clickTimeout=setTimeout(function(){o(i,t,r)},L):2===r&&(M._clickTimeout&&clearTimeout(M._clickTimeout),o(i,t,r)))}}})}}}},{"../../constants/alignment":130,"../../constants/interactions":131,"../../lib":147,"../../lib/svg_text_utils":164,"../../plotly":178,"../../plots/plots":212,"../../registry":219,"../color":34,"../dragelement":55,"../drawing":58,"./anchor_utils":84,"./constants":86,"./get_legend_data":89,"./helpers":90,"./style":92,d3:7}],89:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function n(t,n){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),c=!0,l[t]=[[n]]):l[t].push([n]);else{var r="~~i"+f;s.push(r),l[r]=[[n]],f++}}var o,i,l={},s=[],c=!1,u={},f=0;for(o=0;on[1])return n[1]}return a}function a(t){return t[0]}var l,c,u=t[0],f=u.trace,d=s.hasMarkers(f),h=s.hasText(f),p=s.hasLines(f);if(d||h||p){var g={},v={};d&&(g.mc=n("marker.color",a),g.mo=n("marker.opacity",o.mean,[.2,1]),g.ms=n("marker.size",o.mean,[2,16]),g.mlc=n("marker.line.color",a),g.mlw=n("marker.line.width",o.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(v.line={width:n("line.width",a,[0,10])}),h&&(g.tx="Aa",g.tp=n("textposition",a),g.ts=10,g.tc=n("textfont.color",a),g.tf=n("textfont.family",a)),l=[o.minExtend(u,g)],c=o.minExtend(f,v)}var m=r.select(this).select("g.legendpoints"),y=m.selectAll("path.scatterpts").data(d?l:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(i.pointStyle,c,e),d&&(l[0].mrc=3);var x=m.selectAll("g.pointtext").data(h?l:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(i.textPointStyle,c,e)}function f(t){var e=t[0].trace,n=e.marker||{},o=n.line||{},i=r.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=r.select(this),a=t[0],i=(a.mlw+1||o.width+1)-1;e.style("stroke-width",i+"px").call(l.fill,a.mc||n.color),i&&e.call(l.stroke,a.mlc||o.color)})}function d(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.traceIs(e,"box")&&e.visible?[t]:[]);n.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.each(function(){var t=e.line.width,n=r.select(this);n.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&n.call(l.stroke,e.line.color)})}function h(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);n.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.size()&&n.call(c,t[0],e)}t.each(function(t){var e=r.select(this),n=e.selectAll("g.layers").data([0]);n.enter().append("g").classed("layers",!0),n.style("opacity",t[0].trace.opacity),n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var a=n.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(d).each(h).each(n).each(u)}},{"../../lib":147,"../../registry":219,"../../traces/pie/style_one":251,"../../traces/scatter/subtypes":273,"../color":34,"../drawing":58,d3:7}],93:[function(t,e,n){"use strict";function r(t,e){var n,r,a=e.currentTarget,o=a.getAttribute("data-attr"),i=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=d.list(t,null,!0),f="on";if("zoom"===o){var h,p="in"===i?.5:2,g=(1+p)/2,v=(1-p)/2;for(r=0;r1)return r(["resetViews","toggleHover"]),i(m,n);u&&(r(["zoom3d","pan3d","orbitRotation","tableRotation"]),r(["resetCameraDefault3d","resetCameraLastSave3d"]),r(["hoverClosest3d"])),f&&(r(["zoomInGeo","zoomOutGeo","resetGeo"]),r(["hoverClosestGeo"]));var y=a(l),x=[];return((c||p)&&!y||g)&&(x=["zoom2d","pan2d"]),v&&(x=["pan2d"]),o(s)&&(x.push("select2d"),x.push("lasso2d")),x.length&&r(x),!c&&!p||y||g||r(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&h?r(["toggleHover"]):p?r(["hoverClosestGl2d"]):c?r(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):h?r(["hoverClosestPie"]):v&&r(["resetViewMapbox","toggleHover"]),i(m,n)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),n=!0,r=0;r0)){var p=a(e,n,s);f("x",p[0]),f("y",p[1]),o.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),o.coerceFont(f,"font",n.font);var g=f("bgcolor");f("activecolor",i.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":147,"../color":34,"./attributes":97,"./button_attributes":98,"./constants":99}],101:[function(t,e,n){"use strict";function r(t){for(var e=m.list(t,"x",!0),n=[],r=0;rp&&(p=d)));return p>=h?[h,p]:void 0}}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./constants"),l=t("./helpers");e.exports=function(t){var e=t._fullLayout,n=a.filterVisible(e.shapes);if(n.length&&t._fullData.length)for(var l=0;lX&&r>Y&&!t.shiftKey?p.getCursor(a/n,1-o/r):"move";g(e,i),G=i.split("-")[0]}function o(e){j=f.getFromId(t,n.xref),B=f.getFromId(t,n.yref),H=m.getDataToPixel(t,j),q=m.getDataToPixel(t,B,!0),V=m.getPixelToData(t,j),U=m.getPixelToData(t,B,!0);var o="shapes["+r+"]";"path"===n.type?(R=n.path,F=o+".path"):(v=H(n.x0),y=q(n.y0),x=H(n.x1),b=q(n.y1),_=o+".x0",w=o+".y0",k=o+".x1",M=o+".y1"),vY&&(h[S]=n[P]=U(c),h[z]=n[E]=U(u)),d-f>X&&(h[O]=n[N]=V(f),h[D]=n[I]=V(d))}e.attr("d",i(t,n))}var h,v,y,x,b,_,w,k,M,A,T,L,C,S,z,O,D,P,E,N,I,R,F,j,B,H,q,V,U,G,X=10,Y=10,Z={element:e.node(),gd:t,prepFn:o,doneFn:l},W=Z.element.getBoundingClientRect();p.init(Z),e.node().onmousemove=a}function i(t,e){var n,r,a,o,i=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(n=m.shapePositionToRange(s),r=function(t){return s._offset+s.r2p(n(t,!0))}):r=function(t){return u.l+u.w*t},c?(a=m.shapePositionToRange(c),o=function(t){return c._offset+c.r2p(a(t,!0))}):o=function(t){return u.t+u.h*(1-t)},"path"===i)return s&&"date"===s.type&&(r=m.decodeDate(r)),c&&"date"===c.type&&(o=m.decodeDate(o)),l(e.path,r,o);var d=r(e.x0),h=r(e.x1),p=o(e.y0),g=o(e.y1);if("line"===i)return"M"+d+","+p+"L"+h+","+g;if("rect"===i)return"M"+d+","+p+"H"+h+"V"+g+"H"+d+"Z";var v=(d+h)/2,y=(p+g)/2,x=Math.abs(v-d),b=Math.abs(y-p),_="A"+x+","+b,w=v+x+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,n){return t.replace(v.segmentRE,function(t){var r=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return o[r]?t=e(t):i[r]&&(t=n(t)),r++,r>l&&(t="X"),t});return r>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,n){return t.replace(v.segmentRE,function(t){var r=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return r>=l?t:(o[r]?t=e(t):i[r]&&(t=n(t)),r++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),h=t("../drawing"),p=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),m=t("./helpers");e.exports={draw:r,drawOne:a}},{"../../lib":147,"../../lib/setcursor":162,"../../plotly":178,"../../plots/cartesian/axes":183,"../color":34,"../dragelement":55,"../drawing":58,"./constants":112,"./helpers":115}],115:[function(t,e,n){"use strict";n.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},n.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},n.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},n.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},n.getDataToPixel=function(t,e,r){var a,o=t._fullLayout._size;if(e){var i=n.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(i(t,!0))},"date"===e.type&&(a=n.decodeDate(a))}else a=r?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return a},n.getPixelToData=function(t,e,r){var a,o=t._fullLayout._size;if(e){var i=n.rangeToShapePosition(e);a=function(t){return i(e.p2r(t-e._offset))}}else a=r?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a}},{}],116:[function(t,e,n){"use strict";var r=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:r.draw,drawOne:r.drawOne}},{"./attributes":110,"./calc_autorange":111,"./defaults":113,"./draw":114}],117:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./attributes"),i=t("./helpers");e.exports=function(t,e,n,l,s){function c(n,a){return r.coerce(t,e,o,n,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],h=0;h<2;h++){var p=d[h],g={_fullLayout:n},v=a.coerceRef(t,e,g,p,"","paper");if("path"!==f){var m,y,x;"paper"!==v?(m=a.getFromId(g,v),x=i.rangeToShapePosition(m),y=i.shapePositionToRange(m)):y=x=r.identity;var b=p+"0",_=p+"1",w=t[b],k=t[_];t[b]=y(t[b],!0),t[_]=y(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):r.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":147,"../../plots/cartesian/axes":183,"./attributes":110,"./helpers":115}],118:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),o=t("../../lib/extend").extendFlat,i=t("../../lib/extend").extendDeep,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i({},a,{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:o({},r,{})},font:o({},r,{}),activebgcolor:{valType:"color",dflt:s.gripBgActiveColor},bgcolor:{valType:"color",dflt:s.railBgColor},bordercolor:{valType:"color",dflt:s.railBorderColor},borderwidth:{valType:"number",min:0,dflt:s.railBorderWidth},ticklen:{valType:"number",min:0,dflt:s.tickLength},tickcolor:{valType:"color",dflt:s.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:s.minorTickLength}}},{"../../lib/extend":142,"../../plots/animation_attributes":179,"../../plots/font_attributes":207,"../../plots/pad_attributes":211,"./constants":119}],119:[function(t,e,n){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],120:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,l,n,r)}r("visible",a(t,e).length>0)&&(r("active"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("len"),r("lenmode"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),o.coerceFont(r,"font",n.font),r("currentvalue.visible")&&(r("currentvalue.xanchor"),r("currentvalue.prefix"),r("currentvalue.suffix"),r("currentvalue.offset"),o.coerceFont(r,"currentvalue.font",e.font)),r("transition.duration"),r("transition.easing"),r("bgcolor"),r("activebgcolor"),r("bordercolor"),r("borderwidth"),r("ticklen"),r("tickwidth"),r("tickcolor"),r("minorticklen"))}function a(t,e){function n(t,e){return o.coerce(r,a,u,t,e)}for(var r,a,i=t.steps||[],l=e.steps=[],s=0;s=n.steps.length&&(n.active=0),e.call(l,n).call(b,n).call(u,n).call(p,n).call(x,t,n).call(s,t,n),A.setTranslate(e,n.lx+n.pad.l,n.ly+n.pad.t),e.call(v,n,n.active/(n.steps.length-1),!1),e.call(l,n)}function l(t,e,n){if(e.currentvalue.visible){var r,a,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":r=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":r=.5*e.inputAreaLength,a="middle";break;default:r=C.currentValueInset,a="left"}o.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var i=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof n)i+=n;else{i+=e.steps[e.active].label}e.currentvalue.suffix&&(i+=e.currentvalue.suffix),o.call(A.font,e.currentvalue.font).text(i).call(T.convertToTspans,e.gd);var l=T.lineCount(o),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*S;return T.positionText(o,r,s),o}}function s(t,e,n){ -var r=t.selectAll("rect."+C.gripRectClass).data([0]);r.enter().append("rect").classed(C.gripRectClass,!0).call(h,e,t,n).style("pointer-events","all"),r.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,n.bordercolor).call(M.fill,n.bgcolor).style("stroke-width",n.borderwidth+"px")}function c(t,e,n){var r=t.selectAll("text").data([0]);return r.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),r.call(A.font,n.font).text(e.step.label).call(T.convertToTspans,n.gd),r}function u(t,e){var n=t.selectAll("g."+C.labelsClass).data([0]);n.enter().append("g").classed(C.labelsClass,!0);var r=n.selectAll("g."+C.labelGroupClass).data(e.labelSteps);r.enter().append("g").classed(C.labelGroupClass,!0),r.exit().remove(),r.each(function(t){var n=w.select(this);n.call(c,t,e),A.setTranslate(n,m(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*S+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,n,r,a){var o=Math.round(r*(n.steps.length-1));o!==n.active&&d(t,e,n,o,!0,a)}function d(t,e,n,r,a,o){var i=n.active;n._input.active=n.active=r;var s=n.steps[n.active];e.call(v,n,n.active/(n.steps.length-1),o),e.call(l,n),t.emit("plotly_sliderchange",{slider:n,step:n.steps[n.active],interaction:a,previousActive:i}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var n=e._nextMethod.step;n.method&&(n.execute&&k.executeAPICommand(t,n.method,n.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function h(t,e,n){function r(){return n.data()[0]}var a=n.node(),o=w.select(e);t.on("mousedown",function(){var t=r();e.emit("plotly_sliderstart",{slider:t});var i=n.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),i.call(M.fill,t.activebgcolor);var l=y(t,w.mouse(a)[0]);f(e,n,t,l,!0),t._dragging=!0,o.on("mousemove",function(){var t=r(),o=y(t,w.mouse(a)[0]);f(e,n,t,o,!1)}),o.on("mouseup",function(){var t=r();t._dragging=!1,i.call(M.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var n=t.selectAll("rect."+C.tickRectClass).data(e.steps);n.enter().append("rect").classed(C.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each(function(t,n){var r=n%e.labelStride==0,a=w.select(this);a.attr({height:r?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,m(e,n/(e.steps.length-1))-.5*e.tickwidth,(r?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,n=0;n0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function m(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-C.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*C.stepInset-2*t.inputAreaStart)))}function x(t,e,n){var r=t.selectAll("rect."+C.railTouchRectClass).data([0]);r.enter().append("rect").classed(C.railTouchRectClass,!0).call(h,e,t,n).style("pointer-events","all"),r.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,C.tickOffset+n.ticklen+n.labelHeight)}).call(M.fill,n.bgcolor).attr("opacity",0),A.setTranslate(r,0,n.currentValueTotalHeight)}function b(t,e){var n=t.selectAll("rect."+C.railRectClass).data([0]);n.enter().append("rect").classed(C.railRectClass,!0);var r=e.inputAreaLength-2*C.railInset;n.attr({width:r,height:C.railWidth,rx:C.railRadius,ry:C.railRadius,"shape-rendering":"crispEdges"}).call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(n,C.railInset,.5*(e.inputAreaWidth-C.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;r0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==n.length){var s=l.selectAll("g."+C.groupClassName).data(n,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,k.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c0||d<0){var g={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[_.side];e.attr("transform","translate("+g+")")}}}var v,m=n.propContainer,y=n.propName,x=n.traceIndex,b=n.dfltName,_=n.avoid||{},w=n.attributes,k=n.transform,M=n.containerGroup,A=t._fullLayout,T=m.titlefont.family,L=m.titlefont.size,C=m.titlefont.color,S=1,z=!1,O=m.title.trim();"title"===y?v="titleText":-1!==y.indexOf("axis")?v="axisTitleText":y.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===O&&(S=0),O.match(d)&&(S=.2,z=!0,D||(O=""));var P=O||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var E=M.selectAll("text").data(P?[0]:[]);if(E.enter().append("text"),E.text(O).attr("class",e),E.exit().remove(),P){E.call(h);var N="Click to enter "+b+" title";D&&(O?E.on(".opacity",null):function(){S=0,z=!0,O=N,E.text(O).on("mouseover.opacity",function(){r.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),E.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?o.restyle(t,y,e,x):o.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(h)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),E.classed("js-placeholder",z)}}},{"../../constants/interactions":131,"../../lib":147,"../../lib/svg_text_utils":164,"../../plotly":178,"../../plots/plots":212,"../color":34,"../drawing":58,d3:7,"fast-isnumeric":10}],124:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports={_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:l,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:o({},i,{}),font:o({},r,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":142,"../../plots/font_attributes":207,"../../plots/pad_attributes":211,"../color/attributes":33}],125:[function(t,e,n){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],126:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,l,n,r)}r("visible",a(t,e).length>0)&&(r("active"),r("direction"),r("type"),r("showactive"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),o.coerceFont(r,"font",n.font),r("bgcolor",n.paper_bgcolor),r("bordercolor"),r("borderwidth"))}function a(t,e){function n(t,e){return o.coerce(r,a,u,t,e)}for(var r,a,i=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(o.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&_(t),0!==n.length){var u=o.selectAll("g."+S.headerGroupClassName).data(n,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=o.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;dk,T=r.barLength+2*r.barPad,L=r.barWidth+2*r.barPad,C=p,S=v+m;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(o.fill,r.barColor),A?(this.hbar=z.attr({rx:r.barRadius,ry:r.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>M,D=r.barWidth+2*r.barPad,P=r.barLength+2*r.barPad,E=p+g,N=v;E+D>s&&(E=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(o.fill,r.barColor),O?(this.vbar=I.attr({rx:r.barRadius,ry:r.barRadius,x:E,y:N,width:D,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,H=A?h+L+.5:h+.5,q=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(q.exit().remove(),q.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=q.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(H)-Math.floor(B)}),this.container.call(i.setClipUrl,R),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,n)},r.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},r.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},r.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},r.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,r=n+this._hbarTranslateMax;t=(l.constrain(a.event.x,n,r)-n)/(r-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,i=o+this._vbarTranslateMax;e=(l.constrain(a.event.y,o,i)-o)/(i-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},r.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=l.constrain(t||0,0,n),e=l.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/n;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var o=e/r;this.vbar.call(i.setTranslate,t,e+o*this._vbarTranslateMax)}}},{"../../lib":147,"../color":34,"../drawing":58,d3:7}],130:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],131:[function(t,e,n){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],132:[function(t,e,n){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6}},{}],133:[function(t,e,n){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],134:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],135:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.29.2",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=t("./components/fx"),n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":27,"./components/annotations3d":32,"./components/fx":75,"./components/images":83,"./components/legend":91,"./components/rangeselector":103,"./components/rangeslider":109,"./components/shapes":116,"./components/sliders":122,"./components/updatemenus":128,"./fonts/mathjax_config":136,"./lib/queue":159,"./plot_api/plot_schema":172,"./plot_api/register":173,"./plot_api/set_plot_config":174,"./plot_api/to_image":176,"./plot_api/validate":177,"./plotly":178,"./snapshot":224,"./snapshot/download":221,"./traces/scatter":263,d3:7,"es6-promise":8}],136:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],137:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,o=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"")),r(t)?Number(t):a}},{"../constants/numerical":132,"fast-isnumeric":10}],138:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../plots/attributes"),i=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=/^([2-9]|[1-9][0-9]+)$/;n.valObjects={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ra.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,a){t%1||!r(t)||void 0!==a.min&&ta.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var a="number"==typeof t;!0!==r.strict&&a?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){a(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(i(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){var r=n.length;if("string"==typeof t&&t.substr(0,r)===n&&s.test(t.substr(r)))return void e.set(t);e.set(n)},validateFunction:function(t,e){var n=e.dflt,r=n.length;return t===n||"string"==typeof t&&!(t.substr(0,r)!==n||!s.test(t.substr(r)))}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if(-1!==(r.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),o=0;o0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+i}return r}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),h=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,L=(new Date).getFullYear()-70;n.dateTick0=function(t,e){return r(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},n.dfltRange=function(t){return r(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},n.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var C,S;n.dateTime2ms=function(t,e){if(n.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=C&&t<=S?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var a=r(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var i=a&&"chinese"===e.substr(0,7),l=t.match(i?T:A);if(!l)return m;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),h=Number(l[11]||0);if(a){if(2===s.length)return m;s=Number(s);var p;try{var g=k.getComponentMethod("calendars","getCal")(e);if(i){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),p=g.newDate(s,g.toMonthIndex(s,c,v),u)}else p=g.newDate(s,Number(c),u)}catch(t){return m}return p?(p.toJD()-w)*y+f*x+d*b+h*_:m}s=2===s.length?(Number(s)+2e3-L)%100+L:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?m:M.getUTCDate()!==u?m:M.getTime()+h*_},C=n.MIN_MS=n.dateTime2ms("-9999"),S=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==m};var z=90*y,O=3*x,D=5*b;n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=C&&t<=S))return m;e||(e=0);var a,i,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(r(n)){var h=Math.floor(d/y)+w,p=Math.floor(g(t,y));try{a=k.getComponentMethod("calendars","getCal")(n).fromJD(h).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;i=e=C+y&&t<=S-y))return m;var e=Math.floor(10*g(t+.05,1)),n=new Date(Math.round(t-e/10));return o(d.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,a){if(n.isJSDate(t)||"number"==typeof t){if(r(a))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,a))return p("unrecognized date",t),e;return t};var P=/%\d?f/g,E=[59,59.9,59.99,59.999,59.9999],N=M("%Y"),I=M("%b %Y"),R=M("%b %-d"),F=M("%b %-d, %Y");n.formatDate=function(t,e,n,a){var o,d;if(a=r(a)&&a,e)return i(e,t,a);if(a)try{var h=Math.floor((t+.05)/y)+w,p=k.getComponentMethod("calendars","getCal")(a).fromJD(h);"y"===n?d=s(p):"m"===n?d=c(p):"d"===n?(o=s(p),d=u(p)):(o=f(p),d=l(t,n))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===n?d=N(g):"m"===n?d=I(g):"d"===n?(o=N(g),d=R(g)):(o=F(g),d=l(t,n))}return d+(o?"\n"+o:"")};var j=3*y;n.incrementMonth=function(t,e,n){n=r(n)&&n;var a=g(t,y);if(t=Math.round(t-a),n)try{var o=Math.round(t/y)+w,i=k.getComponentMethod("calendars","getCal")(n),l=i.fromJD(o);return e%12?i.add(l,e,"m"):i.add(l,e/12,"y"),(l.toJD()-w)*y+a}catch(e){p("invalid ms "+t+" in calendar "+n)}var s=new Date(t+j);return s.setUTCMonth(s.getUTCMonth()+e)+a-j},n.findExactDates=function(t,e){for(var n,a,o=0,i=0,l=0,s=0,c=r(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function a(t,e,n,r,a){var o=r*t+a*e;if(o<0)return r*r+a*a;if(o>n){var i=r-t,l=a-e;return i*i+l*l}var s=r*e-a*t;return s*s/n}var o=t("./mod");n.segmentsIntersect=r,n.segmentDistance=function(t,e,n,o,i,l,s,c){if(r(t,e,n,o,i,l,s,c))return 0;var u=n-t,f=o-e,d=s-i,h=c-l,p=u*u+f*f,g=d*d+h*h,v=Math.min(a(u,f,p,i-t,l-e),a(u,f,p,s-t,c-e),a(d,h,g,t-i,e-l),a(d,h,g,n-i,o-l));return Math.sqrt(v)};var i,l,s;n.getTextLocation=function(t,e,n,r){if(t===l&&r===s||(i={},l=t,s=r),i[n])return i[n];var a=t.getPointAtLength(o(n-r/2,e)),c=t.getPointAtLength(o(n+r/2,e)),u=Math.atan((c.y-a.y)/(c.x-a.x)),f=t.getPointAtLength(o(n,e)),d=(4*f.x+a.x+c.x)/6,h=(4*f.y+a.y+c.y)/6,p={x:d,y:h,theta:u};return i[n]=p,p},n.clearLocationCache=function(){l=null},n.getVisibleSegment=function(t,e,n){function r(e){var n=t.getPointAtLength(e);0===e?a=n:e===f&&(o=n);var r=n.xl?n.x-l:0,u=n.yc?n.y-c:0;return Math.sqrt(r*r+u*u)}for(var a,o,i=e.left,l=e.right,s=e.top,c=e.bottom,u=0,f=t.getTotalLength(),d=f,h=r(u);h;){if((u+=h+n)>d)return;h=r(u)}for(h=r(d);h;){if(d-=h+n,u>d)return;h=r(d)}return{min:u,max:d,len:d-u,total:f,isClosed:0===u&&d===f&&Math.abs(a.x-o.x)<.1&&Math.abs(a.y-o.y)<.1}}},{"./mod":152}],146:[function(t,e,n){"use strict";e.exports=function(t){return t}},{}],147:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../constants/numerical"),i=o.FP_SAFE,l=o.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjects=c.valObjects,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var h=t("./matrix");s.init2dArray=h.init2dArray,s.transposeRagged=h.transposeRagged,s.dot=h.dot,s.translationMatrix=h.translationMatrix,s.rotationMatrix=h.rotationMatrix,s.rotationXYMatrix=h.rotationXYMatrix,s.apply2DTransform=h.apply2DTransform,s.apply2DTransform2=h.apply2DTransform2;var p=t("./geometry2d");s.segmentsIntersect=p.segmentsIntersect,s.segmentDistance=p.segmentDistance,s.getTextLocation=p.getTextLocation,s.clearLocationCache=p.clearLocationCache,s.getVisibleSegment=p.getVisibleSegment;var g=t("./extend");s.extendFlat=g.extendFlat,s.extendDeep=g.extendDeep,s.extendDeepAll=g.extendDeepAll,s.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");s.log=v.log,s.warn=v.warn,s.error=v.error,s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t),t<-i||t>i?l:a(t)?Number(t):l):l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var a=0;an?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},s.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},s.simpleMap=function(t,e,n,r){for(var a=t.length,o=new Array(a),i=0;i-1||u!==1/0&&u>=Math.pow(2,n)?t(e,n,r):s},s.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var n,r,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(n=0;n=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[r];u[n]=o}return u},s.syncOrAsync=function(t,e,n){function r(){return s.syncOrAsync(t,e,n)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],(a=o(e))&&a.then)return a.then(r).then(void 0,s.promiseError);return n&&n(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,n){if(t){var r,a,o=!1,i=!0;for(r=0;r1?a+i[1]:"";if(o&&(i.length>1||l.length>4||n))for(;r.test(l);)l=l.replace(r,"$1"+o+"$2");return l+s}},{"../constants/numerical":132,"./clean_number":137,"./coerce":138,"./dates":139,"./ensure_array":140,"./extend":142,"./filter_unique":143,"./filter_visible":144,"./geometry2d":145,"./identity":146,"./is_array":148,"./is_plain_object":149,"./loggers":150,"./matrix":151,"./mod":152,"./nested_property":153,"./noop":154,"./notifier":155,"./push_unique":158,"./relink_private":160,"./search":161,"./stats":163,"./to_log_range":165,d3:7,"fast-isnumeric":10}],148:[function(t,e,n){"use strict";var r="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||r.isView(t)}},{}],149:[function(t,e,n){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],150:[function(t,e,n){"use strict";function r(t,e){if(t.apply)t.apply(t,e);else for(var n=0;n1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e][0],o=t[e][1],s=!1,h(r))for(n=r.length-1;n>=0;n--)a(r[n],i(o,n))?s?r[n]=void 0:r.pop():s=!0;else if("object"==typeof r&&null!==r)for(l=Object.keys(r),s=!1,n=l.length-1;n>=0;n--)a(r[l[n]],i(o,l[n]))?delete r[l[n]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(h(t)?!t.length:!Object.keys(t).length)}function f(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var d=t("fast-isnumeric"),h=t("./is_array"),p=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var n,a,i,l=0,s=e.split(".");l/g),l=0;li||r===a||rs)&&(!e||!u(t))}function n(t,e){var n=t[0],c=t[1];if(n===a||ni||c===a||cs)return!1;var u,f,d,h,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(r(i,d))>a)return!0;return!1};o.filter=function(t,e){function n(n){t.push(n);var l=r.length,s=a;r.splice(o+1);for(var c=s+1;c1){n(t.pop())}return{addPt:n,raw:t,filtered:r}}},{"../constants/numerical":132,"./matrix":151}],158:[function(t,e,n){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var n,r=e.toString();for(n=0;no.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},i.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},i.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},i.undo=function(t){var e,n;if(t.framework&&t.framework.isPolar)return void t.framework.undo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;ne}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("./loggers");n.findBin=function(t,e,n){if(l(e.start))return n?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,h=0;for(u=e[e.length-1]>=e[0]?n?r:a:n?i:o;f90&&s.log("Long binary search..."),f-1},n.sorterAsc=function(t,e){return t-e},n.sorterDes=function(t,e){return e-t},n.distinctVals=function(t){var e=t.slice();e.sort(n.sorterAsc);for(var r=e.length-1,a=e[r]-e[0]||1,o=a/(r||1)/1e4,i=[e[0]],l=0;le[l]+o&&(a=Math.min(a,e[l+1]-e[l]),i.push(e[l+1]));return{vals:i,minDiff:a}},n.roundUp=function(t,e,n){for(var r,a=0,o=e.length-1,i=0,l=n?0:1,s=n?1:0,c=n?Math.ceil:Math.floor;at.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]}},{"fast-isnumeric":10}],164:[function(t,e,n){"use strict";function r(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(m,"\\lt ").replace(y,"\\gt ")}function o(t,e,n){var r="math-output-"+d.randstr([],64),o=f.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())d.log("There was an error in the tex syntax.",t),n();else{var r=o.select("svg").node().getBoundingClientRect();n(o.select(".MathJax_SVG"),e,r)}o.remove()})}function i(t,e){if(!t)return null;var n=t.match(e);return n&&(n[3]||n[4])}function l(t,e){if(!t)return"";for(var n=0;n1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),o=c[c.length-1].node}(M);else{var N=y[4],I={type:M},R=i(N,z);if(R?(R=R.replace(E,"$1 fill:"),A&&(R+=";"+A)):A&&(R=A),R&&(I.style=R),"a"===M){l=!0;var F=i(N,O);if(F){var j=document.createElement("a");j.href=F,-1!==k.indexOf(j.protocol)&&(I.href=encodeURI(F),I.target=i(N,D)||"_blank",I.popup=i(N,P))}}r(I)}}return l}function u(t,e,n){var r,a,o,i=n.horizontalAlign,l=n.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-r.height}:"middle"===l?function(){ -return s.top+(s.height-r.height)/2}:function(){return s.top},o="right"===i?function(){return s.right-r.width}:"center"===i?function(){return s.left+(s.width-r.width)/2}:function(){return s.left},function(){return r=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:o()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),h=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),g=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;n.convertToTspans=function(t,e,a){function i(){u.empty()||(d=t.attr("class")+"-math",u.select("svg."+d).remove()),t.text("").style("white-space","pre"),c(t.node(),l)&&t.style("pointer-events","all"),n.positionText(t),a&&a.call(t)}var l=t.text(),s=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&l.match(v),u=f.select(t.node().parentNode);if(!u.empty()){var d=t.attr("class")?t.attr("class").split(" ")[0]:"text";return d+="-math",u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove(),t.style("display",null).attr({"data-unformatted":l,"data-math":"N"}),s?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var n={fontSize:parseInt(t.style("font-size"),10)};o(s[2],n,function(n,o,s){u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove();var c=n&&n.select("svg");if(!c||!c.node())return i(),void e();var f=u.append("g").classed(d+"-group",!0).attr({"pointer-events":"none","data-unformatted":l,"data-math":"Y"});f.node().appendChild(c.node()),o&&o.node()&&c.node().insertBefore(o.node().cloneNode(!0),c.node().firstChild),c.attr({class:d,height:s.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var h=t.style("fill")||"black";c.select("g").attr({fill:h,stroke:h});var p=r(c,"width"),g=r(c,"height"),v=+t.attr("x")-p*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=parseInt(t.style("font-size"),10)||r(t,"height"),y=-m/4;"y"===d[0]?(f.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-p/2,y-g/2]+")"}),c.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===d[0]?c.attr({x:t.attr("x"),y:y-g/2}):"a"===d[0]?c.attr({x:0,y:y}):c.attr({x:v,y:+t.attr("y")+y-g/2}),a&&a.call(t,f),e(f)})})):i(),t}};var m=/(<|<|<)/g,y=/(>|>|>)/g,x={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},b={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",k=["http:","https:","mailto:","",void 0,":"],M=new RegExp("]*)?/?>","g"),A=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,L=/(<[^<>]*>)/,C=/<(\/?)([^ >]*)(\s+(.*))?>/i,S=//i,z=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,O=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,D=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,P=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,E=/(^|;)\s*color:/;n.plainText=function(t){return(t||"").replace(M," ")},n.lineCount=function(t){return t.selectAll("tspan.line").size()||1},n.positionText=function(t,e,n){return t.each(function(){function t(t,e){return void 0===e?null===(e=r.attr(t))&&(r.attr(t,0),e=0):r.attr(t,e),e}var r=f.select(this),a=t("x",e),o=t("y",n);"text"===this.nodeName&&r.selectAll("tspan.line").attr({x:a,y:o})})},n.makeEditable=function(t,e){function n(){a(),t.style({opacity:0});var e,n=s.attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function r(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}function a(){var n=f.select(o),a=n.select(".svg-container"),i=a.append("div");i.classed("plugin-editable editable",!0).style({position:"absolute","font-family":t.style("font-family")||"Arial","font-size":t.style("font-size")||12,color:e.fill||t.style("fill")||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(t.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(u(t,a,e)).on("blur",function(){o._editing=!1,t.text(this.textContent).style({opacity:1});var e,n=f.select(this).attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var r=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(t,r)}).on("focus",function(){var t=this;o._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===i.node()&&i.node().blur()})}).on("keyup",function(){27===f.event.which?(o._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(t,this.textContent)):(l.input.call(t,this.textContent),f.select(this).call(u(t,a,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(r)}var o=e.gd,i=e.delegate,l=f.dispatch("edit","input","cancel"),s=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?n():s.on("click",n),f.rebind(t,l,"on")}},{"../constants/alignment":130,"../constants/string_mappings":133,"../constants/xmlns_namespaces":134,"../lib":147,d3:7}],165:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}},{"fast-isnumeric":10}],166:[function(t,e,n){"use strict";var r=t("../registry");e.exports=function(t){for(var e,n,a=r.layoutArrayContainers,o=r.layoutArrayRegexes,i=t.split("[")[0],l=0;l0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),h=t("../components/color");n.getGraphDiv=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t},n.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},n.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var a=d.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var m=f.getSubplotIds(t,"gl3d");for(e=0;e1&&i.warn("Full array edits are incompatible with other edits",f);var y=n[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),h(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(n).map(Number).sort(l),L=e.get(),C=L||[],S=r(m,f).get(),z=[],O=-1,D=C.length;for(x=0;xC.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?z.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===O&&(O=_);else for(b=0;b=0;x--)C.splice(z[x],1),S&&S.splice(z[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,m),p!==o){var P;if(-1===O)P=T;else{for(D=Math.max(C.length,D),P=[],x=0;x=O);x++)P.push(_);for(x=O;x=t.data.length||a<-t.data.length)throw new Error(n+" must be valid indices for gd.data.");if(e.indexOf(a,r+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+n+" must be unique.")}}function s(t,e,n){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),l(t,e,"currentIndices"),void 0===n||Array.isArray(n)||(n=[n]),void 0!==n&&l(t,n,"newIndices"),void 0!==n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,n){var r,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),r=0;r=0&&sV.range[0]?[1,2]:[2,1]);else{var X=V.range[0],Y=V.range[1];U?(X<=0&&Y<=0&&n(R+".autorange",!0),X<=0?X=Y/1e6:Y<=0&&(Y=X/1e6),n(R+".range[0]",Math.log(X)/Math.LN10),n(R+".range[1]",Math.log(Y)/Math.LN10)):(n(R+".range[0]",Math.pow(10,X)),n(R+".range[1]",Math.pow(10,Y)))}else n(R+".autorange",!0);k.getComponentMethod("annotations","convertCoords")(t,B,L,n),k.getComponentMethod("images","convertCoords")(t,B,L,n)}else n(R+".autorange",!0);b.nestedProperty(c,R+"._inputRange").set(null)}else if(P.match(N.AX_NAME_PATTERN)){var Z=b.nestedProperty(c,A).get(),W=(L||{}).type;W&&"-"!==W||(W="linear"),k.getComponentMethod("annotations","convertCoords")(t,Z,W,n),k.getComponentMethod("images","convertCoords")(t,Z,W,n)}var $=O.containerArrayMatch(A);if($){o=$.array,i=$.index;var Q=$.property,J=b.nestedProperty(s,o),K=(J||[])[i]||{};if(""===i)-1===A.indexOf("updatemenus")&&(m.docalc=!0);else if(""===Q){var tt=L;O.isAddVal(L)?_[A]=null:O.isRemoveVal(L)?(_[A]=K,tt=K):b.warn("unrecognized full object value",e),(r(tt,"x")||r(tt,"y")&&-1===A.indexOf("updatemenus"))&&(m.docalc=!0) -}else!r(K,"x")&&!r(K,"y")||b.containsAny(A,["color","opacity","align","dash","updatemenus"])||(m.docalc=!0);d[o]||(d[o]={});var et=d[o][i];et||(et=d[o][i]={}),et[Q]=L,delete e[A]}else if("reverse"===P)F.range?F.range.reverse():(n(R+".autorange",!0),F.range=[1,0]),B.autorange?m.docalc=!0:m.doplot=!0;else{var nt=String(T.parts[1]||"");0===z.indexOf("scene")?"camera"===T.parts[1]?m.docamera=!0:m.doplot=!0:0===z.indexOf("geo")?m.doplot=!0:0===z.indexOf("ternary")?m.doplot=!0:"paper_bgcolor"===A?m.doplot=!0:"margin"===z||"autorange"===nt||"rangemode"===nt||"type"===nt||"domain"===nt||"fixedrange"===nt||"scaleanchor"===nt||"scaleratio"===nt||-1!==A.indexOf("calendar")||A.match(/^(bar|box|font)/)?m.docalc=!0:!c._has("gl2d")||-1===A.indexOf("axis")&&"plot_bgcolor"!==A?!c._has("gl2d")||"dragmode"!==A||"lasso"!==L&&"select"!==L||"lasso"===H||"select"===H?"hiddenlabels"===A?m.docalc=!0:-1!==z.indexOf("legend")?m.dolegend=!0:-1!==A.indexOf("title")?m.doticks=!0:-1!==z.indexOf("bgcolor")?m.dolayoutstyle=!0:C>1&&b.containsAny(nt,["tick","exponent","grid","zeroline"])?m.doticks=!0:-1!==A.indexOf(".linewidth")&&-1!==A.indexOf("axis")?m.doticks=m.dolayoutstyle=!0:C>1&&-1!==nt.indexOf("line")?m.dolayoutstyle=!0:C>1&&"mirror"===nt?m.doticks=m.dolayoutstyle=!0:"margin.pad"===A?m.doticks=m.dolayoutstyle=!0:-1!==["hovermode","dragmode"].indexOf(A)||-1!==A.indexOf("spike")?m.domodebar=!0:-1===["height","width","autosize"].indexOf(A)&&(m.doplot=!0):m.docalc=!0:m.doplot=!0,T.set(L)}}}for(o in d){O.applyContainerArrayChanges(t,b.nestedProperty(s,o),d[o],m)||(m.doplot=!0)}var rt=c._axisConstraintGroups;for(v in w)for(i=0;i=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function o(t,e){var n=0;return function(){if(t&&++n===e)return t()}}if(t=D.getGraphDiv(t),!b.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var i=t._transitionData;i._frameQueue||(i._frameQueue=[]),n=M.supplyAnimationDefaults(n);var l=n.transition,s=n.frame;return void 0===i._frameWaitingCnt&&(i._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(i._animationRaf),i._animationRaf=null}function f(){i._currentFrame&&i._currentFrame.onComplete&&i._currentFrame.onComplete();var e=i._currentFrame=i._frameQueue.shift();if(e){var n=e.name?e.name.toString():null;t._fullLayout._currentFrame=n,i._lastFrameAt=Date.now(),i._timeToNext=e.frameOpts.duration,M.transition(t,e.frame.data,e.frame.layout,D.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:n,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else u()}function d(){t.emit("plotly_animating"),i._lastFrameAt=-1/0,i._timeToNext=0,i._runningTransitions=0,i._currentFrame=null;var e=function(){i._animationRaf=window.requestAnimationFrame(e),Date.now()-i._lastFrameAt>i._timeToNext&&f()};e()}function h(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var p,g,v=0,m=[],y=void 0===e||null===e,x=Array.isArray(e);if(y||x||!b.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&kk)&&A.push(g);m=A}}m.length>0?function(e){if(0!==e.length){for(var l=0;l=0;a--)if(b.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,h=e[a].name;d&&h&&"number"==typeof h&&c[d]&&(r++,b.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),r>5&&b.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:M.supplyFrameDefaults(e[a]),index:n&&void 0!==n[a]&&null!==n[a]?n[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;a--){if(o=f[a].frame,"number"==typeof o.name&&b.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!o.name)for(;c[o.name="frame "+t._transitionData._counter++];);if(c[o.name]){for(i=0;i=0;n--)r=e[n],o.push({type:"delete",index:r}),i.unshift({type:"insert",index:r,value:a[r]});var l=M.modifyFrames,s=M.modifyFrames,c=[t,i],u=[t,o];return w&&w.add(t,l,c,s,u),M.modifyFrames(t,o)},x.purge=function(t){t=D.getGraphDiv(t);var e=t._fullLayout||{},n=t._fullData||[];return M.cleanPlot([],{},n,e),M.purge(t),_.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":58,"../components/errorbars":64,"../constants/xmlns_namespaces":134,"../lib":147,"../lib/events":141,"../lib/queue":159,"../lib/svg_text_utils":164,"../plotly":178,"../plots/cartesian/axis_ids":186,"../plots/cartesian/constants":188,"../plots/cartesian/constraints":190,"../plots/cartesian/graph_interact":192,"../plots/plots":212,"../plots/polar":215,"../registry":219,"./edit_types":167,"./helpers":168,"./manage_arrays":169,"./subroutines":175,d3:7,"fast-isnumeric":10,"has-hover":12}],171:[function(t,e,n){"use strict";function r(t,n){try{t._fullLayout._paper.style("background",n)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:r,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],172:[function(t,e,n){"use strict";function r(t){var e,n;"area"===t?(e={attributes:x},n={}):(e=h.modules[t]._module,n=e.basePlotModule);var r={};r.type=null,k(r,g),k(r,e.attributes),n.attributes&&k(r,n.attributes),Object.keys(h.componentsRegistry).forEach(function(e){var n=h.componentsRegistry[e];n.schema&&n.schema.traces&&n.schema.traces[t]&&Object.keys(n.schema.traces[t]).forEach(function(e){d(r,n.schema.traces[t][e],e)})}),r.type=t;var a={meta:e.meta||{},attributes:l(r)};if(e.layoutAttributes){var o={};k(o,e.layoutAttributes),a.layoutAttributes=l(o)}return a}function a(){var t={};return k(t,v),Object.keys(h.subplotsRegistry).forEach(function(e){var n=h.subplotsRegistry[e];if(n.layoutAttributes)if("cartesian"===n.name)f(t,n,"xaxis"),f(t,n,"yaxis");else{var r="subplot"===n.attr?n.name:n.attr;f(t,n,r)}}),t=u(t),Object.keys(h.componentsRegistry).forEach(function(e){var n=h.componentsRegistry[e];n.layoutAttributes&&(n.schema&&n.schema.layout?Object.keys(n.schema.layout).forEach(function(e){d(t,n.schema.layout[e],e)}):d(t,n.layoutAttributes,n.name))}),{layoutAttributes:l(t)}}function o(t){var e=h.transformsRegistry[t],n=k({},e.attributes);return Object.keys(h.componentsRegistry).forEach(function(e){var r=h.componentsRegistry[e];r.schema&&r.schema.transforms&&r.schema.transforms[t]&&Object.keys(r.schema.transforms[t]).forEach(function(e){d(n,r.schema.transforms[t][e],e)})}),{attributes:l(n)}}function i(){var t={frames:p.extendDeep({},m)};return l(t),t.frames}function l(t){return s(t),c(t),t}function s(t){function e(t){return{valType:"string"}}function r(t,r,a){n.isValObject(t)?"data_array"===t.valType?(t.role="data",a[r+"src"]=e(r)):!0===t.arrayOk&&(a[r+"src"]=e(r)):p.isPlainObject(t)&&(t.role="object")}n.crawl(t,r)}function c(t){function e(t,e,n){if(t){var r=t[A];r&&(delete t[A],n[e]={items:{}},n[e].items[r]=t,n[e].role="object")}}n.crawl(t,e)}function u(t){return w(t,{radialaxis:b.radialaxis,angularaxis:b.angularaxis}),w(t,b.layout),t}function f(t,e,n){var r=p.nestedProperty(t,n),a=k({},e.layoutAttributes);a[M]=!0,r.set(a)}function d(t,e,n){var r=p.nestedProperty(t,n);r.set(k(r.get()||{},e))}var h=t("../registry"),p=t("../lib"),g=t("../plots/attributes"),v=t("../plots/layout_attributes"),m=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),x=t("../plots/polar/area_attributes"),b=t("../plots/polar/axis_attributes"),_=t("./edit_types"),w=p.extendFlat,k=p.extendDeep,M="_isSubplotObj",A="_isLinkedToArray",T=[M,A,"_arrayAttrRegexps","_deprecated"];n.IS_SUBPLOT_OBJ=M,n.IS_LINKED_TO_ARRAY=A,n.DEPRECATED="_deprecated",n.UNDERSCORE_ATTRS=T,n.get=function(){var t={};h.allTypes.concat("area").forEach(function(e){t[e]=r(e)});var e={};return Object.keys(h.transformsRegistry).forEach(function(t){e[t]=o(t)}),{defs:{valObjects:p.valObjects,metaKeys:T.concat(["description","role"]),editTypes:{traces:_.traces(),layout:_.layout()}},traces:t,layout:a(),transforms:e,frames:i(),animation:l(y)}},n.crawl=function(t,e,r){var a=r||0;Object.keys(t).forEach(function(r){var o=t[r];-1===T.indexOf(r)&&(e(o,r,t,a),n.isValObject(o)||p.isPlainObject(o)&&n.crawl(o,e,a+1))})},n.isValObject=function(t){return t&&void 0!==t.valType},n.findArrayAttributes=function(t){function e(e,n,i,l){if(o=o.slice(0,l).concat([n]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===o[l-1]&&("ticktext"===n||"tickvals"===n))){var s=r(o),c=p.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function r(t){return t.join(".")}var a=[],o=[];if(n.crawl(g,e),t._module&&t._module.attributes&&n.crawl(t._module.attributes,e),t.transforms)for(var i=t.transforms,l=0;l=t[1]||a[1]<=t[0])&&(o[0]e[0]))return!0}return!1}function a(t,e,n){return t._anchorAxis===e&&(t.mirror||t.side===n)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+n]}function o(t,e,n){var r=[],a=e._anchorAxis;if(a){var o=a._mainAxis;if(-1===r.indexOf(o)){r.push(o);for(var i=0;i1)};d(e.width)&&d(e.height)||r(new Error("Height and width should be pixel values."));var h=s(t,{format:"png",height:e.height,width:e.width}),p=h.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var g=l.getRedrawFunc(p);o.plot(p,h.data,h.layout,h.config).then(g).then(f).then(function(t){n(t)}).catch(function(t){r(t)})})}var a=t("fast-isnumeric"),o=t("../plotly"),i=t("../lib"),l=t("../snapshot/helpers"),s=t("../snapshot/cloneplot"),c=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg");e.exports=r},{"../lib":147,"../plotly":178,"../snapshot/cloneplot":220,"../snapshot/helpers":223,"../snapshot/svgtoimg":225,"../snapshot/tosvg":227,"fast-isnumeric":10}],177:[function(t,e,n){"use strict";function r(t,e,n,a,o,c){c=c||[];for(var u=Object.keys(t),d=0;d1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=n.length,m=0;m.3*f||o(r)||o(a))){var d=n.dtick/2;t+=t+d.8){var i=Number(n.substr(1));o.exactYears>.8&&i%12==0?t=N.tickIncrement(t,"M6","reverse")+1.5*z:o.exactMonths>.8?t=N.tickIncrement(t,"M1","reverse")+15.5*z:t-=z/2;var l=N.tickIncrement(t,n);if(l<=r)return l}return t}function o(t){var e,n,r=t.tickvals,a=t.ticktext,o=new Array(r.length),i=_.simpleMap(t.range,t.r2l),l=1.0001*i[0]-1e-4*i[1],c=1.0001*i[1]-1e-4*i[0],u=Math.min(l,c),f=Math.max(l,c),d=0;Array.isArray(a)||(a=[]);var h="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),n=0;nu&&e10||"01-01"!==r.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=z&&a<=10||e>=15*z)t._tickround="d";else if(e>=D&&a<=16||e>=O)t._tickround="M";else if(e>=P&&a<=19||e>=D)t._tickround="S";else{var o=t.l2r(n+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(x(e)||"L"===e.charAt(0)){var i=t.range.map(t.r2d||Number);x(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(i[0]),Math.abs(i[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function s(t,e,n){var r=t.tickfont||{};return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}function c(t,e,n,r){var a=t._tickround,o=n&&t.hoverformat||t.tickformat;r&&(a=x(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var i,l=_.formatDate(e.x,o,a,t.calendar),s=l.indexOf("\n");-1!==s&&(i=l.substr(s+1),l=l.substr(0,s)),r&&("00:00:00"===l||"00:00"===l?(l=i,i=""):8===l.length&&(l=l.replace(/:00$/,""))),i&&(n?"d"===a?l+=", "+i:l=i+(l?", "+l:""):t._inCalcTicks&&i===t._prevDateHead||(l+="
"+i,t._prevDateHead=i)),e.text=l}function u(t,e,n,r,a){var o=t.dtick,i=e.x;if(!r||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=h(Math.pow(10,i),t,a,r);else if(x(o)||"D"===o.charAt(0)&&_.mod(i+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var l=Math.round(i);e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10\u2212"+-l+"",e.fontSize*=1.25}else e.text=h(Math.pow(10,i),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,_.mod(i,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(i<0?.5:.25)))}}function f(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n=""),e.text=String(n)}function d(t,e,n,r,a){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=h(e.x,t,a,r)}function h(t,e,n,r){var a=t<0,o=e._tickround,i=n||e.exponentformat||"B",s=e._tickexponent,c=e.tickformat,u=e.separatethousands;if(r){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};l(f),o=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var d=Math.pow(10,-o)/2;if("none"===i&&(s=0),(t=Math.abs(t))12||s<-15)?t+="e"+g:"E"===i?t+="E"+g:"power"===i?t+="\xd710"+g+"":"B"===i&&9===s?t+="B":"SI"!==i&&"B"!==i||(t+=U[s/3+5])}return a?"\u2212"+t:t}function p(t,e){var n,r,a=[];for(n=0;n1)for(r=1;r2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},N.getAutoRange=function(t){var e,n=[],r=t._min[0].val,a=t._max[0].val;for(e=1;e0&&u>0&&f/u>d&&(s=i,c=l,d=f/u);if(r===a){var g=r-1,v=r+1;n="tozero"===t.rangemode?r<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),n=[s.val-d*s.pad,c.val+d*c.pad]);return n[0]===n[1]&&("tozero"===t.rangemode?n=n[0]<0?[n[0],0]:n[0]>0?[0,n[0]]:[0,1]:(n=[n[0]-1,n[0]+1],"nonnegative"===t.rangemode&&(n[0]=Math.max(0,n[0])))),h&&n.reverse(),_.simpleMap(n,t.l2r||Number)},N.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=N.getAutoRange(t),t._r=t.range.slice(),t._rl=_.simpleMap(t._r,t.r2l);var n=t._input;n.range=t.range.slice(),n.autorange=t.autorange}},N.saveRangeInitial=function(t,e){for(var n=N.list(t,"",!0),r=!1,a=0;a=d?h=!1:l.val>=c&&l.pad<=d&&(t._min.splice(i,1),i--);h&&t._min.push({val:c,pad:y&&0===c?0:d})}if(r(u)){for(h=!0,i=0;i=u&&l.pad>=f?h=!1:l.val<=u&&l.pad<=f&&(t._max.splice(i,1),i--);h&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||!!_.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),n||(n={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,v=e.length,m=n.padded?.05*t._length:0,y=n.tozero&&("linear"===t.type||"-"===t.type);m&&"domain"===t.constrain&&t._inputDomain&&(m*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var b=r((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),w=r((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),k=r(n.vpadplus||n.vpad),M=r(n.vpadminus||n.vpad);for(o=0;o<6;o++)a(o);for(o=v-1;o>5;o--)a(o)}},N.autoBin=function(t,e,n,o,i){var l=_.aggNums(Math.min,null,t),s=_.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1};var c;if(n)c=(s-l)/n;else{var u=_.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*_.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*_.stdev(t)/Math.pow(t.length,o?.25:.4)),x(c)||(c=1)}var h;h="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:_.simpleMap([l,s],e.c2r,0,i),calendar:i},N.setConvert(h),N.autoTicks(h,c);var p,g=N.tickIncrement(N.tickFirst(h),h.dtick,"reverse",i);if("number"==typeof h.dtick){g=r(g,t,h,l,s);p=g+(1+Math.floor((s-g)/h.dtick))*h.dtick}else for("M"===h.dtick.charAt(0)&&(g=a(g,t,h.dtick,l,i)),p=g;p<=s;)p=N.tickIncrement(p,h.dtick,!1,i);return{start:e.c2r(g,0,i),end:e.c2r(p,0,i),size:h.dtick}},N.calcTicks=function(t){var e=_.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var n,r=t.nticks;r||("category"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/n):(n="y"===t._id.charAt(0)?40:80,r=_.constrain(t._length/n,4,9)+1)),"array"===t.tickmode&&(r*=100),N.autoTicks(t,Math.abs(e[1]-e[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),l(t),"array"===t.tickmode)return o(t);t._tmin=N.tickFirst(t);var a=e[1]=s:f<=s)&&!(i.length>u||f===c);f=N.tickIncrement(f,t.dtick,a,t.calendar))c=f,i.push(f);t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(i.length),h=0;hC?(e/=C,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,n,F)):r>S?(e/=S,t.dtick="M"+i(e,1,j)):r>z?(t.dtick=i(e,z,H),t.tick0=_.dateTick0(t.calendar,!0)):r>O?t.dtick=i(e,O,j):r>D?t.dtick=i(e,D,B):r>P?t.dtick=i(e,P,B):(n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,n,F))}else if("log"===t.type){t.tick0=0;var a=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var o=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/o,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,n,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,n,F));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},N.tickIncrement=function(t,e,n,r){var a=n?-1:1;if(x(e))return t+a*e;var o=e.charAt(0),i=a*Number(e.substr(1));if("M"===o)return _.incrementMonth(t,i,r);if("L"===o)return Math.log(Math.pow(10,t)+i)/Math.LN10;if("D"===o){var l="D2"===e?V:q,s=t+.01*a,c=_.roundUp(_.mod(s,1),l,n);return Math.floor(s)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},N.tickFirst=function(t){var e=t.r2l||Number,n=_.simpleMap(t.range,e),r=n[1]1&&e2*a}function o(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,a=0,o=0;o2*r}var i=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":o(t)?"category":r(t)?"linear":"-"}},{"../../constants/numerical":132,"../../lib":147,"fast-isnumeric":10}],185:[function(t,e,n){"use strict";var r=t("tinycolor2").mix,a=t("../../registry"),o=t("../../lib"),i=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),h=t("./ordered_categories");e.exports=function(t,e,n,p,g){function v(n,r){return o.coerce2(t,e,l,n,r)}var m=p.letter,y=p.font||{},x="Click to enter "+(p.title||m.toUpperCase()+" axis")+" title",b=n("visible",!p.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(d(e,g),n("autorange",!e.isValidRange(t.range))&&n("rangemode"),n("range"),e.cleanRange(),f(t,e,n),e._initialCategories="category"===_?h(m,e.categoryorder,e.categoryarray,p.data):[],!b)return e;var w=n("color"),k=w===t.color?w:y.color;n("title",x),o.coerceFont(n,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:k}),s(t,e,n,_),u(t,e,n,_,p),c(t,e,n,p);var M=v("linecolor",w),A=v("linewidth"),T=n("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&n("mirror");var L=v("gridcolor",r(w,p.bgColor,i).toRgbString()),C=v("gridwidth");n("showgrid",p.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),z=v("zerolinewidth");return n("zeroline",p.showGrid||!!S||!!z)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":33,"../../lib":147,"../../registry":219,"./category_order_defaults":187,"./layout_attributes":194,"./ordered_categories":196,"./set_convert":200,"./tick_label_defaults":201,"./tick_mark_defaults":202,"./tick_value_defaults":203,tinycolor2:16}],186:[function(t,e,n){"use strict";function r(t,e,n){function r(t,n){for(var r=Object.keys(t),a=/^[xyz]axis[0-9]*/,o=[],i=0;i0;o&&(r="array");var i=n("categoryorder",r);"array"===i&&n("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],188:[function(t,e,n){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{}],189:[function(t,e,n){"use strict";function r(t,e,n,r){var a,o,l,s,c=r[i(e)].type,u=[];for(o=0;oi*m)||_)for(n=0;nO&&PS&&(S=P);var I=(S-C)/(2*z);f/=I,C=s.l2r(C),S=s.l2r(S),s.range=s._input.range=A=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,n,r,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+n+", "+r+")").attr("d",a+"Z")}function f(t,e,n){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+n+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function h(t,e,n,r,a,o){t.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),a||(t.transition().style("fill",o>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-F-.5)+"h-3v"+(2*F+1)+"h3ZM"+(t.r+.5)+","+(e-F-.5)+"h3v"+(2*F+1)+"h-3Z"}function m(t,e){return"M"+(e-F-.5)+","+(t.t-.5)+"v-3h"+(2*F+1)+"v3ZM"+(e-F-.5)+","+(t.b+.5)+"v3h"+(2*F+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,F)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,n){var r,a,o,i,l,s,c=!1,u={},f={};for(r=0;rF||l>F?(Mt="xy",i/ot>l/it?(l=i*it/ot,xt>o?bt.t=xt-l:bt.b=xt+l):(i=l*ot/it,yt>a?bt.l=yt-i:bt.r=yt+i),Tt.attr("d",y(bt))):r():!st||lzoom back out","long"),j=!1)}function Y(e,n){var r=1===(H+q).length;if(e)J();else if(2!==n||r){if(1===n&&r){var a=H?nt[0]:et[0],i="s"===H||"w"===q?0:1,l=a._name+".range["+i+"]",s=o(a,i),c="left",u="middle";if(a.fixedrange)return;H?(u="n"===H?"top":"bottom","right"===a.side&&(c="right")):"e"===q&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:ht.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var n=a.d2r(e);void 0!==n&&w.relayout(t,l,n)})}}else Q()}function Z(e){function n(t,e,n){function r(e){return t.l2r(o+(e-o)*n)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),o=a[0]+(a[1]-a[0])*e;t.range=a.map(r)}}if(t._context.scrollZoom||ht._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var r=t.querySelector(".plotly");if(V(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(St);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/100),l=Ot.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(q||ut){for(q||(s=.5),o=0;o rect").call(L.setTranslate,l,s).call(L.setScale,o,i);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(L.setTranslate,b,_).call(L.setScale,1/o,1/i),w.selectAll(".point").call(L.setPointGroupScale,o,i).call(L.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(L.setTextPointsScale,o,i).call(L.hideOutsideRangePoints,g)}}}var tt,et,nt,rt,at,ot,it,lt,st,ct,ut,ft,dt,ht=t._fullLayout,pt=t._fullLayout._zoomlayer,gt=H+q==="nsew";V();var vt=r(e,H+q+"drag",ct,n,T,C,B);if(!st&&!lt&&!g(ht.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var mt={element:vt,gd:t,plotinfo:e,prepFn:function(e,n,r){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",mt.minDrag="lasso"===a?1:void 0,"zoom"===a?(mt.moveFn=G,mt.doneFn=X,mt.minDrag=1,U(e,n,r)):"pan"===a?(mt.moveFn=W,mt.doneFn=Y,d(pt)):g(a)&&(mt.xaxes=et,mt.yaxes=nt,E(e,n,r,mt,a))}};S.init(mt);var yt,xt,bt,_t,wt,kt,Mt,At,Tt,Lt={},Ct=[0,0,ot,it],St=null,zt=I.REDRAWDELAY,Ot=e.mainplot?ht._plots[e.mainplot]:e;return H.length*q.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Z:void 0!==vt.onmousewheel&&(vt.onmousewheel=Z)),vt}},{"../../components/color":34,"../../components/dragelement":55,"../../components/drawing":58,"../../constants/alignment":130,"../../lib":147,"../../lib/setcursor":162,"../../lib/svg_text_utils":164,"../../plotly":178,"../../registry":219,"../plots":212,"./axes":183,"./axis_ids":186,"./constants":188,"./scale_zoom":198,"./select":199,d3:7,tinycolor2:16}],192:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../components/fx"),o=t("../../components/dragelement"),i=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,n){if((e._plots[t].mainplot&&!0)===(e._plots[n].mainplot&&!0)){var r=t.split("y"),a=n.split("y");return r[0]===a[0]?Number(r[1]||1)-Number(a[1]||1):Number(r[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(n){var s=e._plots[n],c=s.xaxis,u=s.yaxis,f=(c._linepositions[n]||[])[3],d=(u._linepositions[n]||[])[3],h=i.DRAGGERSIZE;if(r(f)&&"top"===c.side&&(f-=h),r(d)&&"right"!==u.side&&(d-=h),!s.mainplot){var p=l(t,s,0,0,c._length,u._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===n&&a.hover(t,e,n)},a.hover(t,e,n),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=n},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},p.onclick=function(e){a.click(t,e,n)},t._context.showAxisDragHandles&&(l(t,s,-h,-h,h,h,"n","w"),l(t,s,c._length,-h,h,h,"n","e"),l(t,s,-h,u._length,h,h,"s","w"),l(t,s,c._length,u._length,h,h,"s","e"))}t._context.showAxisDragHandles&&(r(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,h,"","ew"),l(t,s,0,f,.1*c._length,h,"","w"),l(t,s,.9*c._length,f,.1*c._length,h,"","e")),r(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,h,.8*u._length,"ns",""),l(t,s,d,.9*u._length,h,.1*u._length,"s",""),l(t,s,d,0,h,.1*u._length,"n","")))});var n=e._hoverlayer.node();n.onmousemove=function(n){n.target=e._lasthover,a.hover(t,n,e._hoversubplot)},n.onclick=function(n){n.target=e._lasthover,a.click(t,n)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":55,"../../components/fx":75,"./constants":188,"./dragbox":191,"fast-isnumeric":10}],193:[function(t,e,n){"use strict";function r(t,e,n,r,a){var o=t._fullLayout,i=o._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;lu[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{"../../lib":147,"fast-isnumeric":10}],198:[function(t,e,n){"use strict";var r=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],o=a[0]+(a[1]-a[0])*n;t.range=t._input.range=[t.l2r(o+(a[0]-o)*e),t.l2r(o+(a[1]-o)*e)]}},{"../../constants/alignment":130}],199:[function(t,e,n){"use strict";function r(t){return t._id}function a(t,e){if(Array.isArray(t))for(var n=e.cd[0].trace,r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&n&&t.range&&2===t.range.length){var r=t.range[0],a=t.range[1];return.5*(r+a-3*k*Math.abs(r-a))}return h}function f(e,n,r){var a=c(e,r||t.calendar);if(a===h){if(!o(e))return h;a=c(new Date(+e))}return a}function v(e,n,r){return s(e,n,r||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return h}function x(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(o(e))return+e}function b(e){return o(e)?a.round(t._b+t._m*e,2):h}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?n:u,t.l2c="log"===t.type?r:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(n(t,e))}:b,t.p2c="log"===t.type?function(t){return r(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return n(l(t),e)},t.r2d=t.r2c=function(t){return r(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=n,t.l2d=r,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return r(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,n,r){return t.l2p(f(e,0,r))},t.p2d=t.p2r=function(t,e,n){return v(_(t),e,n)},t.cleanPos=function(e){return i.cleanDate(e,h,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var n=x(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return m(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e){e||(e="range");var n,r,a=i.nestedProperty(t,e).get();if(r="date"===t.type?i.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,r=r.slice(),!a||2!==a.length)return void i.nestedProperty(t,e).set(r);for("date"===t.type&&(a[0]=i.cleanDate(a[0],h,t.calendar),a[1]=i.cleanDate(a[1],h,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(a[n],t.calendar)){t[e]=r;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=i.constrain(t.r2l(a[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!o(a[n])){if(!o(a[1-n])){t[e]=r;break}a[n]=a[1-n]*(n?10:.1)}if(a[n]<-d?a[n]=-d:a[n]>d&&(a[n]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(n){var r=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=n&&t._r?"_r":"range",l=t.calendar;t.cleanRange(o);var s=t.r2l(t[o][0],l),c=t.r2l(t[o][1],l);if("y"===w?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw i.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,n){var r,a,o,i="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],a=new Array(r.length),o=0;o=t.range[0]&&n<=t.range[1]}:function(e){var n=e.y;return n>=t.range[0]&&n<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":132,"../../lib":147,"./axis_ids":186,"./constants":188,d3:7,"fast-isnumeric":10}],201:[function(t,e,n){"use strict";function r(t){var e=["showexponent","showtickprefix","showticksuffix"],n=e.filter(function(e){return void 0!==t[e]}),r=function(e){return t[e]===t[n[0]]};if(n.every(r)||1===n.length)return t[n[0]]}var a=t("../../lib");e.exports=function(t,e,n,o,i){var l=r(t);if(n("tickprefix")&&n("showtickprefix",l),n("ticksuffix")&&n("showticksuffix",l),n("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(n,"tickfont",{family:s.family,size:s.size,color:c}),n("tickangle"),"category"!==o&&(n("tickformat")||"date"===o||(n("showexponent",l),n("exponentformat"),n("separatethousands")))}"category"===o||i.noHover||n("hoverformat")}},{"../../lib":147}],202:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,n,o){var i=r.coerce2(t,e,a,"ticklen"),l=r.coerce2(t,e,a,"tickwidth"),s=r.coerce2(t,e,a,"tickcolor",e.color);n("ticks",o.outerTicks||i||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":147,"./layout_attributes":194}],203:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,n,i){var l="auto";"array"!==t.tickmode||"log"!==i&&"date"!==i||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=n("tickmode",l);if("auto"===s)n("nticks");else if("linear"===s){var c="date"===i?o:1,u=n("dtick",c);if(r(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=r(d)?Number(d):0,(d<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var h="date"===i?a.dateTick0(e.calendar):0,p=n("tick0",h);"date"===i?e.tick0=a.cleanDate(p,h):r(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=h}else{var g=n("tickvals");void 0===g?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":132,"../../lib":147,"fast-isnumeric":10}],204:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,n,c){function u(e,n){function r(e,n,r){for(a=0;a rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,n._offset).call(i.setScale,1,1);var r=t.plot.select(".scatterlayer").selectAll(".points");r.selectAll(".point").call(i.setPointGroupScale,1,1).call(i.hideOutsideRangePoints,t),r.selectAll(".textpoint").call(i.setTextPointsScale,1,1).call(i.hideOutsideRangePoints,t)}function d(e,n){var r,a,o,l=y[e.xaxis._id],s=y[e.yaxis._id],c=[];if(l){r=t._fullLayout[l.axisName],a=r._r,o=l.to,c[0]=(a[0]*(1-n)+n*o[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=o[1]-o[0];r.range[0]=a[0]*(1-n)+n*o[0],r.range[1]=a[1]*(1-n)+n*o[1],c[2]=e.xaxis._length*(1-n+n*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){r=t._fullLayout[s.axisName],a=r._r,o=s.to,c[1]=(a[1]*(1-n)+n*o[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var h=a[1]-a[0],p=o[1]-o[0];r.range[0]=a[0]*(1-n)+n*o[0],r.range[1]=a[1]*(1-n)+n*o[1],c[3]=e.yaxis._length*(1-n+n*p/h)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,m=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?m._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*m._length:0,L=g._offset-A,C=m._offset-T;v._defs.select("#"+e.clipId+"> rect").call(i.setTranslate,k,M).call(i.setScale,1/_,1/w),e.plot.call(i.setTranslate,L,C).call(i.setScale,_,w).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/_,1/w)}function h(){for(var e={},n=0;nn.duration?(h(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,m=[],y=function(t){var e,n,r,a,o,i={};for(e in t)if(n=e.split("."),r=n[0].match(s)){var l=r[1],c=l+"axis";if(a=v[c],o={},Array.isArray(t[e])?o.to=t[e].slice(0):Array.isArray(t[e].range)&&(o.to=t[e].range.slice(0)),!o.to)continue;o.axisName=c,o.length=a._length,m.push(l),i[l]=o}return i}(e),x=Object.keys(y),b=function(t,e,n){var r,a,o,i=t._plots,l=[];for(r in i){var s=i[r];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=n[c]?n[c].to:f,o=n[u]?n[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,y);if(!b.length)return function(){function e(e,n,r){for(var a=0;a0?".":"")+a;c.isPlainObject(o)?l(o,e,i,r+1):e(i,a,o)}})}var s=t("../plotly"),c=t("../lib");n.manageCommandObserver=function(t,e,a,o){var i={},l=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var s=n.hasSimpleAPICommandBindings(t,a,i.lookupTable);if(e&&e._commandObserver){if(s)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(s){r(t,s,i.cache),i.check=function(){if(l){var e=r(t,s,i.cache);return e.changed&&o&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(o({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),n.attr(o);var i=n.select(".js-link-to-tool"),l=n.select(".js-link-spacer"),c=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&r(t,i),l.text(i.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=s.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return r.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},o=t.layout||{},i=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),n._initialAutoSizeIsDone){var c=n.width,f=n.height;v.supplyLayoutGlobalDefaults(o,r),o.width||(r.width=c),o.height||(r.height=f)}else{v.supplyLayoutGlobalDefaults(o,r);var d=!o.width||!o.height,h=r.autosize,p=t._context&&t._context.autosizable;d&&(h||p)?v.plotAutoSize(t,o,r):d&&v.sanitizeMargins(t),!h&&d&&(o.width=r.width,o.height=r.height)}r._initialAutoSizeIsDone=!0,r._dataLength=s.length,r._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,o,r),r._has=v._hasPlotType.bind(r);var g=r._modules;for(e=0;e0){var u=i(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,p=1-2*l,g=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(p*(g.width-f)),a=Math.round(p*(g.height-d))}else{var m=s?window.getComputedStyle(t):{};r=parseFloat(m.width)||n.width,a=parseFloat(m.height)||n.height}var y=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;r1,_=!e.height&&Math.abs(n.height-a)>1;(_||b)&&(b&&(n.width=r),_&&(n.height=a)),t._initialAutoSize||(t._initialAutoSize={width:r,height:a}),v.sanitizeMargins(n)},v.supplyLayoutModuleDefaults=function(t,e,n,r){var a,o;u.Axes.supplyLayoutDefaults(t,e,n);var i=e._basePlotModules;for(a=0;a.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+a},r:{val:n.x,size:n.r+a},b:{val:n.y,size:n.b+a},t:{val:n.y,size:n.t+a}}}else delete r._pushmargin[e];r._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;dv){var M=(m*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(m-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+o&&(a=M,o=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>y){var C=(x*T+(L-e.height)*y)/(T-y),S=(L*(1-y)+(x-e.height)*(1-T))/(T-y);C>=0&&S>=0&&C+S>l+i&&(l=C,i=S)}}}}if(n.l=Math.round(a),n.r=Math.round(o),n.t=Math.round(i),n.b=Math.round(l),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!e._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,n,r,a){function o(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,r,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if("string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0&&!h.isPlainObject(t.stream))continue}else if("keepall"!==n&&"string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0)continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):h.isJSDate(t)?h.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(i||[]).map(function(t){var n=o(t);return e&&delete n.fit,n})};return e||(c.layout=o(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=o(s)),"object"===r?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var n,r,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var i,l,s=0,c=0,d=t._fullLayout._basePlotModules,p=!1;if(n)for(l=0;l=0,S=C?d.angularAxis.domain:r.extent(M),z=Math.abs(M[1]-M[0]);T&&!A&&(z=0);var O=S.slice();L&&A&&(O[1]+=z);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(O[1]-O[0])/D);var P=d.angularAxis.ticksStep||(O[1]-O[0])/(D*(d.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),O[2]||(O[2]=P);var E=r.range.apply(this,O);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=r.scale.linear().domain(O.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?z:0,void 0===(e=r.select(this).select("svg.chart-root"))||e.empty()){var N=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),I=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=r.select(I)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var H=p.map(function(t,e){var n=l.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});l.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},l.Legend.defaultConfig().legendConfig,{container:R,elements:H,reverseOrder:d.legend.reverseOrder})})();var q=R.node().getBBox();b=Math.min(d.width-q.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(q?q.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var X=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(a.ticks(5));Y.enter().append("circle").attr({class:"grid-circle"}).style(j),Y.attr("r",a),Y.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(j);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=r.svg.axis().scale(a).ticks(5).tickSize(5);X.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),X.selectAll(".domain").style(j),X.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var $=e.select(".angular.axis-group").selectAll("g.angular-tick").data(E),Q=$.enter().append("g").classed("angular-tick",!0);$.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),$.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(j),Q.selectAll(".minor").style({stroke:d.minorTickColor}),$.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(B);var J=$.select("text.axis-text").attr({x:b+d.labelOffset,dy:i+"em",transform:function(t,e){var n=c(t,e),r=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-n+" "+r+" 0)":"radial"==a?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":k?k[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(B);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var K=r.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));R.attr({transform:"translate("+[b+K,d.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var nt=[];p.forEach(function(t,e){var n={};n.radialScale=a,n.angularScale=s,n.container=et.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,nt.push({data:t,geometryConfig:n})});var rt=r.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(nt),at=[];rt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return o(l[n].defaultConfig(),t)});l[n]().config(r)()})}var ot,it,lt=e.select(".guides-group"),st=e.select(".tooltips-group"),ct=l.tooltipPanel().config({container:st,fontSize:8})(),ut=l.tooltipPanel().config({container:st,fontSize:8})(),ft=l.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var n=l.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-d.orientation)%360;ot=s.invert(r);var a=l.util.convertToCartesian(b+12,n+180);ct.text(l.util.round(ot)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var ht=lt.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=l.util.getMousePos(Z).radius;ht.attr({r:n}).style({opacity:.5}),it=a.invert(l.util.getMousePos(Z).radius);var r=l.util.convertToCartesian(n,d.radialAxis.orientation);ut.text(l.util.round(it)).move([r[0]+w[0],r[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var a=r.select(this),o=a.style("fill"),i="black",s=a.style("opacity")||1;if(a.attr({"data-opacity":s}),"none"!=o){a.attr({"data-fill":o}),i=r.hsl(o).darker().toString(),a.style({fill:i,opacity:1});var c={t:l.util.round(t[0]),r:l.util.round(t[1])};A&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-V[0]-d.left,f.top+f.height/2-V[1]-d.top];ft.config({color:i}).text(u),ft.move(h)}else o=a.style("stroke"),a.attr({"data-stroke":o}),i=r.hsl(o).darker().toString(),a.style({stroke:i,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=r.event.which)return!1;r.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var n=r.select(this),a=n.attr("data-fill");a?n.style({fill:a,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),h}var e,n,a,s,c={data:[],layout:{}},u={},f={},d=r.dispatch("hover"),h={};return h.render=function(e){return t(e),this},h.config=function(t){if(!arguments.length)return c;var e=l.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),o(c.data[e],l.Axis.defaultConfig().data[0]),o(c.data[e],t)}),o(c.layout,l.Axis.defaultConfig().layout),o(c.layout,e.layout),this},h.getLiveConfig=function(){return f},h.getinputConfig=function(){return u},h.radialScale=function(t){return a},h.angularScale=function(t){return s},h.svg=function(){return e},r.rebind(h,d,"on"),h},l.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:r.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},l.util={},l.DATAEXTENT="dataExtent",l.AREA="AreaChart",l.LINE="LinePlot",l.DOT="DotPlot",l.BAR="BarChart",l.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},l.util._extend=function(t,e){for(var n in t)e[n]=t[n]},l.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},l.util.dataFromEquation2=function(t,e){var n=e||6;return r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180;return[e,t(r)]})},l.util.dataFromEquation=function(t,e,n){var a=e||6,o=[],i=[];r.range(0,360+a,a).forEach(function(e,n){var r=e*Math.PI/180,a=t(r);o.push(e),i.push(a)});var l={t:o,r:i};return n&&(l.name=n),l},l.util.ensureArray=function(t,e){if(void 0===t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},l.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=l.util.ensureArray(t[e],n)}),t},l.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},l.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},l.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},l.util.arrayLast=function(t){return t[t.length-1]},l.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},l.util.flattenArray=function(t){for(var e=[];!l.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},l.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})}, -l.util.convertToCartesian=function(t,e){var n=e*Math.PI/180;return[t*Math.cos(n),t*Math.sin(n)]},l.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},l.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],a=e[1],o={};return o.x=n,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+a*a),o},l.util.duplicatesCount=function(t){for(var e,n={},r={},a=0,o=t.length;a0)){var l=r.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(i),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(n,a,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(n,a,o)},"stroke-width":function(t,e){return v["stroke-width"](n,a,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](n,a,o)},opacity:function(t,e){return v.opacity(n,a,o)},display:function(t,e){return v.display(n,a,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=r.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,n,a){r.select(this).attr({class:"mark arc",d:g,transform:function(e,n){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return a[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return void 0===e[r].data.visible||e[r].data.visible?"block":"none"}},m=r.select(this).selectAll("g.layer").data(s);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e=[l.PolyChart.defaultConfig()],n=r.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,n){e[n]||(e[n]={}),o(e[n],l.PolyChart.defaultConfig()),o(e[n],t)}),this):e},t.getColorScale=function(){},r.rebind(t,n,"on"),t},l.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:r.scale.category20()}}},l.BarChart=function(){return l.PolyChart()},l.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},l.AreaChart=function(){return l.PolyChart()},l.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},l.DotPlot=function(){return l.PolyChart()},l.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},l.LinePlot=function(){return l.PolyChart()},l.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},l.Legend=function(){function t(){var n=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var a=o({},n.elements[e]);return a.name=t,a.color=[].concat(n.elements[e].color)[r],a})}),i=r.merge(a);i=i.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||void 0===n.elements[e].visibleInLegend)}),n.reverseOrder&&(i=i.reverse());var l=n.container;("string"==typeof l||l.nodeName)&&(l=r.select(l));var s=i.map(function(t,e){return t.color}),c=n.fontSize,u=null==n.isContinuous?"number"==typeof i[0]:n.isContinuous,f=u?n.height:c*i.length,d=l.classed("legend-group",!0),h=d.selectAll("svg").data([0]),p=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=r.range(i.length),v=r.scale[u?"linear":"ordinal"]().domain(g).range(s),m=r.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=r.svg.symbolTypes.indexOf(t)?r.svg.symbol().type(t).size(n)():r.svg.symbol().type("square").size(n)()};if(u){var x=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:n.height,width:n.colorBandWidth,fill:"url(#grad1)"})}else{var b=h.select(".legend-marks").selectAll("path.legend-mark").data(i);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var n=t.symbol;return y(n,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=r.svg.axis().scale(m).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?n.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?n.textColor:"none"}),w.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return i[e].name}),t}var e=l.Legend.defaultConfig(),n=r.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},r.rebind(t,n,"on"),t},l.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},l.tooltipPanel=function(){var t,e,n,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},i="tooltip-"+l.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+i).data([0]);var r=t.enter().append("g").classed(i,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:a.padding+10,dy:.3*+a.fontSize}),s};return s.text=function(o){var i=r.hsl(a.color).l,l=i>=.5?"#aaa":"white",c=i>=.5?"black":"white",u=o||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),h={fill:a.color,stroke:l,"stroke-width":"2px"},p=d.width+2*f+10,g=d.height+2*f;return n.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return o(a,t),s},s},l.tooltipPanel.uid=1,l.adapter={},l.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=o({},t);return[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]].forEach(function(t,n){l.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",!0===r.dotVisible?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=l.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=a.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var i=o({},t.layout);if([[i,["plot_bgcolor"],["backgroundColor"]],[i,["showlegend"],["showLegend"]],[i,["radialaxis"],["radialAxis"]],[i,["angularaxis"],["angularAxis"]],[i.angularaxis,["showline"],["gridLinesVisible"]],[i.angularaxis,["showticklabels"],["labelsVisible"]],[i.angularaxis,["nticks"],["ticksCount"]],[i.angularaxis,["tickorientation"],["tickOrientation"]],[i.angularaxis,["ticksuffix"],["ticksSuffix"]],[i.angularaxis,["range"],["domain"]],[i.angularaxis,["endpadding"],["endPadding"]],[i.radialaxis,["showline"],["gridLinesVisible"]],[i.radialaxis,["tickorientation"],["tickOrientation"]],[i.radialaxis,["ticksuffix"],["ticksSuffix"]],[i.radialaxis,["range"],["domain"]],[i.angularAxis,["showline"],["gridLinesVisible"]],[i.angularAxis,["showticklabels"],["labelsVisible"]],[i.angularAxis,["nticks"],["ticksCount"]],[i.angularAxis,["tickorientation"],["tickOrientation"]],[i.angularAxis,["ticksuffix"],["ticksSuffix"]],[i.angularAxis,["range"],["domain"]],[i.angularAxis,["endpadding"],["endPadding"]],[i.radialAxis,["showline"],["gridLinesVisible"]],[i.radialAxis,["tickorientation"],["tickOrientation"]],[i.radialAxis,["ticksuffix"],["ticksSuffix"]],[i.radialAxis,["range"],["domain"]],[i.font,["outlinecolor"],["outlineColor"]],[i.legend,["traceorder"],["reverseOrder"]],[i,["labeloffset"],["labelOffset"]],[i,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,n){l.util.translator.apply(null,t.concat(e))}),e?(void 0!==i.tickLength&&(i.angularaxis.ticklen=i.tickLength,delete i.tickLength),i.tickColor&&(i.angularaxis.tickcolor=i.tickColor,delete i.tickColor)):(i.angularAxis&&void 0!==i.angularAxis.ticklen&&(i.tickLength=i.angularAxis.ticklen),i.angularAxis&&void 0!==i.angularAxis.tickcolor&&(i.tickColor=i.angularAxis.tickcolor)),i.legend&&"boolean"!=typeof i.legend.reverseOrder&&(i.legend.reverseOrder="normal"!=i.legend.reverseOrder),i.legend&&"boolean"==typeof i.legend.traceorder&&(i.legend.traceorder=i.legend.traceorder?"reversed":"normal",delete i.legend.reverseOrder),i.margin&&void 0!==i.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};r.entries(i.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),i.margin=u}e&&(delete i.needsEndSpacing,delete i.minorTickColor,delete i.minorTicks,delete i.angularaxis.ticksCount,delete i.angularaxis.ticksCount,delete i.angularaxis.ticksStep,delete i.angularaxis.rewriteTicks,delete i.angularaxis.nticks,delete i.radialaxis.ticksCount,delete i.radialaxis.ticksCount,delete i.radialaxis.ticksStep,delete i.radialaxis.rewriteTicks,delete i.radialaxis.nticks),n.layout=i}return n},t}},{"../../constants/alignment":130,"../../lib":147,d3:7}],217:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../../components/color"),i=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,a){return a&&(f=a),r.select(r.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),n=n?s(n,e):e,o||(o=i.Axis()),u=i.adapter.plotly().convert(n),o.config(u).render(f),t.data=n.data,t.layout=n.layout,c.fillLayout(t),n}var n,a,o,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return o.svg()},e.getConfig=function(){return n},e.getLiveConfig=function(){return i.adapter.plotly().convert(o.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:o.angularScale(),r:o.radialScale()}},e.setUndoPoint=function(){var t=this,e=i.util.cloneJson(n);!function(e,n){d.add({undo:function(){n&&t(n)},redo:function(){t(e)}})}(e,a),a=i.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},c.fillLayout=function(t){var e=r.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:n,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../components/color":34,"../../lib":147,"./micropolar":216,"./undo_manager":218,d3:7}],218:[function(t,e,n){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,n=[],r=-1,a=!1;return{add:function(t){return a?this:(n.splice(r+1,n.length-r),n.push(t),r=n.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=n[r];return a?(t(a,"undo"),r-=1,e&&e(a.undo),this):this},redo:function(){var a=n[r+1];return a?(t(a,"redo"),r+=1,e&&e(a.redo),this):this},clear:function(){n=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r-1}var o=t("../lib"),i=t("../plots/plots"),l=o.extendFlat,s=o.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,o=t.data,c=t.layout,u=s([],o),f=s({},c,r(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(n=0;n")?"":e.html(t).text()});return e.remove(),n}function a(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var o=t("d3"),i=t("../components/drawing"),l=t("../components/color"),s=t("../constants/xmlns_namespaces"),c=/"/g,u=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e){var n,f=t._fullLayout,d=f._paper,h=f._toppaper;d.insert("rect",":first-child").call(i.setRect,0,0,f.width,f.height).call(l.fill,f.paper_bgcolor);var p=f._basePlotModules||[];for(n=0;n0&&A>0,j=k<=I&&A<=R,B=k<=R&&A<=I,H="h"===m?I>=k*(R/A):R>=A*(I/k);F&&(j||B||H)?x="inside":(x="outside",b.remove(),b=null)}else x="inside" -;if(!b&&(b=g(e,y,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var q;q="outside"===x?o(i,d,h,p,_,m):a(i,d,h,p,_,m),b.attr("transform",q)}}}function a(t,e,n,r,a,o){var l,s,c,u,f,d=a.width,h=a.height,p=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),m=Math.abs(r-n);v>2*D&&m>2*D?(f=D,v-=2*f,m-=2*f):f=0;var y,x;return d<=v&&h<=m?(y=!1,x=1):d<=m&&h<=v?(y=!0,x=1):dn?(c=(t+e)/2,u=r-f-s/2):(c=(t+e)/2,u=r+f+s/2),i(p,g,c,u,x,y)}function o(t,e,n,r,a,o){var l,s="h"===o?Math.abs(r-n):Math.abs(e-t);s>2*D&&(l=D,s-=2*l);var c,u,f,d,h="h"===o?Math.min(1,s/a.height):Math.min(1,s/a.width),p=(a.left+a.right)/2,g=(a.top+a.bottom)/2;return c=h*a.width,u=h*a.height,"h"===o?en?(f=(t+e)/2,d=r+l+u/2):(f=(t+e)/2,d=r-l-u/2),i(p,g,f,d,h,!1)}function i(t,e,n,r,a,o){var i,l;return a<1?i="scale("+a+") ":(a=1,i=""),l=o?"rotate("+o+" "+t+" "+e+") ":"","translate("+(n-a*t)+" "+(r-a*e)+")"+i+l}function l(t,e){var n=h(t.text,e);return p(L,n)}function s(t,e){var n=h(t.textposition,e);return g(C,n)}function c(t,e,n){return d(S,t.textfont,e,n)}function u(t,e,n){return d(z,t.insidetextfont,e,n)}function f(t,e,n){return d(O,t.outsidetextfont,e,n)}function d(t,e,n,r){e=e||{};var a=h(e.family,n),o=h(e.size,n),i=h(e.color,n);return{family:p(t.family,a,r.family),size:v(t.size,o,r.size),color:m(t.color,i,r.color)}}function h(t,e){var n;return Array.isArray(t)?ea))return e}return void 0!==n?n:t.dflt}function m(t,e,n){return b(e).isValid()?e:void 0!==n?n:t.dflt}var y=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,z=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,n){var a=e.xaxis,o=e.yaxis,i=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(n);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var n=e[0].t,l=e[0].trace,s=n.poffset,c=Array.isArray(s);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(n,u){function f(t){return 0===i.bargap&&0===i.bargroupgap?y.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var h,p,g,v,m=n.p+(c?s[u]:s),b=m+n.w,_=n.b,w=_+n.s;if("h"===l.orientation?(g=o.c2p(m,!0),v=o.c2p(b,!0),h=a.c2p(_,!0),p=a.c2p(w,!0)):(h=a.c2p(m,!0),p=a.c2p(b,!0),g=o.c2p(_,!0),v=o.c2p(w,!0)),!(x(h)&&x(p)&&x(g)&&x(v)&&h!==p&&g!==v))return void y.select(this).remove();var M=(n.mlw+1||l.marker.line.width+1||(n.trace?n.trace.marker.line.width:0)+1)-1,A=y.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(n.mc||l.marker.color),L=T<1||M>.01?f:d;h=L(h,p),p=L(p,h),g=L(g,v),v=L(v,g)}var C=y.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+h+","+g+"V"+v+"H"+p+"V"+g+"Z"),r(t,C,e,u,h,p,g,v)})}),l.call(A.plot,e)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,"../../lib":147,"../../lib/svg_text_utils":164,"./attributes":229,d3:7,"fast-isnumeric":10,tinycolor2:16}],237:[function(t,e,n){"use strict";function r(t,e,n,r){if(r.length){var l,s,c,u,f,d=t._fullLayout.barmode,h="overlay"===d,p="group"===d;if(h)a(t,e,n,r);else if(p){for(l=[],s=[],c=0;cc+l||!y(s))&&(f=!0,d(u,t))}for(var a=n.traces,o=m(e),i="fraction"===t._fullLayout.barnorm?1:100,l=i/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?i:s,u=[s,c],f=!1,h=0;h1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,n=e.marker,i=n.line,l=o.tryColorscale(n,""),s=o.tryColorscale(n,"line");r.select(this).selectAll("path").each(function(t){var e,o,c=(t.mlw+1||i.width+1)-1,u=r.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(n.color)?a.defaultLine:n.color,u.style("stroke-width",c+"px").call(a.fill,e),c&&(o="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(i.color)?a.defaultLine:i.color,u.call(a.stroke,o))})}),e.call(i.style)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,d3:7}],240:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,n,i,l){n("marker.color",i),a(t,"marker")&&o(t,e,l,n,{prefix:"marker.",cLetter:"c"}),n("marker.line.color",r.defaultLine),a(t,"marker.line")&&o(t,e,l,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width")}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],241:[function(t,e,n){"use strict";var r=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/attributes"),i=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:r.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},hovertext:{valType:"string",dflt:"",arrayOk:!0},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:i({},o.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:i({},a,{}),insidetextfont:i({},a,{}),outsidetextfont:i({},a,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":33,"../../lib/extend":142,"../../plots/attributes":181,"../../plots/font_attributes":207}],242:[function(t,e,n){"use strict";function r(t,e){for(var n=[],r=0;r")}return g};var s},{"../../components/color":34,"./helpers":245,"fast-isnumeric":10,tinycolor2:16}],244:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./attributes");e.exports=function(t,e,n,o){function i(n,o){return r.coerce(t,e,a,n,o)}var l=r.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel")),i("marker.line.width")&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var f=i("text"),d=i("textinfo",Array.isArray(f)?"text+percent":"percent");if(i("hovertext"),d&&"none"!==d){var h=i("textposition"),p=Array.isArray(h)||"auto"===h,g=p||"inside"===h,v=p||"outside"===h;if(g||v){var m=l(i,"textfont",o.font);g&&l(i,"insidetextfont",m),v&&l(i,"outsidetextfont",m)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":147,"./attributes":241}],245:[function(t,e,n){"use strict";var r=t("../../lib");n.formatPiePercent=function(t,e){var n=(100*t).toPrecision(3);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)+"%"},n.formatPieValue=function(t,e){var n=t.toPrecision(10);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)}},{"../../lib":147}],246:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("./layout_defaults"),r.layoutAttributes=t("./layout_attributes"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.styleOne=t("./style_one"),r.moduleType="trace",r.name="pie",r.basePlotModule=t("./base_plot"),r.categories=["pie","showLegend"],r.meta={},e.exports=r},{"./attributes":241,"./base_plot":242,"./calc":243,"./defaults":244,"./layout_attributes":247,"./layout_defaults":248,"./plot":249,"./style":250,"./style_one":251}],247:[function(t,e,n){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],248:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(n,o){r.coerce(t,e,a,n,o)}("hiddenlabels")}},{"../../lib":147,"./layout_attributes":247}],249:[function(t,e,n){"use strict";function r(t,e,n){var r=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/n.vTotal,.5),l=1-n.trace.hole,s=a(e,n),c={scale:s*n.r*2/r,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=n.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/n.r)-f*o/n.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=n.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),v={scale:2*g/t.width,rCenter:Math.cos(g/n.r)-g/o/n.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>d.scale?v:d;return c.scale<1&&m.scale>c.scale?m:c}function a(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var n=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(n)),(1-e.trace.hole)/2)}function o(t,e){var n=e.pxmid[0],r=e.pxmid[1],a=t.width/2,o=t.height/2;return n<0&&(a*=-1),r<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+n*n/(r*r)),outside:!0}}function i(t,e){function n(t,e){return t.pxmid[1]-e.pxmid[1]}function r(t,e){return e.pxmid[1]-t.pxmid[1]}var a,o,i,l,s,c,u,f,d,h,p,g,v;for(o=0;o<2;o++)for(i=o?n:r,s=o?Math.max:Math.min,u=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(i),d=t[1-o][a],h=d.concat(f),g=[],p=0;p0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[i.i]||((t.pxmid[1]-i.pxmid[1])*u>0?(f=i.cyFinal+s(i.px0[1],i.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(m+t.labelExtraY-y)*u>0&&(r=3*c*Math.abs(a-h.indexOf(t)),d=i.cxFinal+l(i.px0[0],i.px1[0]),(p=d+r-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=p)))}(g[p],m)}}}function l(t,e){var n,r,a,o,i,l,s,u,f,d,h=[];for(a=0;au&&(u=l.pull[o]);i.r=Math.min(n/c(l.tilt,Math.sin(s),l.depth),r/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===h.indexOf(l.scalegroup)&&h.push(l.scalegroup)}for(o=0;of.vTotal/2?1:0)}function c(t,e,n){if(!t)return 1;var r=Math.sin(t*Math.PI/180);return Math.max(.01,n*r*Math.abs(e)+2*Math.sqrt(1-r*r*e*e))}var u=t("d3"),f=t("../../components/fx"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var n=t._fullLayout;l(e,n._size);var c=n._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],v=c.trace,m=(v.depth||0)*c.r*Math.sin(0)/2,y=v.tiltaxis||0,x=y*Math.PI/180,b=[m*Math.sin(x),m*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],m=!1;l.each(function(e){function i(r){r.originalEvent=u.event;var o=t._fullLayout,i=t._fullData[v.index],l=f.castHoverinfo(i,o,e.i);if("all"===l&&(l="label+text+value+percent+name"),t._dragging||!1===o.hovermode||"none"===l||"skip"===l||!l)return void f.hover(t,r,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),h=k+e.pxmid[1]*(1-s),p=n.separators,m=[];-1!==l.indexOf("label")&&m.push(e.label),-1!==l.indexOf("text")&&(i.hovertext?m.push(Array.isArray(i.hovertext)?i.hovertext[e.i]:i.hovertext):i.text&&i.text[e.i]&&m.push(i.text[e.i])),-1!==l.indexOf("value")&&m.push(g.formatPieValue(e.v,p)),-1!==l.indexOf("percent")&&m.push(g.formatPiePercent(e.v/c.vTotal,p)),f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:h,text:m.join("
"),name:-1!==l.indexOf("name")?i.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:f.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:f.castHoverOption(v,e.i,"bordercolor"),fontFamily:f.castHoverOption(v,e.i,"font.family"),fontSize:f.castHoverOption(v,e.i,"font.size"),fontColor:f.castHoverOption(v,e.i,"font.color")},{container:o._hoverlayer.node(),outerContainer:o._paper.node(),gd:t}),f.hover(t,r,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(n._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,n,r,a){return"a"+a*c.r+","+a*_+" "+y+" "+e.largeArc+(r?" 1 ":" 0 ")+a*(n[0]-t[0])+","+a*(n[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",i).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var z=x(e.px0,e.px1,!0,1);if(C){var O=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+O*e.px0[0]+","+O*e.px0[1]+z+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+z+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var n=u.select(this).selectAll("text").data([0]);n.enter().append("text").attr("data-notex",1),n.exit().remove(),n.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(h.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans,t);var a,i=h.bBox(n.node());"outside"===D?a=o(i,e):(a=r(i,e,c),"auto"===D&&a.scale<1&&(n.call(h.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(i=h.bBox(n.node())),a=o(i,e)));var l=w+e.pxmid[0]*a.rCenter+(a.x||0),s=k+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=s-i.height/2,e.yLabelMid=s,e.yLabelMax=s+i.height/2,e.labelExtraX=0,e.labelExtraY=0,m=!0),n.attr("transform","translate("+l+","+s+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(i.left+i.right)/2+","+-(i.top+i.bottom)/2+")")})}),m&&i(s,v),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),n=e.select("g.slicetext text");n.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+n.attr("transform"));var r=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+r+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(l)>Math.abs(s)?o+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(r+t.labelExtraX+i):o+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":34,"../../components/drawing":58,"../../components/fx":75,"../../lib/svg_text_utils":164,"./helpers":245,d3:7}],250:[function(t,e,n){"use strict";var r=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],n=e.trace,o=r.select(this);o.style({opacity:n.opacity}),o.selectAll(".top path.surface").each(function(t){r.select(this).call(a,t,n)})})}},{"./style_one":251,d3:7}],251:[function(t,e,n){"use strict";var r=t("../../components/color");e.exports=function(t,e,n){var a=n.marker.line.color;Array.isArray(a)&&(a=a[e.i]||r.defaultLine);var o=n.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o}).call(r.fill,e.color).call(r.stroke,a)}},{"../../components/color":34}],252:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e){for(var n=0;ng&&h.splice(g,h.length-g),p.length>g&&p.splice(g,p.length-g);var v={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(n=e.marker,c=n.size,Array.isArray(c)){var y={type:"linear"};a.setConvert(y),c=y.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=m.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(i.hasMarkers(e)||i.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(m.padded=!1):m.tozero=!0,a.expand(f,h,v),a.expand(d,p,m);var _=new Array(g);for(u=0;u=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===n.xaxis&&o.yaxis===n.yaxis){o.opacity=void 0;break}}}}}},{}],256:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,s=n.marker,c="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===s||!s.showscale)return void o.autoMargin(t,c);var u=s.color,f=s.cmin,d=s.cmax;r(f)||(f=a.aggNums(Math.min,null,u)),r(d)||(d=a.aggNums(Math.max,null,u));var h=e[0].t.cb=l(t,c),p=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});h.fillcolor(p).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":37,"../../components/colorscale":48,"../../lib":147,"../../plots/plots":212, -"fast-isnumeric":10}],257:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&r(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(r(t,"marker")&&a(t,t.marker.color,"marker","c"),r(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":40,"../../components/colorscale/has_colorscale":47,"./subtypes":273}],258:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20}},{}],259:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,n,p){function g(n,o){return r.coerce(t,e,a,n,o)}var v=l(t,e,p,g),m=vq!=E>=q&&(O=S[L-1][0],D=S[L][0],z=O+(D-O)*(q-P)/(E-P),F=Math.min(F,z),j=Math.max(j,z));F=Math.max(F,0),j=Math.min(j,d._length);var V=l.defaultLine;return l.opacity(f.fillcolor)?V=f.fillcolor:l.opacity((f.line||{}).color)&&(V=f.line.color),r.extendFlat(t,{distance:s+10,x0:F,x1:j,y0:q,y1:q,color:V}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":34,"../../components/errorbars":64,"../../components/fx":75,"../../lib":147,"./get_trace_color":261}],263:[function(t,e,n){"use strict";var r={},a=t("./subtypes");r.hasLines=a.hasLines,r.hasMarkers=a.hasMarkers,r.hasText=a.hasText,r.isBubble=a.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/cartesian":193,"./arrays_to_calcdata":252,"./attributes":253,"./calc":254,"./clean_data":255,"./colorbar":256,"./defaults":259,"./hover":262,"./plot":270,"./select":271,"./style":272,"./subtypes":273}],264:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,n,o,i,l){var s=(t.marker||{}).color;if(i("line.color",n),r(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{i("line.color",!Array.isArray(s)&&s||n)}i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],265:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function n(e){var n=_.c2p(t[e].x),a=w.c2p(t[e].y);return n!==r&&a!==r&&[n,a]}function a(t){var e=t[0]/_._length,n=t[1]/w._length;return(1+10*Math.max(0,-e,e-1,-n,n-1))*A}var o,i,l,s,c,u,f,d,h,p,g,v,m,y,x,b,_=e.xaxis,w=e.yaxis,k=e.simplify,M=e.connectGaps,A=e.baseTolerance,T=e.linear,L=[],C=.2,S=new Array(t.length),z=0;for(k||(A=C=-1),o=0;oa(u))break;l=u,m=p[0]*h[0]+p[1]*h[1],m>g?(g=m,s=u,d=!1):m=t.length||!u)break;S[z++]=u,i=u}}else S[z++]=s}L.push(S.slice(0,z))}return L}},{"../../constants/numerical":132}],266:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],267:[function(t,e,n){"use strict";e.exports=function(t,e,n){for(var r,a,o=null,i=0;i0?Math.max(e,a):0}}},{"fast-isnumeric":10}],269:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,n,l,s,c){var u,f=i.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(n=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",n),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?r.background:r.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47,"./subtypes":273}],270:[function(t,e,n){"use strict";function r(t,e,n){var r;e.selectAll("g.trace").each(function(t){var e=i.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),r._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,n.layerClipId)})}function a(t,e,n,r,a,d,p){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function m(t){return t.id}function y(t){if(t.ids)return m}function x(){return!1}function b(e){var r,a,o,c=e[0].trace,f=i.select(this),d=u.hasMarkers(c),h=u.hasText(c),p=y(c),m=x,b=x;d&&(m=c.marker.maxdisplayed||c._needsCull?v:l.identity),h&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),r=a.data(m,p);var _=r.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");r.order(),r.each(function(e){var r=i.select(this),a=g(r);o=s.translatePoint(e,a,M,A),o?(s.singlePointStyle(e,a,c,w,T,t),n.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?r.exit().transition().style("opacity",0).remove():r.exit().remove(),a=f.selectAll("g"),r=a.data(b,p),r.enter().append("g").classed("textpoint",!0).append("text"),r.order(),r.each(function(t){var e=i.select(this),r=g(e.select("text"));o=s.translatePoint(t,r,M,A),o?n.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),r.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),n=A.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){g(i.select(this)).attr({x:e,y:n})})}),r.exit().remove()}var _,w;o(t,e,n,r,a);var k=!!p&&p.duration>0,M=n.xaxis,A=n.yaxis,T=r[0].trace,L=T.line,C=i.select(d);if(C.call(c.plot,n,p),!0===T.visible){g(C).style("opacity",T.opacity);var S,z,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),r[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",z=E._nextFill,P=E._polygons);var N,I,R,F,j,B,H,q,V,U="",G="",X=[],Y=[],Z=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(r),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},X=f(r,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,linear:"linear"===L.shape,simplify:L.simplify}),V=T._polygons=new Array(X.length),w=0;w1}),Z=function(t){return function(e){if(N=R(e),I=j(e),U?O?(U+="L"+N.substr(1),G=I+"L"+G.substr(1)):(U+="Z"+N,G=I+"Z"+G):(U=N,G=I),u.hasLines(T)&&e.length>1){var n=i.select(this);if(n.datum(r),t)g(n.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(n);a.attr("d",N),s.singleLineStyle(r,a)}}}}}var W=C.selectAll(".js-line").data(Y);g(W.exit()).style("opacity",0).remove(),W.each(Z(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(W,n.layerClipId),X.length&&(S?B&&q&&(O?("y"===O?B[1]=q[1]=A.c2p(0,!0):"x"===O&&(B[0]=q[0]=M.c2p(0,!0)),g(S).attr("d","M"+q+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(z).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(z).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(P)),T._prevRevpath=G,T._prevPolygons=V);var $=C.selectAll(".points");_=$.data([r]),$.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(i.select(this),e?null:n.layerClipId)})}}function o(t,e,n,r,a){var o=n.xaxis,s=n.yaxis,c=i.extent(l.simpleMap(o.range,o.r2c)),f=i.extent(l.simpleMap(s.range,s.r2c)),d=r[0].trace;if(u.hasMarkers(d)){var h=d.marker.maxdisplayed;if(0!==h){var p=r.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/h),v=0;a.forEach(function(t,n){var r=t[0].trace;u.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;for(u=p.selectAll("g.trace"),f=u.data(n,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),d(t,e,n),r(t,p,e),s=0,c={};sc[e[0].trace.uid]?1:-1}),v){l&&(h=l());i.transition().duration(o.duration).ease(o.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){p.selectAll("g.trace").each(function(r,i){a(t,i,e,r,n,this,o)})})}else p.selectAll("g.trace").each(function(r,i){a(t,i,e,r,n,this,o)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":58,"../../components/errorbars":64,"../../lib":147,"../../lib/polygon":157,"./line_points":265,"./link_traces":267,"./subtypes":273,d3:7}],271:[function(t,e,n){"use strict";var r=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var n,o,i,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,h=d.marker,p=!r.hasMarkers(d)&&!r.hasText(d);if(!0===d.visible&&!p){var g=Array.isArray(h.opacity)?1:h.opacity;if(!1===e)for(n=0;nMath.abs(e))u.rotate(o,0,0,-t*n*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-u.lastT())/100;u.pan(o,0,0,h*(Math.exp(s)-1))}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":35,"mouse-change":450,"mouse-event-offset":451,"mouse-wheel":453,"right-now":500}],35:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=a(),h=o(),f=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),new n({turntable:c,orbit:h,matrix:f},u)}e.exports=i;var a=t("turntable-camera-controller"),o=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+p;if((r=a-p-m[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)e=t[n],r=e.y+e.dy+p-a,r>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(v).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(m[1]-(t.length-1)*p)/e.sum(t,h)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),g.forEach(function(e){e.dy=e.value*t})}(),n();for(var o=1;t>0;--t)!function(t){function r(t){return c(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,h);n.y+=(i-c(n))*t}})})}(o*=.99),n(),function(t){function r(t){return c(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,h);n.y+=(i-c(n))*t}})})}(o),n()}function u(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}v.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),v.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function c(t){return t.y+t.dy/2}function h(t){return t.value}var f={},d=24,p=8,m=[1,1],v=[],g=[];return f.nodeWidth=function(t){return arguments.length?(d=+t,f):d},f.nodePadding=function(t){return arguments.length?(p=+t,f):p},f.nodes=function(t){return arguments.length?(v=t,f):v},f.links=function(t){return arguments.length?(g=t,f):g},f.size=function(t){return arguments.length?(m=t,f):m},f.layout=function(e){return t(),i(),a(),l(e),u(),f},f.relayout=function(){return u(),f},f.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,u=l+t.dy,c=t.target.y+t.ty,h=c+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+c+" "+i+","+c+"L"+i+","+h+"C"+s+","+h+" "+o+","+u+" "+r+","+u+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},f};t.sankey=i,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":112,"d3-collection":113,"d3-interpolate":117}],37:[function(t,e,r){"use strict";function n(t){var e=s.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:n,type:t.FLOAT,size:2}]),e._triangleBuffer=n,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),o=t("gl-vao"),s=new i;e.exports=n},{"gl-buffer":154,"gl-vao":269,"weak-map":557}],38:[function(t,e,r){function n(t,e,r){e="number"==typeof e?e:1,r=r||": ";var n=t.split(/\r?\n/),a=String(n.length+e-1).length;return n.map(function(t,n){var o=n+e,s=String(o).length;return i(o,a-s)+r+t}).join("\n")}var i=t("pad-left");e.exports=n},{"pad-left":472}],39:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;ni&&(i=t[o]),t[o]>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}var c={},h=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,f=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=a,c.copy1D=o,c.str2RgbArray=l,c.str2RgbaArray=u,c}()},{}],45:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==u[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!d(t[o],e[o],r,n))return!1;return!0}function v(t,e,r){d(t,e,!0)&&h(t,e,r,"notDeepStrictEqual",v)}function g(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)} -function y(t){var e;try{t()}catch(t){e=t}return e}function b(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=y(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&h(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&x.isError(i),s=!t&&i&&!r;if((o&&a&&g(i,r)||s)&&h(i,r,"Got unwanted exception"+n),t&&i&&r&&!g(i,r)||!t&&i)throw i}var x=t("util/"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return"foo"===function(){}.name}(),k=e.exports=f,A=/\s*function\s+([^\(\s]*)\s*/;k.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=c(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},x.inherits(k.AssertionError,Error),k.fail=h,k.ok=f,k.equal=function(t,e,r){t!=e&&h(t,e,r,"==",k.equal)},k.notEqual=function(t,e,r){t==e&&h(t,e,r,"!=",k.notEqual)},k.deepEqual=function(t,e,r){d(t,e,!1)||h(t,e,r,"deepEqual",k.deepEqual)},k.deepStrictEqual=function(t,e,r){d(t,e,!0)||h(t,e,r,"deepStrictEqual",k.deepStrictEqual)},k.notDeepEqual=function(t,e,r){d(t,e,!1)&&h(t,e,r,"notDeepEqual",k.notDeepEqual)},k.notDeepStrictEqual=v,k.strictEqual=function(t,e,r){t!==e&&h(t,e,r,"===",k.strictEqual)},k.notStrictEqual=function(t,e,r){t===e&&h(t,e,r,"!==",k.notStrictEqual)},k.throws=function(t,e,r){b(!0,t,e,r)},k.doesNotThrow=function(t,e,r){b(!1,t,e,r)},k.ifError=function(t){if(t)throw t};var T=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":547}],46:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],47:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(h):h<0&&(c=c.ushln(-h)),l(r,c)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),u=t("./div");e.exports=n},{"./div":50,"./is-rat":52,"./lib/is-bn":56,"./lib/num-to-bn":57,"./lib/rationalize":58,"./lib/str-to-bn":59}],52:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":56}],53:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":66}],54:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}var i=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":65,"double-bits":122}],56:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":66}],57:[function(t,e,r){"use strict";function n(t){var e=a.exponent(t);return e<52?new i(t):new i(t*Math.pow(2,52-e)).ushln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":66,"double-bits":122}],58:[function(t,e,r){"use strict";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];n<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t("./num-to-bn"),a=t("./bn-sign");e.exports=n},{"./bn-sign":53,"./num-to-bn":57}],59:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":66}],60:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":58}],61:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":53}],62:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":58}],63:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.abs().divmod(r.abs()),o=n.div,s=i(o),l=n.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,h=i(l.ushln(c).divRound(r));return u*(s+h*Math.pow(2,-c))}var f=r.bitLength()-l.bitLength()+53,h=i(l.ushln(f).divRound(r));return f<1023?u*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),u*h*Math.pow(2,1023-f))}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":54,"./lib/ctz":55}],64:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],65:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],66:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}function l(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}function u(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&l,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;i=0|t.words[p],a=0|e.words[d],o=i*a+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}function c(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(t,e,r){return(new f).mulp(t,e,r)}function f(t,e){this.x=t,this.y=e}function d(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){d.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){d.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function g(){d.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function b(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var x;try{x=t("buffer").Buffer}catch(t){}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,l=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-l.length]+l+r:l+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=w[t],c=M[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modn(c).toString(t);h=h.idivn(c),r=h.isZero()?f+r:_[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==x),this.toArrayLike(x,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,d=0|o[1],p=8191&d,m=d>>>13,v=0|o[2],g=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],I=8191&z,D=z>>>13,P=0|o[8],O=8191&P,R=P>>>13,F=0|o[9],j=8191&F,N=F>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],X=8191&Y,W=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(h,U),i=Math.imul(h,V),i=i+Math.imul(f,U)|0,a=Math.imul(f,V);var vt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),i=Math.imul(p,V),i=i+Math.imul(m,U)|0,a=Math.imul(m,V),n=n+Math.imul(h,q)|0,i=i+Math.imul(h,G)|0,i=i+Math.imul(f,q)|0,a=a+Math.imul(f,G)|0;var gt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=Math.imul(g,V),i=i+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=i+Math.imul(p,G)|0,i=i+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0,n=n+Math.imul(h,X)|0,i=i+Math.imul(h,W)|0,i=i+Math.imul(f,X)|0,a=a+Math.imul(f,W)|0;var yt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=Math.imul(x,V),i=i+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(g,q)|0,i=i+Math.imul(g,G)|0,i=i+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,W)|0,i=i+Math.imul(m,X)|0,a=a+Math.imul(m,W)|0,n=n+Math.imul(h,J)|0,i=i+Math.imul(h,K)|0,i=i+Math.imul(f,J)|0,a=a+Math.imul(f,K)|0;var bt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=Math.imul(M,V),i=i+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(x,q)|0,i=i+Math.imul(x,G)|0,i=i+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,W)|0,i=i+Math.imul(y,X)|0,a=a+Math.imul(y,W)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0,i=i+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0,n=n+Math.imul(h,$)|0,i=i+Math.imul(h,tt)|0,i=i+Math.imul(f,$)|0,a=a+Math.imul(f,tt)|0;var xt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=Math.imul(T,V),i=i+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,i=i+Math.imul(k,q)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(x,X)|0,i=i+Math.imul(x,W)|0,i=i+Math.imul(_,X)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0,i=i+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,tt)|0,i=i+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0,n=n+Math.imul(h,rt)|0,i=i+Math.imul(h,nt)|0,i=i+Math.imul(f,rt)|0,a=a+Math.imul(f,nt)|0;var _t=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=Math.imul(L,V),i=i+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,q)|0,i=i+Math.imul(T,G)|0,i=i+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,X)|0,i=i+Math.imul(M,W)|0,i=i+Math.imul(k,X)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(x,J)|0,i=i+Math.imul(x,K)|0,i=i+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0,i=i+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=i+Math.imul(p,nt)|0,i=i+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0,n=n+Math.imul(h,at)|0,i=i+Math.imul(h,ot)|0,i=i+Math.imul(f,at)|0,a=a+Math.imul(f,ot)|0;var wt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,U),i=Math.imul(I,V),i=i+Math.imul(D,U)|0,a=Math.imul(D,V),n=n+Math.imul(L,q)|0,i=i+Math.imul(L,G)|0,i=i+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,X)|0,i=i+Math.imul(T,W)|0,i=i+Math.imul(S,X)|0,a=a+Math.imul(S,W)|0,n=n+Math.imul(M,J)|0,i=i+Math.imul(M,K)|0,i=i+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(x,$)|0,i=i+Math.imul(x,tt)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0,i=i+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=i+Math.imul(p,ot)|0,i=i+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0,n=n+Math.imul(h,lt)|0,i=i+Math.imul(h,ut)|0,i=i+Math.imul(f,lt)|0,a=a+Math.imul(f,ut)|0;var Mt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=Math.imul(O,V),i=i+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,i=i+Math.imul(D,q)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(L,X)|0,i=i+Math.imul(L,W)|0,i=i+Math.imul(C,X)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(T,J)|0,i=i+Math.imul(T,K)|0,i=i+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=i+Math.imul(M,tt)|0,i=i+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,i=i+Math.imul(x,nt)|0,i=i+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(g,at)|0,i=i+Math.imul(g,ot)|0,i=i+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=i+Math.imul(p,ut)|0,i=i+Math.imul(m,lt)|0,a=a+Math.imul(m,ut)|0,n=n+Math.imul(h,ht)|0,i=i+Math.imul(h,ft)|0,i=i+Math.imul(f,ht)|0,a=a+Math.imul(f,ft)|0;var kt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,U),i=Math.imul(j,V),i=i+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(O,q)|0,i=i+Math.imul(O,G)|0,i=i+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,X)|0,i=i+Math.imul(I,W)|0,i=i+Math.imul(D,X)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,i=i+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,i=i+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=i+Math.imul(M,nt)|0,i=i+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(x,at)|0,i=i+Math.imul(x,ot)|0,i=i+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(g,lt)|0,i=i+Math.imul(g,ut)|0,i=i+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(p,ht)|0,i=i+Math.imul(p,ft)|0,i=i+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0,n=n+Math.imul(h,pt)|0,i=i+Math.imul(h,mt)|0,i=i+Math.imul(f,pt)|0,a=a+Math.imul(f,mt)|0;var At=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,q),i=Math.imul(j,G),i=i+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(O,X)|0,i=i+Math.imul(O,W)|0,i=i+Math.imul(R,X)|0,a=a+Math.imul(R,W)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,K)|0,i=i+Math.imul(D,J)|0,a=a+Math.imul(D,K)|0,n=n+Math.imul(L,$)|0,i=i+Math.imul(L,tt)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,i=i+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=i+Math.imul(M,ot)|0,i=i+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,i=i+Math.imul(x,ut)|0,i=i+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(g,ht)|0,i=i+Math.imul(g,ft)|0,i=i+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0,n=n+Math.imul(p,pt)|0,i=i+Math.imul(p,mt)|0,i=i+Math.imul(m,pt)|0,a=a+Math.imul(m,mt)|0;var Tt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,X),i=Math.imul(j,W),i=i+Math.imul(N,X)|0,a=Math.imul(N,W),n=n+Math.imul(O,J)|0,i=i+Math.imul(O,K)|0,i=i+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,i=i+Math.imul(I,tt)|0,i=i+Math.imul(D,$)|0,a=a+Math.imul(D,tt)|0,n=n+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,i=i+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=i+Math.imul(T,ot)|0,i=i+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=i+Math.imul(M,ut)|0,i=i+Math.imul(k,lt)|0,a=a+Math.imul(k,ut)|0,n=n+Math.imul(x,ht)|0,i=i+Math.imul(x,ft)|0,i=i+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0,n=n+Math.imul(g,pt)|0,i=i+Math.imul(g,mt)|0,i=i+Math.imul(y,pt)|0,a=a+Math.imul(y,mt)|0;var St=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,J),i=Math.imul(j,K),i=i+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(O,$)|0,i=i+Math.imul(O,tt)|0,i=i+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=i+Math.imul(I,nt)|0,i=i+Math.imul(D,rt)|0,a=a+Math.imul(D,nt)|0,n=n+Math.imul(L,at)|0,i=i+Math.imul(L,ot)|0,i=i+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,i=i+Math.imul(S,lt)|0,a=a+Math.imul(S,ut)|0,n=n+Math.imul(M,ht)|0,i=i+Math.imul(M,ft)|0,i=i+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0,n=n+Math.imul(x,pt)|0,i=i+Math.imul(x,mt)|0,i=i+Math.imul(_,pt)|0,a=a+Math.imul(_,mt)|0;var Et=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,$),i=Math.imul(j,tt),i=i+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(O,rt)|0,i=i+Math.imul(O,nt)|0,i=i+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=i+Math.imul(I,ot)|0,i=i+Math.imul(D,at)|0,a=a+Math.imul(D,ot)|0,n=n+Math.imul(L,lt)|0,i=i+Math.imul(L,ut)|0,i=i+Math.imul(C,lt)|0,a=a+Math.imul(C,ut)|0,n=n+Math.imul(T,ht)|0,i=i+Math.imul(T,ft)|0,i=i+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0,n=n+Math.imul(M,pt)|0,i=i+Math.imul(M,mt)|0,i=i+Math.imul(k,pt)|0,a=a+Math.imul(k,mt)|0;var Lt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,rt),i=Math.imul(j,nt),i=i+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(O,at)|0,i=i+Math.imul(O,ot)|0,i=i+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=i+Math.imul(I,ut)|0,i=i+Math.imul(D,lt)|0,a=a+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,i=i+Math.imul(L,ft)|0,i=i+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0,n=n+Math.imul(T,pt)|0,i=i+Math.imul(T,mt)|0,i=i+Math.imul(S,pt)|0,a=a+Math.imul(S,mt)|0;var Ct=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,at),i=Math.imul(j,ot),i=i+Math.imul(N,at)|0, -a=Math.imul(N,ot),n=n+Math.imul(O,lt)|0,i=i+Math.imul(O,ut)|0,i=i+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(I,ht)|0,i=i+Math.imul(I,ft)|0,i=i+Math.imul(D,ht)|0,a=a+Math.imul(D,ft)|0,n=n+Math.imul(L,pt)|0,i=i+Math.imul(L,mt)|0,i=i+Math.imul(C,pt)|0,a=a+Math.imul(C,mt)|0;var zt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(j,lt),i=Math.imul(j,ut),i=i+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(O,ht)|0,i=i+Math.imul(O,ft)|0,i=i+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0,n=n+Math.imul(I,pt)|0,i=i+Math.imul(I,mt)|0,i=i+Math.imul(D,pt)|0,a=a+Math.imul(D,mt)|0;var It=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,ht),i=Math.imul(j,ft),i=i+Math.imul(N,ht)|0,a=Math.imul(N,ft),n=n+Math.imul(O,pt)|0,i=i+Math.imul(O,mt)|0,i=i+Math.imul(R,pt)|0,a=a+Math.imul(R,mt)|0;var Dt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(j,pt),i=Math.imul(j,mt),i=i+Math.imul(N,pt)|0,a=Math.imul(N,mt);var Pt=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=vt,l[1]=gt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=It,l[17]=Dt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};Math.imul||(k=u),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?k(this,t,e):r<63?u(this,t,e):r<1024?c(this,t,e):h(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},f.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=l(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){s=new a(null),s.length=l+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e)},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,u=1;0==(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var f;return f=0===e.cmpn(1)?i:o,f.cmpn(0)<0&&f.iadd(t),f},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new y(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},d.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},d.prototype.split=function(t,e){t.iushrn(this.n,0,e)},d.prototype.imulK=function(t){return t.imul(this.k)},i(p,d),p.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(A[t])return A[t];var e;if("k256"===t)e=new p;else if("p224"===t)e=new m;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new g}return A[t]=e,e},y.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new b(t)},i(b,y),b.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},b.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},b.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},b.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},b.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],67:[function(t,e,r){"use strict";function n(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var l,u=h.mallocDouble(2*s*a),c=h.mallocInt32(a);if((a=i(t,s,u,c))>0){if(1===s&&n)f.init(a),l=f.sweepComplete(s,r,0,a,u,c,0,a,u,c);else{var p=h.mallocDouble(2*s*o),m=h.mallocInt32(o);o=i(e,s,p,m),o>0&&(f.init(a+o),l=1===s?f.sweepBipartite(s,r,0,a,u,c,0,o,p,m):d(s,r,n,a,u,c,o,p,m),h.free(p),h.free(m))}h.free(u),h.free(c)}return l}}}function o(t,e){c.push([t,e])}function s(t){return c=[],a(t,t,o,!0),c}function l(t,e){return c=[],a(t,e,o,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=u;var c,h=t("typedarray-pool"),f=t("./lib/sweep"),d=t("./lib/intersect")},{"./lib/intersect":70,"./lib/sweep":74,"typedarray-pool":539}],69:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",u,"=2*",a,";"],l="for(var i="+c+","+p+"="+u+"*"+c+";i<"+h+";++i,"+p+"+="+u+"){var x0="+f+"["+o+"+"+p+"],x1="+f+"["+o+"+"+p+"+"+a+"],xi="+d+"[i];",M="for(var j="+m+","+b+"="+u+"*"+m+";j<"+v+";++j,"+b+"+="+u+"){var y0="+g+"["+o+"+"+b+"],"+(r?"y1="+g+"["+o+"+"+b+"+"+a+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",M):i.push(M,_,":",l),r?i.push("if(y1"+v+"-"+m+"){"),t?(e(!0,!1),o.push("}else{"),e(!1,!1)):(o.push("if("+l+"){"),e(!0,!0),o.push("}else{"),e(!0,!1),o.push("}}else{if("+l+"){"),e(!1,!0),o.push("}else{"),e(!1,!1),o.push("}")),o.push("}}return "+r);var s=i.join("")+o.join("");return new Function(s)()}var a="d",o="ax",s="vv",l="fp",u="es",c="rs",h="re",f="rb",d="ri",p="rp",m="bs",v="be",g="bb",y="bi",b="bp",x="rv",_="Q",w=[a,o,s,c,h,f,d,m,v,g,y];r.partial=i(!1),r.full=i(!0)},{}],70:[function(t,e,r){"use strict";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(A*r);S.length0;){z-=1;var D=z*A,P=S[D],O=S[D+1],R=S[D+2],F=S[D+3],j=S[D+4],N=S[D+5],B=z*T,U=E[B],V=E[B+1],H=1&N,q=!!(16&N),G=l,Y=u,X=m,W=L;if(H&&(G=m,Y=L,X=l,W=u),!(2&N&&(R=_(t,P,O,R,G,Y,V),O>=R)||4&N&&(O=w(t,P,O,R,G,Y,U))>=R)){var Z=R-O,J=j-F;if(q){if(t*Z*(Z+J)=p0)&&!(p1>=hi)",["p0","p1"]),x=m("lo===p0",["p0"]),_=m("lor&&i[h+e]>u;--c,h-=o){for(var f=h,d=h+o,p=0;p>>1,f=2*t,d=h,p=a[f*h+e];u=b?(d=y,p=b):g>=_?(d=v,p=g):(d=x,p=_):b>=_?(d=y,p=b):_>=g?(d=v,p=g):(d=x,p=_);for(var w=f*(c-1),M=f*d,k=0;k=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],73:[function(t,e,r){"use strict";function n(t,e){e<=4*f?i(0,e-1,t):h(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function c(t,e,r,n){t*=2;var i=n[t];return i>1,v=m-n,g=m+n,y=d,b=v,x=m,_=g,w=p,M=t+1,k=e-1,A=0;u(y,b,r)&&(A=y,y=b,b=A),u(_,w,r)&&(A=_,_=w,w=A),u(y,x,r)&&(A=y,y=x,x=A),u(b,x,r)&&(A=b,b=x,x=A),u(y,_,r)&&(A=y,y=_,_=A),u(x,_,r)&&(A=x,x=_,_=A),u(b,w,r)&&(A=b,b=w,w=A),u(b,x,r)&&(A=b,b=x,x=A),u(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*b],S=r[2*b+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*x,I=2*w,D=2*d,P=2*m,O=2*p,R=0;R<2;++R){var F=r[C+R],j=r[z+R],N=r[I+R];r[D+R]=F,r[P+R]=j,r[O+R]=N}o(v,t,r),o(g,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&a(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(s(B,M,k,r),++M,--k):(a(B,k,r),--k);break}if(--k>>1;f(x,S);for(var E=0,L=0,M=0;M=d)C=C-d|0,i(v,g,L--,C);else if(C>=0)i(p,m,E--,C);else if(C<=-d){C=-C-d|0;for(var z=0;z>>1;f(x,E);for(var L=0,C=0,z=0,k=0;k>1==x[2*k+3]>>1&&(D=2,k+=1),I<0){for(var P=-(I>>1)-1,O=0;O>1)-1;0===D?i(p,m,L--,P):1===D?i(v,g,C--,P):2===D&&i(y,b,z--,P)}}}function l(t,e,r,n,o,s,l,u,c,h,v,g){var y=0,b=2*t,_=e,w=e+t,M=1,k=1;n?k=d:M=d;for(var A=o;A>>1;f(x,L);for(var C=0,A=0;A=d?(I=!n,T-=d):(I=!!n,T-=1),I)a(p,m,C++,T);else{ -var D=g[T],P=b*T,O=v[P+e+1],R=v[P+e+1+t];t:for(var F=0;F>>1;f(x,M);for(var k=0,y=0;y=d)p[k++]=b-d;else{b-=1;var T=c[b],S=m*b,E=u[S+e+1],L=u[S+e+1+t];t:for(var C=0;C=0;--C)if(p[C]===b){for(var P=C+1;PZ)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?h(t,e,r):"string"==typeof t?u(t,e):f(t)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function s(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function l(t){return o(t),n(t<0?0:0|d(t))}function u(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(t,e),a=n(r),o=a.write(t,e);return o!==r&&(a=a.slice(0,o)),a}function c(t){for(var e=t.length<0?0:0|d(t.length),r=n(e),i=0;i=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return 0|t}function p(t){return+t!=t&&(t=0),i.alloc(+t)}function m(t,e){if(i.isBuffer(t))return t.length;if(G(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function v(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return z(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Y(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}var u;if(i){var c=-1;for(u=r;us&&(r=s-l),u=r;u>=0;u--){for(var h=!0,f=0;fi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],128==(192&l)&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return E(n)}function E(t){var e=t.length;if(e<=J)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(t,e,r,n,52,8),r+8}function j(t){if(t=t.trim().replace(K,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function U(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function H(t){return X.toByteArray(j(t))}function q(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function G(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function Y(t){return t!==t}var X=t("base64-js"),W=t("ieee754");r.Buffer=i,r.SlowBuffer=p,r.INSPECT_MAX_BYTES=50;var Z=2147483647;r.kMaxLength=Z,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return s(t,e,r)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return M(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||D(t,4,this.length),W.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||D(t,4,this.length),W.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||D(t,8,this.length),W.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||D(t,8,this.length),W.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function a(t){var e,r,i,a,o,s,l=t.length;o=n(t),s=new h(3*l/4-o),i=o>0?l-4:l;var u=0;for(e=0,r=0;e>16&255,s[u++]=a>>8&255,s[u++]=255&a;return 2===o?(a=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[u++]=255&a):1===o&&(a=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[u++]=a>>8&255,s[u++]=255&a),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],a=e;al?l:o+16383));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),a.push(i),a.join("")}r.byteLength=i,r.toByteArray=a,r.fromByteArray=l;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=f.length;d0;){for(var c=r.pop(),s=r.pop(),h=-1,f=-1,l=o[s],p=1;p=0||(e.flip(s,c),n(t,e,r,h,s,f),n(t,e,r,s,f,h),n(t,e,r,f,c,h),n(t,e,r,c,h,f)))}}var a=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":82,"robust-in-sphere":504}],79:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;for(var p=(c[d],0);p<3;++p){var m=f[3*d+p];m>=0&&0===u[m]&&(h[3*d+p]?l.push(m):(s.push(m),u[m]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var g=o(c,u,e);return r?g.concat(n.boundary):g}var l=t("binary-search-bounds");e.exports=s,n.prototype.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return r1&&d(r[c[h-2]],r[c[h-1]],n)>0;)t.push([c[h-1],c[h-2],i]),h-=1;c.length=h,c.push(i);for(var p=u.upperIds,h=p.length;h>1&&d(r[p[h-2]],r[p[h-1]],n)<0;)t.push([p[h-2],p[h-1],i]),h-=1;p.length=h,p.push(i)}}function l(t,e){var r;return(r=t.a[0]g[0]&&l.push(new i(g,d,v,h),new i(d,g,m,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],h=0,_=l.length;h<_;++h){var w=l[h],M=w.type;M===p?s(x,b,t,w.a,w.idx):M===v?u(b,t,w):c(b,t,w)}return x}var f=t("binary-search-bounds"),d=t("robust-orientation")[3],p=0,m=1,v=2;e.exports=h},{"binary-search-bounds":82,"robust-orientation":506}],81:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],83:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;rr?r:t:te?e:t}e.exports=n},{}],87:[function(t,e,r){"use strict";function n(t){var e=_(t);return[M(e,-1/0),M(e,1/0)]}function i(t,e){for(var r=new Array(e.length),n=0;n=0;--a){var p=n[a];o=p[0];var m=e[o],v=m[0],g=m[1],y=t[v],M=t[g];if((y[0]-M[0]||y[1]-M[1])<0){var A=v;v=g,g=A}m[0]=v;var T,S=m[1]=p[1];for(i&&(T=m[2]);a>0&&n[a-1][0]===o;){var p=n[--a],E=p[1];i?e.push([S,E,T]):e.push([S,E]),S=E}i?e.push([S,g,T]):e.push([S,g])}return s}function u(t,e,r){for(var i=e.length,a=new v(i),o=[],s=0;se[2]?1:0)}function f(t,e,r){if(0!==t.length){if(e)for(var n=0;n0||d.length>0)}function m(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}var a=t("clamp");e.exports=n,e.exports.to=n,e.exports.from=i},{clamp:86}],91:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],92:[function(t,e,r){(function(r){"use strict";function n(t){var e,n,s=[],l=1;if("string"==typeof t)if(i[t])s=i[t].slice(),n="rgb";else if("transparent"===t)l=0,n="rgb",s=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1),c=u.length,h=c<=4;l=1,h?(s=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===c&&(l=parseInt(u[3]+u[3],16)/255)):(s=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===c&&(l=parseInt(u[6]+u[7],16)/255)),s[0]||(s[0]=0),s[1]||(s[1]=0),s[2]||(s[2]=0),n="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],u=f.replace(/a$/,"");n=u;var c="cmyk"===u?4:"gray"===u?1:3;s=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===u&&s.push(1),l=void 0===s[c]?1:s[c],s=s.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(s=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),n=t.match(/([a-z])/gi).join("").toLowerCase());else"number"==typeof t?(n="rgb",s=[t>>>16,(65280&t)>>>8,255&t]):a(t)?(null!=t.r?(s=[t.r,t.g,t.b],n="rgb"):null!=t.red?(s=[t.red,t.green,t.blue],n="rgb"):null!=t.h?(s=[t.h,t.s,t.l],n="hsl"):null!=t.hue&&(s=[t.hue,t.saturation,t.lightness],n="hsl"),null!=t.a?l=t.a:null!=t.alpha?l=t.alpha:null!=t.opacity&&(l=t.opacity/100)):(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(s=[t[0],t[1],t[2]],n="rgb",l=4===t.length?t[3]:1);return{space:n,values:s,alpha:l}}e.exports=n;var i=t("color-name"),a=t("is-plain-obj"),o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":91,"is-plain-obj":295}],93:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t,e){if(Array.isArray(t))return t;null==e&&(e=!0);var r=n(t);if(!r.space)return[];var o,s=r.values,l=s.length;for(o=0;o1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),u=l-s;return l===s?e=0:i===l?e=(a-o)/u:a===l?e=2+(o-i)/u:o===l&&(e=4+(i-a)/u),e=Math.min(60*e,360),e<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?u/(l+s):u/(2-l-s),[e,100*r,100*n]}},{"./rgb":95}],95:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],96:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],97:[function(t,e,r){"use strict";function n(t){var e,r,n,u,c,h,f,d,p,m,v,g,y,b=[],x=[],_=[],w=[];if(o.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",f=t.colormap,f||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!l[f])throw Error(f+" not a supported colorscale");h=s(l[f])}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);h=s(f)}if(h.length>p)throw new Error(f+" map requires nshades to be at least size "+h.length);for(v=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:s(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=h.map(function(t){return Math.round(t.index*p)}),v[0]<0&&(v[0]=0),v[1]<0&&(v[0]=0),v[0]>1&&(v[0]=1),v[1]>1&&(v[0]=1),y=0;y=0&&r[3]<=1||(r[3]=v[0]+(v[1]-v[0])*g);for(y=0;y=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),u=o(a(t,e,i));if(l===u){if(0===l){var c=n(t,e,r);return c===n(t,e,i)?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:o(u-l)}var h=a(t,e,r);return h>0?s>0&&a(t,e,i)>0?1:-1:h<0?s>0||a(t,e,i)>0?1:-1:a(t,e,i)>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),u=t("robust-sum")},{"robust-orientation":506,"robust-product":507,"robust-sum":511,signum:513,"two-sum":538}],99:[function(t,e,r){function n(t,e){return t-e}function i(t,e){var r=t.length,i=t.length-e.length;if(i)return i;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||a(t[0],t[1])-a(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(i=o+t[2]-(s+e[2]))return i;var l=a(t[0],t[1]),u=a(e[0],e[1]);return a(l,t[2])-a(u,e[2])||a(l+t[2],o)-a(u+e[2],s);case 4:var c=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],v=e[2],g=e[3];return c+h+f+d-(p+m+v+g)||a(c,h,f,d)-a(p,m,v,g,p)||a(c+h,c+f,c+d,h+f,h+d,f+d)-a(p+m,p+v,p+g,m+v,m+g,v+g)||a(c+h+f,c+h+d,c+f+d,h+f+d)-a(p+m+v,p+m+g,p+v+g,m+v+g);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}e.exports=n},{}],103:[function(t,e,r){"use strict";function n(t){var e=i(t),r=e.length;if(r<=2)return[];for(var n=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(u){var r=s(t);if(r.length<=e)return[];var a=n(t,r),l=o(a,!0);return i(l,r)}}e.exports=a;var o=t("incremental-convex-hull"),s=t("affine-hull")},{"affine-hull":39,"incremental-convex-hull":288}],105:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],106:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in u)return u[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var c=e.substr(0,i),h=e.substr(i+1,l-(i+1)).split(","),f=1;switch(c){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),v=m<=.5?m*(p+1):m+p-m*p,g=2*m-v;return[n(255*s(g,v,d+1/3)),n(255*s(g,v,d)),n(255*s(g,v,d-1/3)),f];default:return null}}return null}var u={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],rebeccapurple:[102,51,153,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{r.parseCSSColor=l}catch(t){}},{}],107:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],108:[function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,a(e)}var a=t("./lib/thunk.js");e.exports=i},{"./lib/thunk.js":110}],109:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(n=0;n0&&l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;c0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(var c=0;c0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=0;h0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(r),h=0;h0&&x.push("var "+_.join(","));for(var h=0;h3&&x.push(o(t.pre,t,c));var T=o(t.body,t,c),S=a(v);S3&&x.push(o(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+x.join("\n")+"\n----------");var E=[t.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",S,s(c)].join("");return new Function(["function ",E,"(",b.join(","),"){",x.join("\n"),"} return ",E].join(""))()}var u=t("uniq");e.exports=l},{uniq:541}],110:[function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c=0?(a>=k?10:a>=A?5:a>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=k?10:a>=A?5:a>=T?2:1)}function i(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=k?i*=10:a>=A?i*=5:a>=T&&(i*=2),ee?1:t>=e?0:NaN},s=function(t){return 1===t.length&&(t=e(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},l=s(o),u=l.right,c=l.left,h=function(t,e){null==e&&(e=r);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);nt?1:e>=t?0:NaN},p=function(t){return null===t?NaN:+t},m=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},v=function(t,e){var r=m(t,e);return r?Math.sqrt(r):r},g=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++lf;)d.pop(),--p;var m,v=new Array(p+1);for(a=0;a<=p;++a)m=v[a]=[],m.x0=a>0?d[a-1]:h,m.x1=a=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},z=function(t,e,r){return t=x.call(t,p).sort(o),Math.ceil((r-e)/(2*(C(t,.75)-C(t,.25))*Math.pow(t.length,-1/3)))},I=function(t,e,r){return Math.ceil((r-e)/(3.5*v(t)*Math.pow(t.length,-1/3)))},D=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},P=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r},F=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},j=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},N=function(t,e){if(r=t.length){var r,n,i=0,a=0,s=t[a];for(null==e&&(e=o);++i=c.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,u,h,f=-1,d=e.length,p=c[n++],m=r(),v=i();++fc.length)return t;var n,i=h[r-1];return null!=l&&r>=c.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,u,c=[],h=[];return u={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return c.push(t),u},sortKeys:function(t){return h[c.length-1]=t,u},sortValues:function(t){return s=t,u},rollup:function(t){return l=t,u}}},c=r.prototype;s.prototype=l.prototype={constructor:s,has:c.has,add:function(t){return t+="",this["$"+t]=t,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each};var h=function(t){var e=[];for(var r in t)e.push(r);return e},f=function(t){var e=[];for(var r in t)e.push(t[r]);return e},d=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e};t.nest=u,t.set=l,t.map=r,t.keys=h,t.values=f,t.entries=d,Object.defineProperty(t,"__esModule",{value:!0})})},{}],114:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=z.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=I.exec(t))?i(parseInt(e[1],16)):(e=D.exec(t))?new l(e[1],e[2],e[3],1):(e=P.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=O.exec(t))?a(e[1],e[2],e[3],e[4]):(e=R.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=F.exec(t))?u(e[1],e[2]/100,e[3]/100,1):(e=j.exec(t))?u(e[1],e[2]/100,e[3]/100,e[4]):N.hasOwnProperty(t)?i(N[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function u(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,r,n)}function c(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;t=t.rgb();var e=t.r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,u=s-o,c=(s+o)/2;return u?(l=e===s?(i-a)/u+6*(i0&&c<1?0:l,new f(l,u,c,t.opacity)}function h(t,e,r,n){return 1===arguments.length?c(t):new f(t,e,r,null==n?1:n)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function d(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function p(t){if(t instanceof v)return new v(t.l,t.a,t.b,t.opacity);if(t instanceof M){var e=t.h*B;return new v(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/V),s=g((.2126729*r+.7151522*n+.072175*i)/H);return new v(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/q)),t.opacity)}function m(t,e,r,n){return 1===arguments.length?p(t):new v(t,e,r,null==n?1:n)}function v(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>W?Math.pow(t,1/3):t/X+G}function y(t){return t>Y?t*t*t:X*(t-G)}function b(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _(t){if(t instanceof M)return new M(t.h,t.c,t.l,t.opacity);t instanceof v||(t=p(t));var e=Math.atan2(t.b,t.a)*U;return new M(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function w(t,e,r,n){return 1===arguments.length?_(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function k(t){if(t instanceof T)return new T(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(rt*n+tt*e-et*r)/(rt+tt-et),a=n-i,s=($*(r-i)-K*a)/Q,u=Math.sqrt(s*s+a*a)/($*i*(1-i)),c=u?Math.atan2(s,a)*U-120:NaN;return new T(c<0?c+360:c,u,i,t.opacity)}function A(t,e,r,n){return 1===arguments.length?k(t):new T(t,e,r,null==n?1:n)}function T(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var S=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},E="\\s*([+-]?\\d+)\\s*",L="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",C="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z=/^#([0-9a-f]{3})$/,I=/^#([0-9a-f]{6})$/,D=new RegExp("^rgb\\("+[E,E,E]+"\\)$"),P=new RegExp("^rgb\\("+[C,C,C]+"\\)$"),O=new RegExp("^rgba\\("+[E,E,E,L]+"\\)$"),R=new RegExp("^rgba\\("+[C,C,C,L]+"\\)$"),F=new RegExp("^hsl\\("+[L,C,C]+"\\)$"),j=new RegExp("^hsla\\("+[L,C,C,L]+"\\)$"),N={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};S(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),S(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),S(f,h,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(d(t>=240?t-240:t+120,i,n),d(t,i,n),d(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var B=Math.PI/180,U=180/Math.PI,V=.95047,H=1,q=1.08883,G=4/29,Y=6/29,X=3*Y*Y,W=Y*Y*Y;S(v,m,e(r,{brighter:function(t){return new v(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new v(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=H*y(t),e=V*y(e),r=q*y(r),new l(b(3.2404542*e-1.5371385*t-.4985314*r),b(-.969266*e+1.8760108*t+.041556*r),b(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),S(M,w,e(r,{brighter:function(t){return new M(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new M(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return p(this).rgb()}}));var Z=-.14861,J=1.78277,K=-.29227,Q=-.90649,$=1.97294,tt=$*Q,et=$*J,rt=J*K-Q*Z;S(T,A,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new T(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new T(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*B,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(Z*n+J*i)),255*(e+r*(K*n+Q*i)),255*(e+r*($*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=h,t.lab=m,t.hcl=w,t.cubehelix=A,Object.defineProperty(t,"__esModule",{value:!0})})},{}],115:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}function i(t,e){for(var r,n=0,i=t.length;n0)for(var r,n,i=new Array(r),a=0;af+s||np+s||ih.index){var l=f-a.x-a.vx,c=p-a.y-a.vy,g=l*l+c*c;gt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e1?(null==e?p.remove(t):p.set(t,s(e)),l):p.get(t)},find:function(e,r,n){var i,a,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u1?(y.on(t,e),l):y.on(t)}}},b=function(){function t(t){var r,l=a.length,h=e.quadtree(a,u,c).visitAfter(n);for(s=t,r=0;r=m)){(t.data!==o||t.next)&&(0===i&&(i=d(),c+=i*i),0===a&&(a=d(),c+=a*a),c180||r<-180?r-360*Math.round(r/360):r):S(isNaN(t)?e:t)}function o(t){return 1==(t=+t)?s:function(e,r){return r-e?i(e,r,t):S(isNaN(e)?r:e)}}function s(t,e){var r=e-t;return r?n(t,r):S(isNaN(t)?e:t)}function l(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:D(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}function s(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:D(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}function l(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:D(t,r)},{i:s-2,x:D(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}return function(e,r){var n=[],i=[];return e=t(e),r=t(r),a(e.translateX,e.translateY,r.translateX,r.translateY,n,i),o(e.rotate,r.rotate,n,i),s(e.skewX,r.skewX,n,i),l(e.scaleX,e.scaleY,r.scaleX,r.scaleY,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:D(r,n)})),a=R.lastIndex;return a=(a=(m+g)/2))?m=a:g=a,(c=r>=(o=(v+y)/2))?v=o:y=o,i=d,!(d=d[h=c<<1|u]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(a=(m+g)/2))?m=a:g=a,(c=r>=(o=(v+y)/2))?v=o:y=o}while((h=c<<1|u)==(f=(l>=o)<<1|s>=a));return i[f]=d,i[h]=p,t}function r(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),u=1/0,c=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),af&&(f=a));for(ht||t>i||n>e||e>a))return this;var o,s,l=i-r,u=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=u,u=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=u,u=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=u,u=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=u,u=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},h=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},f=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},d=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},p=function(t,e,r){var n,i,a,o,s,l,u,c=this._x0,h=this._y0,f=this._x1,p=this._y1,m=[],v=this._root;for(v&&m.push(new d(v,c,h,f,p)),null==r?r=1/0:(c=t-r,h=e-r,f=t+r,p=e+r,r*=r);l=m.pop();)if(!(!(v=l.node)||(i=l.x0)>f||(a=l.y0)>p||(o=l.x1)=y)<<1|t>=g)&&(l=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=l)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),_=b*b+x*x;if(_=(s=(p+v)/2))?p=s:v=s,(c=o>=(l=(m+g)/2))?m=l:g=l,e=d,!(d=d[h=c<<1|u]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=i,this)},v=function(){return this._root},g=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},y=function(t){var e,r,n,i,a,o,s=[],l=this._root;for(l&&s.push(new d(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,n=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var u=(n+a)/2,c=(i+o)/2;(r=l[3])&&s.push(new d(r,u,c,a,o)),(r=l[2])&&s.push(new d(r,n,c,u,o)),(r=l[1])&&s.push(new d(r,u,i,a,c)),(r=l[0])&&s.push(new d(r,n,i,u,c))}return this},b=function(t){var e,r=[],n=[];for(this._root&&r.push(new d(this._root,this._x0,this._y0,this._x1,this._y1));e=r.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,u=e.y1,c=(o+l)/2,h=(s+u)/2;(a=i[0])&&r.push(new d(a,o,s,c,h)),(a=i[1])&&r.push(new d(a,c,s,l,h)),(a=i[2])&&r.push(new d(a,o,h,c,u)),(a=i[3])&&r.push(new d(a,c,h,l,u))}n.push(e)}for(;e=n.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},x=function(t){return arguments.length?(this._x=t,this):this._x},_=function(t){return arguments.length?(this._y=t,this):this._y},w=o.prototype=s.prototype;w.copy=function(){var t,e,r=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=l(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=l(e));return r},w.add=u,w.addAll=r,w.cover=c,w.data=h,w.extent=f,w.find=p,w.remove=m,w.removeAll=n,w.root=v,w.size=g,w.visit=y,w.visitAfter=b,w.x=x,w.y=_,t.quadtree=o,Object.defineProperty(t,"__esModule",{value:!0})})},{}],119:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(){return g||(x(r),g=b.now()+y)}function r(){g=0}function n(){this._call=this._time=this._next=null}function i(t,e,r){var i=new n;return i.restart(t,e,r),i}function a(){e(),++f;for(var t,r=c;r;)(t=g-r._time)>=0&&r._call.call(null,t),r=r._next;--f}function o(){g=(v=b.now())+y,f=d=0;try{a()}finally{f=0,l(),g=0}}function s(){var t=b.now(),e=t-v;e>m&&(y-=e,v=t)}function l(){for(var t,e,r=c,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);h=t,u(n)}function u(t){if(!f){d&&(d=clearTimeout(d));var e=t-g;e>24?(t<1/0&&(d=setTimeout(o,e)),p&&(p=clearInterval(p))):(p||(v=g,p=setInterval(s,m)),f=1,x(o))}}var c,h,f=0,d=0,p=0,m=1e3,v=0,g=0,y=0,b="object"==typeof performance&&performance.now?performance:Date,x="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||h===this||(h?h._next=this:c=this,h=this),this._call=t,this._time=n,u()},stop:function(){this._call&&(this._call=null,this._time=1/0,u())}};var _=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},w=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=_,t.interval=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],120:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return te?1:t>=e?0:NaN}function a(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function s(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function h(){this._=Object.create(null)}function f(t){return(t+="")===_o||t[0]===wo?wo+t:t}function d(t){return(t+="")[0]===wo?t.slice(1):t}function p(t){return f(t)in this._}function m(t){return(t=f(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(d(e));return t}function g(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=Mo.length;r=e&&(e=i+1);!(o=s[e])&&++e0&&(t=t.slice(0,s));var u=Do.get(t);return u&&(t=u,l=J),s?e?i:n:e?M:a}function Z(t,e){return function(r){var n=uo.event;uo.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{uo.event=n}}}function J(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function K(t){var r=".dragsuppress-"+ ++Oo,i="click"+r,a=uo.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Po&&(Po=!("onselectstart"in t)&&w(t.style,"userSelect")),Po){var o=e(t).style,s=o[Po];o[Po]="none"}return function(t){if(a.on(r,null),Po&&(o[Po]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){T(),e()},!0),setTimeout(e,0)}}}function Q(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(Ro<0){var a=n(t);if(a.scrollX||a.scrollY){r=uo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Ro=!(o.f||o.e),r.remove()}}return Ro?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function $(){return uo.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:t<-1?No:Math.acos(t)}function nt(t){return t>1?Vo:t<-1?-Vo:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,r){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):Mt(""+t,kt,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,o=r<=.5?r*(1+e):r+e-r*e,a=2*r-o,new bt(i(t+120),i(t),i(t-120))}function ht(t,e,r){return this instanceof ht?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ht?new ht(t.h,t.c,t.l):t instanceof dt?mt(t.l,t.a,t.b):mt((t=At((t=uo.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ht(t,e,r)}function ft(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(r,Math.cos(t*=Ho)*e,Math.sin(t)*e)}function dt(t,e,r){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ht?ft(t.h,t.c,t.l):At((t=bt(t)).r,t.g,t.b):new dt(t,e,r)}function pt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=vt(i)*Qo,n=vt(n)*$o,a=vt(a)*ts,new bt(yt(3.2404542*i-1.5371385*n-.4985314*a),yt(-.969266*i+1.8760108*n+.041556*a),yt(.0556434*i-.2040259*n+1.0572252*a))}function mt(t,e,r){return t>0?new ht(Math.atan2(r,e)*qo,Math.sqrt(e*e+r*r),t):new ht(NaN,NaN,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,r){return this instanceof bt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):Mt(""+t,bt,ct):new bt(t,e,r)}function xt(t){return new bt(t>>16,t>>8&255,255&t)}function _t(t){return xt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Mt(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(St(i[0]),St(i[1]),St(i[2]))}return(a=ns.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function kt(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new ut(n,i,l)}function At(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=gt((.4124564*t+.3575761*e+.1804375*r)/Qo),i=gt((.2126729*t+.7151522*e+.072175*r)/$o);return dt(116*i-16,500*(n-i),200*(i-gt((.0193339*t+.119192*e+.9503041*r)/ts)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function St(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Et(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Ct(e,r,t,n)}}function Ct(t,e,r,n){function i(){var t,e=l.status;if(!e&&It(l)||e>=200&&e<300||304===e){try{t=r.call(a,l) -}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=uo.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=uo.event;uo.event=t;try{o.progress.call(a,l)}finally{uo.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ho(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},uo.rebind(a,o,"on"),null==n?a:a.get(zt(n))}function zt(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function It(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Dt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return as?as.n=a:is=a,as=a,os||(ss=clearTimeout(ss),os=1,ls(Pt)),a}function Pt(){var t=Ot(),e=Rt()-t;e>24?(isFinite(e)&&(clearTimeout(ss),ss=setTimeout(Pt,e)),os=0):(os=1,ls(Pt))}function Ot(){for(var t=Date.now(),e=is;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Rt(){for(var t,e=is,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Nt(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:x;return function(t){var r=cs.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",u=r[5],c=+r[6],h=r[7],f=r[8],d=r[9],p=1,m="",v="",g=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||"0"===n&&"="===o)&&(u=n="0",o="="),d){case"n":h=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":g=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],v=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=hs.get(d)||Bt;var b=u&&h;return function(t){var r=v;if(g&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=uo.formatPrefix(t,f);t=l.scale(t),r=l.symbol+v}else t*=p;t=d(t,f);var x,_,w=t.lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(x=t,_=""):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(x=a(x,1/0));var k=m.length+x.length+_.length+(b?0:i.length),A=k"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(b?t:A+t))+r}}}function Bt(t){return t+""}function Ut(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Vt(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=L[o in ms?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=M.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=S.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){k.lastIndex=0;var n=k.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,E.c.toString(),e,n)}function l(t,e,n){return r(t,E.x.toString(),e,n)}function u(t,e,n){return r(t,E.X.toString(),e,n)}function c(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,m=t.days,v=t.shortDays,g=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{ds=Ut;var e=new ds;return e._=t,n(e)}finally{ds=Date}}var n=e(t);return r.parse=function(t){try{ds=Ut;var e=n.parse(t);return e&&e._}finally{ds=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ce;var b=uo.map(),x=Yt(m),_=Xt(m),w=Yt(v),M=Xt(v),k=Yt(g),A=Xt(g),T=Yt(y),S=Xt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var E={a:function(t){return v[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:e(h),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+fs.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(fs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(fs.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:le,"%":function(){return"%"}},L={a:n,A:i,b:a,B:o,c:s,d:re,e:re,H:ie,I:ie,j:ne,L:se,m:ee,M:ae,p:c,S:oe,U:Zt,w:Wt,W:Jt,x:l,X:u,y:Qt,Y:Kt,Z:$t,"%":ue};return e}function Gt(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3)}function ee(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ie(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ae(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oe(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function se(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function le(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=xo(e)/60|0,i=xo(e)%60;return r+Gt(n,"0",2)+Gt(i,"0",2)}function ue(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ce(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),u=Math.sin(e),c=a*u,h=i*l+c*Math.cos(s),f=c*o*Math.sin(s);Ms.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;ks.point=function(o,s){ks.point=t,n=(e=o)*Ho,i=Math.cos(s=(r=s)*Ho/2+No/4),a=Math.sin(s)},ks.lineEnd=function(){t(e,r)}}function ge(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function be(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function xe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Me(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function ke(t,e){return xo(t[0]-e[0])=0;--s)i.point((h=c[s])[0],h[1])}else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function De(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Re))}var d,p,m,v=e(a),g=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,d=uo.merge(d);var t=Ve(g,p);d.length?(_||(a.polygonStart(),_=!0),Ie(d,je,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=Fe(),x=e(b),_=!1;return y}}function Re(t){return t.length>1}function Fe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:M,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function je(t,e){return((t=t.x)[0]<0?t[1]-Vo-Fo:Vo-t[1])-((e=e.x)[0]<0?e[1]-Vo-Fo:Vo-e[1])}function Ne(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?No:-No,l=xo(a-r);xo(l-No)0?Vo:-Vo),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=No&&(xo(r-i)Fo?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}function Ue(t,e,r,n){var i;if(null==t)i=r*Vo,n.point(-No,i),n.point(0,i),n.point(No,i),n.point(No,0),n.point(No,-i),n.point(0,-i),n.point(-No,-i),n.point(-No,0),n.point(-No,i);else if(xo(t[0]-e[0])>Fo){var a=t[0]=0?1:-1,M=w*_,k=M>No,A=p*b;if(Ms.add(Math.atan2(A*w*Math.sin(M),m*x+A*Math.cos(M))),a+=k?_+w*Bo:_,k^f>=r^g>=r){var T=be(ge(h),ge(t));we(T);var S=be(i,T);we(S);var E=(k^_>=0?-1:1)*nt(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;f=g,p=b,m=x,h=t}}return(a<-Fo||aa}function r(t){var r,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p=[h,f],m=e(h,f),v=o?m?0:i(h,f):m?i(h+(h<0?No:-No),f):0;if(!r&&(u=l=m)&&t.lineStart(),m!==l&&(d=n(r,p),(ke(r,d)||ke(p,d))&&(p[0]+=Fo,p[1]+=Fo,m=e(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&o^m){var g;v&a||!(g=n(p,r,!0))||(c=0,o?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!m||r&&ke(r,p)||t.point(p[0],p[1]),r=p,l=m,a=v},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=ge(t),i=ge(e),o=[1,0,0],s=be(n,i),l=ye(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var h=a*l/c,f=-a*u/c,d=be(o,s),p=_e(o,h);xe(p,_e(s,f));var m=d,v=ye(p,m),g=ye(m,m),y=v*v-g*(ye(p,p)-1);if(!(y<0)){var b=Math.sqrt(y),x=_e(m,(-v-b)/g);if(xe(x,p),x=Me(x),!r)return x;var _,w=t[0],M=e[0],k=t[1],A=e[1];M0^x[1]<(xo(x[0]-w)No^(w<=x[0]&&x[0]<=M)){var L=_e(m,(-v+b)/g);return xe(L,p),[x,Me(L)]}}}function i(e,r){var n=o?t:No-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=xo(a)>Fo;return Oe(e,r,vr(t,6*Ho),o?[0,-t]:[-No,t-No])}function qe(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=s.x,h=s.y,f=0,d=1,p=c-l,m=h-u;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a0){if(a>d)return;a>f&&(f=a)}if(a=r-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>f&&(f=a)}else if(p>0){if(a0)){if(a/=m,m<0){if(a0){if(a>d)return;a>f&&(f=a)}if(a=n-u,m||!(a<0)){if(a/=m,m<0){if(a>d)return;a>f&&(f=a)}else if(m>0){if(a0&&(i.a={x:l+f*p,y:u+f*m}),d<1&&(i.b={x:l+d*p,y:u+d*m}),i}}}}}}function Ge(t,e,r,n){function i(n,i){return xo(n[0]-t)0?0:3:xo(n[0]-r)0?2:1:xo(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,r=v.length,n=t[1],i=0;in&&et(u,a,t)>0&&++e:a[1]<=n&&et(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,h=0;if(null==a||(c=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0)do{u.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+l+4)%4)!==h);else u.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function h(t,e){c(t,e)&&s.point(t,e)}function f(){L.point=p,v&&v.push(g=[]),k=!0,M=!1,_=w=NaN}function d(){m&&(p(y,b),x&&M&&S.rejoin(),m.push(S.buffer())),L.point=h,M&&s.lineEnd()}function p(t,e){t=Math.max(-js,Math.min(js,t)),e=Math.max(-js,Math.min(js,e));var r=c(t,e);if(v&&g.push([t,e]),k)y=t,b=e,x=r,k=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&M)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};E(n)?(M||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),A=!1):r&&(s.lineStart(),s.point(t,e),A=!1)}_=t,w=e,M=r}var m,v,g,y,b,x,_,w,M,k,A,T=s,S=Fe(),E=qe(t,e,r,n),L={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=S,m=[],v=[],A=!0},polygonEnd:function(){s=T,m=uo.merge(m);var e=l([t,n]),r=A&&e,i=m.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&Ie(m,a,e,u,s),s.polygonEnd()),m=v=g=null}};return L}}function Ye(t){var e=0,r=No/3,n=lr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*No/180,r=t[1]*No/180):[e/No*180,r/No*180]},i}function Xe(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,nt((a-(t*t+r*r)*i*i)/(2*i))]},r}function We(){function t(t,e){Bs+=i*t-n*e,n=t,i=e}var e,r,n,i;Gs.point=function(a,o){Gs.point=t,e=n=a,r=i=o},Gs.lineEnd=function(){t(e,r)}}function Ze(t,e){tHs&&(Hs=t),eqs&&(qs=e)}function Je(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ke(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ke(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Ke(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qe(t,e){Ss+=t,Es+=e,++Ls}function $e(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Cs+=o*(e+t)/2,zs+=o*(r+n)/2,Is+=o,Qe(e=t,r=n)}var e,r;Xs.point=function(n,i){Xs.point=t,Qe(e=n,r=i)}}function tr(){Xs.point=Qe}function er(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Cs+=o*(n+t)/2,zs+=o*(i+e)/2,Is+=o,o=i*t-n*e,Ds+=o*(n+t),Ps+=o*(i+e),Os+=3*o,Qe(n=t,i=e)}var e,r,n,i;Xs.point=function(a,o){Xs.point=t,Qe(e=n=a,r=i=o)},Xs.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Bo)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:M};return s}function nr(t){function e(t){return(s?n:r)(t)}function r(e){return or(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=NaN,k.point=a,e.lineStart()}function a(r,n){var a=ge([r,n]),o=t(r,n);i(b,x,y,_,w,M,b=o[0],x=o[1],y=r,_=a[0],w=a[1],M=a[2],s,e),e.point(b,x)}function o(){k.point=r,e.lineEnd()}function l(){n(),k.point=u,k.lineEnd=c}function u(t,e){a(h=t,f=e),d=b,p=x,m=_,v=w,g=M,k.point=a}function c(){i(b,x,y,_,w,M,d,p,h,m,v,g,s,e),k.lineEnd=o,o()}var h,f,d,p,m,v,g,y,b,x,_,w,M,k={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=n}};return k}function i(e,r,n,s,l,u,c,h,f,d,p,m,v,g){var y=c-e,b=h-r,x=y*y+b*b;if(x>4*a&&v--){var _=s+d,w=l+p,M=u+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=xo(xo(M)-1)a||xo((y*C+b*z)/x-.5)>.3||s*d+l*p+u*m0&&16,e):Math.sqrt(a)},e}function ir(t){var e=nr(function(e,r){return t([e*qo,r*qo])});return function(t){return ur(e(t))}}function ar(t){this.stream=t}function or(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sr(t){return lr(function(){return t})()}function lr(t){function e(t){return t=s(t[0]*Ho,t[1]*Ho),[t[0]*f+l,u-t[1]*f]}function r(t){return(t=s.invert((t[0]-l)/f,(u-t[1])/f))&&[t[0]*qo,t[1]*qo]}function n(){s=Ce(o=fr(g,y,b),a);var t=a(m,v);return l=d-t[0]*f,u=p+t[1]*f,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,h=nr(function(t,e){return t=a(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,m=0,v=0,g=0,y=0,b=0,_=Fs,w=x,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=ur(_(o,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(M=t,Fs):He((M=+t)*Ho),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):k},e.scale=function(t){return arguments.length?(f=+t,n()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*Ho,v=t[1]%360*Ho,n()):[m*qo,v*qo]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Ho,y=t[1]%360*Ho,b=t.length>2?t[2]%360*Ho:0,n()):[g*qo,y*qo,b*qo]},uo.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function ur(t){return or(t,function(e,r){t.point(e*Ho,r*Ho)})}function cr(t,e){return[t,e]}function hr(t,e){return[t>No?t-Bo:t<-No?t+Bo:t,e]}function fr(t,e,r){return t?e||r?Ce(pr(t),mr(e,r)):pr(t):e||r?mr(e,r):hr}function dr(t){return function(e,r){return e+=t,[e>No?e-Bo:e<-No?e+Bo:e,r]}}function pr(t){var e=dr(t);return e.invert=dr(-t),e}function mr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*a-c*o,s*n-u*i),nt(c*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*n+c*i),nt(c*n-s*i)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=gr(r,i),a=gr(r,a),(o>0?ia)&&(i+=o*Bo)):(i=t+o*Bo,a=t-.5*l);for(var u,c=i;o>0?c>a:c0?e<-Vo+Fo&&(e=-Vo+Fo):e>Vo-Fo&&(e=Vo-Fo);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(No/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=tt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Vo]},r):Sr}function Tr(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return xo(i)1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Dr(t,e){return t[0]-e[0]||t[1]-e[1]}function Pr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Or(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function Rr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Fr(){an(this),this.edge=this.site=this.circle=null}function jr(t){var e=sl.pop()||new Fr;return e.site=t,e}function Nr(t){Zr(t),il.remove(t),sl.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Nr(t);for(var l=a;l.circle&&xo(r-l.circle.x)Fo)s=s.L;else{if(!((i=a-Hr(s,o))>Fo)){n>-Fo?(e=s.P,r=s):i>-Fo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=jr(t);if(il.insert(e,l),e||r){if(e===r)return Zr(e),r=jr(e.site),il.insert(l,r),l.edge=r.edge=$r(e.site,l.site),Wr(e),void Wr(r);if(!r)return void(l.edge=$r(e.site,l.site));Zr(e),Zr(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=r.site,m=p.x-c,v=p.y-h,g=2*(f*v-d*m),y=f*f+d*d,b=m*m+v*v,x={x:(v*y-d*b)/g+c,y:(f*b-m*y)/g+h};en(r.edge,u,p,x),l.edge=$r(u,t,null,x),r.edge=$r(t,p,null,x),Wr(e),Wr(r)}}function Vr(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;r=o.site;var s=r.x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function Hr(t,e){var r=t.N;if(r)return Vr(r,e);var n=t.site;return n.y===e?n.x:1/0}function qr(t){this.site=t,this.edges=[]}function Gr(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=nl,v=m.length;v--;)if((a=m[v])&&a.prepare())for(s=a.edges,l=s.length,o=0;oFo||xo(i-r)>Fo)&&(s.splice(o,0,new rn(tn(a.site,c,xo(n-h)Fo?{x:h,y:xo(e-h)Fo?{x:xo(r-p)Fo?{x:f,y:xo(e-f)Fo?{x:xo(r-d)=-jo)){var d=l*l+u*u,p=c*c+h*h,m=(h*d-u*p)/f,v=(l*p-c*d)/f,h=v+s,g=ll.pop()||new Xr;g.arc=t,g.site=i,g.x=m+o,g.y=h+Math.sqrt(m*m+v*v),g.cy=h,t.circle=g;for(var y=null,b=ol._;b;)if(g.y=s)return;if(f>p){if(a){if(a.y>=u)return}else a={x:v,y:l};r={x:v,y:u}}else{if(a){if(a.y1)if(f>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xa||h>o||f=x,M=r>=_,k=M<<1|w,A=k+4;ka&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:bn(r,n)})),a=hl.lastIndex;return a=0&&!(r=uo.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function kn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Sn(t){return t*t*t}function En(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Ln(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Vo)}function zn(t){return Math.pow(2,10*(t-1))}function In(t){return 1-Math.sqrt(1-t*t)}function Dn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bo/e)}}function Pn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function On(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Rn(t,e){t=uo.hcl(t),e=uo.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ft(r+a*t,n+o*t,i+s*t)+""}}function Fn(t,e){t=uo.hsl(t),e=uo.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ct(r+a*t,n+o*t,i+s*t)+""}}function jn(t,e){t=uo.lab(t),e=uo.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return pt(r+a*t,n+o*t,i+s*t)+""}}function Nn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Vn(e),i=Un(e,r),a=Vn(Hn(r,e,-i))||0;e[0]*r[1]180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(qn(r)+"rotate(",null,")")-2,x:bn(t,e)})):e&&r.push(qn(r)+"rotate("+e+")")}function Xn(t,e,r,n){t!==e?n.push({i:r.push(qn(r)+"skewX(",null,")")-2,x:bn(t,e)}):e&&r.push(qn(r)+"skewX("+e+")")}function Wn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(qn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(qn(r)+"scale("+e+")")}function Zn(t,e){var r=[],n=[];return t=uo.transform(t),e=uo.transform(e),Gn(t.translate,e.translate,r,n),Yn(t.rotate,e.rotate,r,n),Xn(t.skew,e.skew,r,n),Wn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function li(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++oi&&(n=r,i=e);return n}function bi(t){return t.reduce(xi,0)}function xi(t,e){return t+e[1]}function _i(t,e){return wi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wi(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Mi(t){return[uo.min(t),uo.max(t)]}function ki(t,e){return t.value-e.value}function Ai(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ti(t,e){t._pack_next=e,e._pack_prev=t}function Si(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Ei(t){function e(t){c=Math.min(t.x-t.r,c),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(u=r.length)){var r,n,i,a,o,s,l,u,c=1/0,h=-1/0,f=1/0,d=-1/0;if(r.forEach(Li),n=r[0],n.x=-n.r,n.y=0,e(n),u>1&&(i=r[1],i.x=i.r,i.y=0,e(i),u>2))for(a=r[2],Ii(n,i,a),e(a),Ai(n,a),n._pack_prev=a,Ai(a,i),i=n._pack_next,o=3;o=0;)e=i[a],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function ji(t,e,r){return t.a.parent===e.parent?t.a:r}function Ni(t){return 1+uo.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ui(t){var e=t.children;return e&&e.length?Ui(e[0]):t}function Vi(t){var e,r=t.children;return r&&(e=r.length)?Vi(r[e-1]):t}function Hi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function qi(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Gi(t){var e=t[0],r=t[t.length-1];return e2?Ji:Xi,l=n?Kn:Jn;return o=i(t,e,l,r),s=i(e,t,l,_n),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Nn)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ea(t,e)},a.tickFormat=function(e,r){return ra(t,e,r)},a.nice=function(e){return $i(t,e),i()},a.copy=function(){return Ki(t,e,r,n)},i()}function Qi(t,e){return uo.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $i(t,e){return Wi(t,Zi(ta(t,e)[2])),Wi(t,Zi(ta(t,e)[2])),t}function ta(t,e){null==e&&(e=10);var r=Gi(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function ea(t,e){return uo.range.apply(uo,ta(t,e))}function ra(t,e,r){var n=ta(t,e);if(r){var i=cs.exec(r);if(i.shift(),"s"===i[8]){var a=uo.formatPrefix(Math.max(xo(n[0]),xo(n[1])));return i[7]||(i[7]="."+na(a.scale(n[2]))),i[8]="f",r=uo.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+ia(i[8],n)),r=i.join("")}else r=",."+na(n[2])+"f";return uo.format(r)}function na(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ia(t,e){var r=na(e[2]);return t in Ml?Math.abs(r-na(Math.max(xo(e[0]),xo(e[1]))))+ +("e"!==t):r-2*("%"===t)}function aa(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Wi(n.map(i),r?Math:Al);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Gi(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(c-u)){if(r){for(;u0;f--)o.push(a(u)*f);for(u=0;o[u]l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,r){if(!arguments.length)return kl;arguments.length<2?r=kl:"function"!=typeof r&&(r=uo.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function xa(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,h=t[1]+u,f=e[0]+l,d=e[1]+u,p=(c+f)/2,m=(h+d)/2,v=f-c,g=d-h,y=v*v+g*g,b=r-n,x=c*d-f*h,_=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*g-v*_)/y,M=(-x*v-g*_)/y,k=(x*g+v*_)/y,A=(-x*v+g*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-u],[w*r/b,M*r/b]]}function _a(t){function e(e){function o(){u.push("M",a(t(c),s))}for(var l,u=[],c=[],h=-1,f=e.length,d=Et(r),p=Et(n);++h1?t.join("L"):t+"Z"}function Ma(t){return t.join("L")+"Z"}function ka(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1&&i.push("H",n[0]),i.join("")}function Aa(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;u9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function Ua(t){return t.length<3?wa(t):t[0]+Ca(t,Ba(t))}function Va(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,c,f,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=Dt(a,0,l),m=p[n]={tween:new h,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function ro(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function no(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function io(t){return t.toISOString()}function ao(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,a=uo.bisect(Jl,i);return a==Jl.length?[e.year,ta(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Jl[a-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=oo(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=oo(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Gi(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],oo(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ao(t.copy(),e,r)},Qi(n,t)}function oo(t){return new Date(t)}function so(t){return JSON.parse(t.responseText)}function lo(t){var e=fo.createRange();return e.selectNode(fo.body),e.createContextualFragment(t.responseText)}var uo={version:"3.5.17"},co=[].slice,ho=function(t){return co.call(t)},fo=this.document;if(fo)try{ho(fo.documentElement.childNodes)[0].nodeType}catch(t){ho=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var po=this.Element.prototype,mo=po.setAttribute,vo=po.setAttributeNS,go=this.CSSStyleDeclaration.prototype,yo=go.setProperty;po.setAttribute=function(t,e){mo.call(this,t,e+"")},po.setAttributeNS=function(t,e,r){vo.call(this,t,e,r+"")},go.setProperty=function(t,e,r){yo.call(this,t,e+"",r)}}uo.ascending=i,uo.descending=function(t,e){return et?1:e>=t?0:NaN},uo.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},uo.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},uo.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return l/(c-1)},uo.deviation=function(){var t=uo.variance.apply(this,arguments);return t?Math.sqrt(t):t};var bo=s(i);uo.bisectLeft=bo.left,uo.bisect=uo.bisectRight=bo.right,uo.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},uo.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},uo.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},uo.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var xo=Math.abs;uo.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=u(xo(r)),o=-1;if(t*=a,e*=a,r*=a,r<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,c,f,d=-1,p=o.length,m=a[s++],v=new h;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(uo.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},uo.set=function(t){var e=new b;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1), -t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},uo.event=null,uo.requote=function(t){return t.replace(ko,"\\$&")};var ko=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ao={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},To=function(t,e){return e.querySelector(t)},So=function(t,e){return e.querySelectorAll(t)},Eo=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Eo=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(To=function(t,e){return Sizzle(t,e)[0]||null},So=Sizzle,Eo=Sizzle.matchesSelector),uo.selection=function(){return uo.select(fo.documentElement)};var Lo=uo.selection.prototype=[];Lo.select=function(t){var e,r,n,i,a=[];t=C(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),zo.hasOwnProperty(r)?{space:zo[r],local:t}:t}},Lo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=uo.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(I(e,t[e]));return this}return this.each(I(t,e))},Lo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=O(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Lo.sort=function(t){t=q.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.transition().duration(L)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),M&&M.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){C++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--C||(t({type:"zoomend"}),v=null)}function h(){function t(){s=1,a(uo.mouse(i),f),u(o)}function r(){h.on(I,null).on(D,null),d(s),c(o)}var i=this,o=O.of(i,arguments),s=0,h=uo.select(n(i)).on(I,t).on(D,r),f=e(uo.mouse(i)),d=K(i);Bl.call(i),l(o)}function f(){function t(){var t=uo.touches(p);return d=k.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=uo.event.target;uo.select(e).on(x,n).on(_,s),w.push(e);for(var r=uo.event.changedTouches,i=0,a=r.length;i1){var c=l[0],h=l[1],f=c[0]-h[0],d=c[1]-h[1];g=f*f+d*d}}function n(){var t,e,r,n,o=uo.touches(p);Bl.call(p);for(var s=0,l=o.length;s=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,hs=uo.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=uo.round(t,Ft(t,e))).toFixed(Math.max(0,Math.min(20,Ft(t*(1+1e-15),e))))}}),fs=uo.time={},ds=Date;Ut.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(){ps.setUTCDate.apply(this._,arguments)},setDay:function(){ps.setUTCDay.apply(this._,arguments)},setFullYear:function(){ps.setUTCFullYear.apply(this._,arguments)},setHours:function(){ps.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ps.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ps.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ps.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ps.setUTCSeconds.apply(this._,arguments)},setTime:function(){ps.setTime.apply(this._,arguments)}};var ps=Date.prototype;fs.year=Vt(function(t){return t=fs.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),fs.years=fs.year.range,fs.years.utc=fs.year.utc.range,fs.day=Vt(function(t){var e=new ds(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),fs.days=fs.day.range,fs.days.utc=fs.day.utc.range,fs.dayOfYear=function(t){var e=fs.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=fs[t]=Vt(function(t){return(t=fs.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=fs.year(t).getDay();return Math.floor((fs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});fs[t+"s"]=r.range,fs[t+"s"].utc=r.utc.range,fs[t+"OfYear"]=function(t){var r=fs.year(t).getDay();return Math.floor((fs.dayOfYear(t)+(r+e)%7)/7)}}),fs.week=fs.sunday,fs.weeks=fs.sunday.range,fs.weeks.utc=fs.sunday.utc.range,fs.weekOfYear=fs.sundayOfYear;var ms={"-":"",_:" ",0:"0"},vs=/^\s*\d+/,gs=/^%/;uo.locale=function(t){return{numberFormat:Nt(t),timeFormat:qt(t)}};var ys=uo.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"]});uo.format=ys.numberFormat,uo.geo={},he.prototype={s:0,t:0,add:function(t){fe(t,this.t,bs),fe(bs.s,this.s,this),this.s?this.t+=bs.t:this.s=bs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bs=new he;uo.geo.stream=function(t,e){t&&xs.hasOwnProperty(t.type)?xs[t.type](t,e):de(t,e)};var xs={Feature:function(t,e){de(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ge([e*Ho,r*Ho]);if(g){var i=be(g,n),a=[i[1],-i[0],0],o=be(a,i);we(o),o=Me(o);var l=e-p,u=l>0?1:-1,m=o[0]*qo*u,v=xo(l)>180;if(v^(u*pd&&(d=y)}else if(m=(m+360)%360-180,v^(u*pd&&(d=r);v?es(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e):f>=c?(ef&&(f=e)):e>p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e)}else t(e,r);g=n,p=e}function r(){_.point=e}function n(){x[0]=c,x[1]=f,_.point=t,g=null}function i(t,r){if(g){var n=t-p;y+=xo(n)>180?n+(n>0?360:-360):n}else m=t,v=r;ks.point(t,r),e(t,r)}function a(){ks.lineStart()}function o(){i(m,v),ks.lineEnd(),xo(y)>Fo&&(c=-(f=180)),x[0]=c,x[1]=f,g=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tFo?d=90:y<-Fo&&(h=-90),x[0]=c,x[1]=f}};return function(t){d=f=-(c=h=1/0),b=[],uo.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r,n=1,i=b[0],a=[i];ns(i[0],i[1])&&(i[1]=r[1]),s(r[0],i[1])>s(i[0],i[1])&&(i[0]=r[0])):a.push(i=r);for(var o,r,p=-1/0,e=a.length-1,n=0,i=a[e];n<=e;i=r,++n)r=a[n],(o=s(i[1],r[0]))>p&&(p=o,c=r[0],f=i[1])}return b=x=null,c===1/0||h===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,h],[f,d]]}}(),uo.geo.centroid=function(t){As=Ts=Ss=Es=Ls=Cs=zs=Is=Ds=Ps=Os=0,uo.geo.stream(t,Rs);var e=Ds,r=Ps,n=Os,i=e*e+r*r+n*n;return i=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var u=a.scale(),c=+e[0],h=+e[1];return r=a.translate(e).clipExtent([[c-.455*u,h-.238*u],[c+.455*u,h+.238*u]]).stream(l).point,n=o.translate([c-.307*u,h+.201*u]).clipExtent([[c-.425*u+Fo,h+.12*u+Fo],[c-.214*u-Fo,h+.234*u-Fo]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+Fo,h+.166*u+Fo],[c-.115*u-Fo,h+.234*u-Fo]]).stream(l).point,t},t.scale(1070)};var Ns,Bs,Us,Vs,Hs,qs,Gs={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Bs=0,Gs.lineStart=We},polygonEnd:function(){Gs.lineStart=Gs.lineEnd=Gs.point=M,Ns+=xo(Bs/2)}},Ys={point:Ze,lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M},Xs={point:Qe,lineStart:$e,lineEnd:tr,polygonStart:function(){Xs.lineStart=er},polygonEnd:function(){Xs.point=Qe,Xs.lineStart=$e,Xs.lineEnd=tr}};uo.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),uo.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Ns=0,uo.geo.stream(t,i(Gs)),Ns},t.centroid=function(t){return Ss=Es=Ls=Cs=zs=Is=Ds=Ps=Os=0,uo.geo.stream(t,i(Xs)),Os?[Ds/Os,Ps/Os]:Is?[Cs/Is,zs/Is]:Ls?[Ss/Ls,Es/Ls]:[NaN,NaN]},t.bounds=function(t){return Hs=qs=-(Us=Vs=1/0),uo.geo.stream(t,i(Ys)),[[Us,Vs],[Hs,qs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||ir(t):x,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Je:new rr(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(uo.geo.albersUsa()).context(null)},uo.geo.transform=function(t){return{stream:function(e){var r=new ar(e);for(var n in t)r[n]=t[n];return r}}},ar.prototype={point:function(t,e){this.stream.point(t,e)},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()}},uo.geo.projection=sr,uo.geo.projectionMutator=lr,(uo.geo.equirectangular=function(){return sr(cr)}).raw=cr.invert=cr,uo.geo.rotation=function(t){function e(e){return e=t(e[0]*Ho,e[1]*Ho),e[0]*=qo,e[1]*=qo,e}return t=fr(t[0]%360*Ho,t[1]*Ho,t.length>2?t[2]*Ho:0),e.invert=function(e){return e=t.invert(e[0]*Ho,e[1]*Ho),e[0]*=qo,e[1]*=qo,e},e},hr.invert=cr,uo.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=fr(-t[0]*Ho,-t[1]*Ho,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=qo,t[1]*=qo}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*Ho,i*Ho),t):e},t.precision=function(n){return arguments.length?(r=vr(e*Ho,(i=+n)*Ho),t):i},t.angle(90)},uo.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ho,i=t[1]*Ho,a=e[1]*Ho,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=u*c-l*h*s)*r),l*c+u*h*s)},uo.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return uo.range(Math.ceil(a/v)*v,i,v).map(f).concat(uo.range(Math.ceil(u/g)*g,l,g).map(d)).concat(uo.range(Math.ceil(n/p)*p,r,p).filter(function(t){return xo(t%v)>Fo}).map(c)).concat(uo.range(Math.ceil(s/m)*m,o,m).filter(function(t){return xo(t%g)>Fo}).map(h))}var r,n,i,a,o,s,l,u,c,h,f,d,p=10,m=p,v=90,g=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[a,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],g=+e[1],t):[v,g]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=yr(s,o,90),h=br(n,r,y),f=yr(u,l,90),d=br(a,i,y),t):y},t.majorExtent([[-180,-90+Fo],[180,90-Fo]]).minorExtent([[-180,-80-Fo],[180,80+Fo]])},uo.geo.greatArc=function(){function t(){return{ -type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=xr,i=_r;return t.distance=function(){return uo.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},uo.geo.interpolate=function(t,e){return wr(t[0]*Ho,t[1]*Ho,e[0]*Ho,e[1]*Ho)},uo.geo.length=function(t){return Ws=0,uo.geo.stream(t,Zs),Ws};var Ws,Zs={sphere:M,point:M,lineStart:Mr,lineEnd:M,polygonStart:M,polygonEnd:M},Js=kr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(uo.geo.azimuthalEqualArea=function(){return sr(Js)}).raw=Js;var Ks=kr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(uo.geo.azimuthalEquidistant=function(){return sr(Ks)}).raw=Ks,(uo.geo.conicConformal=function(){return Ye(Ar)}).raw=Ar,(uo.geo.conicEquidistant=function(){return Ye(Tr)}).raw=Tr;var Qs=kr(function(t){return 1/t},Math.atan);(uo.geo.gnomonic=function(){return sr(Qs)}).raw=Qs,Sr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(uo.geo.mercator=function(){return Er(Sr)}).raw=Sr;var $s=kr(function(){return 1},Math.asin);(uo.geo.orthographic=function(){return sr($s)}).raw=$s;var tl=kr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(uo.geo.stereographic=function(){return sr(tl)}).raw=tl,Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Vo]},(uo.geo.transverseMercator=function(){var t=Er(Lr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Lr,uo.geom={},uo.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Et(r),a=Et(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e=n&&u.x<=a&&u.y>=i&&u.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Fo)*Fo,y:Math.round(o(t,e)/Fo)*Fo,i:e}})}var n=Cr,i=zr,a=n,o=i,s=ul;return t?e(t):(e.links=function(t){return un(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return un(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(Yr),s=-1,l=o.length,u=o[l-1].edge,c=u.l===a?u.r:u.l;++s=u,f=n>=c,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=pn()),h?i=u:s=u,f?o=c:l=c,a(t,e,r,n,i,o,s,l)}var c,h,f,d,p,m,v,g,y,b=Et(s),x=Et(l);if(null!=e)m=e,v=r,g=n,y=i;else if(g=y=-(m=v=1/0),h=[],f=[],p=t.length,o)for(d=0;dg&&(g=c.x),c.y>y&&(y=c.y),h.push(c.x),f.push(c.y);else for(d=0;dg&&(g=_),w>y&&(y=w),h.push(_),f.push(w)}var M=g-m,k=y-v;M>k?y=v+M:g=m+k;var A=pn();if(A.add=function(t){a(A,t,+b(t,++d),+x(t,d),m,v,g,y)},A.visit=function(t){mn(t,A,m,v,g,y)},A.find=function(t){return vn(A,t[0],t[1],m,v,g,y)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=dl.get(r)||fl,n=pl.get(n)||x,Mn(n(r.apply(null,co.call(arguments,1))))},uo.interpolateHcl=Rn,uo.interpolateHsl=Fn,uo.interpolateLab=jn,uo.interpolateRound=Nn,uo.transform=function(t){var e=fo.createElementNS(uo.ns.prefix.svg,"g");return(uo.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:ml)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ml={a:1,b:0,c:0,d:1,e:0,f:0};uo.interpolateTransform=Zn,uo.layout={},uo.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,u.end({type:"end",alpha:i=0})):t>0&&(u.start({type:"start",alpha:i=t}),r=Dt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;n&&(a.value=0),a.children=u}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return li(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=hi,r=ui,n=ci;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(si(e,function(t){t.children&&(t.value=0)}),li(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},uo.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=c[0]&&s<=c[1]&&(o=l[uo.bisect(h,s,1,d)-1],o.y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Mi,i=_i;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Et(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return wi(t,e)}:Et(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},uo.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,li(s,function(t){t.r=+c(t.value)}),li(s,Ei),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;li(s,function(t){t.r+=h}),li(s,Ei),li(s,function(t){t.r-=h})}return zi(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,r=uo.layout.hierarchy().sort(ki),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},oi(t,r)},uo.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),h=c[0],f=e(h);if(li(f,r),f.parent.m=-f.z,si(f,n),u)si(h,a);else{var d=h,p=h,m=h;si(h,function(t){t.xp.x&&(p=t),t.depth>m.depth&&(m=t)});var v=s(d,p)/2-d.x,g=l[0]/(p.x+s(p,d)/2+v),y=l[1]/(m.depth||1);si(h,function(t){t.x=(t.x+v)*g,t.y=t.depth*y})}return c}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o0&&(Ri(ji(o,t,r),t,n),u+=n,c+=n),h+=o.m,u+=i.m,f+=l.m,c+=a.m;o&&!Oi(a)&&(a.t=o,a.m+=h-c),i&&!Pi(l)&&(l.t=i,l.m+=u-f,r=t)}return r}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=uo.layout.hierarchy().sort(null).value(null),s=Di,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?a:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:a,t):u?l:null},oi(t,o)},uo.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;li(l,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Ni(e)):(t.x=o?u+=r(t,o):0,t.y=0,o=t)});var c=Ui(l),h=Vi(l),f=c.x-r(c,h)/2,d=h.x+r(h,c)/2;return li(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=uo.layout.hierarchy().sort(null).value(null),r=Di,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},oi(t,e)},uo.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(o=f[l-1]),c.area+=o.area,"squarify"!==d||(s=n(c,m))<=p?(f.pop(),p=s):(c.area-=c.pop().area,i(c,m,u,!1),m=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,m,u,!0),c.length=c.area=0),a.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var a,o=h(e),s=n.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*p/n,n/(e*a*p)):1/0}function i(t,e,r,n){var i,a=-1,o=t.length,s=r.x,u=r.y,c=e?l(t.area/e):0;if(e==r.dx){for((n||c>r.dy)&&(c=r.dy);++ar.dx)&&(c=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=uo.random.normal.apply(uo,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=uo.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rh?0:1;if(u=Uo)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,m,v,g,y,b,x,_,w,M,k,A,T=0,S=0,E=[];if((g=(+l.apply(this,arguments)||0)/2)&&(v=a===Cl?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(S*=-1),u&&(S=nt(v/u*Math.sin(g))),t&&(T=nt(v/t*Math.sin(g)))),u){y=u*Math.cos(c+S),b=u*Math.sin(c+S),x=u*Math.cos(h-S),_=u*Math.sin(h-S);var L=Math.abs(h-c-2*S)<=No?0:1;if(S&&ba(y,b,x,_)===d^L){var C=(c+h)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(h-T),M=t*Math.sin(h-T),k=t*Math.cos(c+T),A=t*Math.sin(c+T);var z=Math.abs(c-h+2*T)<=No?0:1;if(T&&ba(w,M,k,A)===1-d^z){var I=(c+h)/2;w=t*Math.cos(I),M=t*Math.sin(I),k=A=null}}else w=M=0;if(f>Fo&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=tNo)+",1 "+e}function i(t,e,r,n){return"Q 0,0 "+n}var a=xr,o=_r,s=qa,l=va,u=ga;return t.radius=function(e){return arguments.length?(s=Et(e),t):s},t.source=function(e){return arguments.length?(a=Et(e),t):a},t.target=function(e){return arguments.length?(o=Et(e),t):o},t.startAngle=function(e){return arguments.length?(l=Et(e),t):l},t.endAngle=function(e){return arguments.length?(u=Et(e),t):u},t},uo.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return l=l.map(n),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=xr,r=_r,n=Ga;return t.source=function(r){return arguments.length?(e=Et(r),t):e},t.target=function(e){return arguments.length?(r=Et(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},uo.svg.diagonal.radial=function(){var t=uo.svg.diagonal(),e=Ga,r=t.projection;return t.projection=function(t){return arguments.length?r(Ya(e=t)):e},t},uo.svg.symbol=function(){function t(t,n){return(Ol.get(e.call(this,t,n))||Za)(r.call(this,t,n))}var e=Wa,r=Xa;return t.type=function(r){return arguments.length?(e=Et(r),t):e},t.size=function(e){return arguments.length?(r=Et(e),t):r},t};var Ol=uo.map({circle:Za,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Fl)),r=e*Fl;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Rl),r=e*Rl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Rl),r=e*Rl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});uo.svg.symbolTypes=Ol.keys();var Rl=Math.sqrt(3),Fl=Math.tan(30*Ho);Lo.transition=function(t){for(var e,r,n=jl||++Vl,i=to(t),a=[],o=Nl||{time:Date.now(),ease:En,delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){32==uo.event.keyCode&&(L||(b=null,z[0]-=h[1],z[1]-=f[1],L=2),T())}function m(){32==uo.event.keyCode&&2==L&&(z[0]+=h[1],z[1]+=f[1],L=0,T())}function v(){var t=uo.mouse(_),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),L||(uo.event.altKey?(b||(b=[(h[0]+h[1])/2,(f[0]+f[1])/2]),z[0]=h[+(t[0]=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;e<=o;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&o)for(var h=0;h>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:75}],123:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return i(0|t,e);break;case"object":if("number"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],124:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,s=i(t,0,a,r,!0),l=[];if(!s)return l;var u,c,f,d,p,m,v;if(n&&(s=h(t,e,s,r)),t.length>80*r){u=f=t[0],c=d=t[1];for(var g=r;gf&&(f=p),m>d&&(d=m);v=Math.max(f-u,d-c)}return o(s,l,r,u,c,v),l}function i(t,e,r,n,i){var a,o;if(i===z(t,e,r,n)>0)for(a=e;a=e;a-=n)o=E(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(L(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(L(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,h,f){if(t){!f&&h&&m(t,n,i,h);for(var d,p,v=t;t.prev!==t.next;)if(d=t.prev,p=t.next,h?l(t,n,i,h):s(t))e.push(d.i/r),e.push(t.i/r),e.push(p.i/r),L(t),t=p.next,v=p.next;else if((t=p)===v){f?1===f?(t=u(t,e,r),o(t,e,r,n,i,h,2)):2===f&&c(t,e,r,n,i,h):o(a(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(b(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(_(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=g(s,l,e,r,n),f=g(u,c,e,r,n),d=t.nextZ;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!w(i,a)&&M(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),L(n),L(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=S(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,r,n,i,s),void o(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e,r,n){var o,s,l,u,c,h=[];for(o=0,s=e.length;o=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&b(ar.x)&&A(n,t)&&(r=n,f=l),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=g(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1);return t}function g(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!k(t,e)&&A(t,e)&&A(e,t)&&T(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||_(t,e,r)>0!=_(t,e,n)>0&&_(r,n,t)>0!=_(r,n,e)>0}function k(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function A(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function T(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}function S(t,e){var r=new C(t.i,t.x,t.y),n=new C(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function E(t,e,r,n){var i=new C(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function L(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function z(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],125:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var n=0;n0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this}, -n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],128:[function(t,e,r){"use strict";function n(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}e.exports=n},{}],129:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],130:[function(t,e,r){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===e?o(t[1],t[2],"===",!1):"!="===e?o(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?o(t[1],t[2],e,!0):"any"===e?s(t.slice(1),"||"):"all"===e?s(t.slice(1),"&&"):"none"===e?c(s(t.slice(1),"||")):"in"===e?l(t[1],t.slice(2)):"!in"===e?c(l(t[1],t.slice(2))):"has"===e?u(t[1]):"!has"===e?c(u([t[1]])):"true")+")"}function a(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,r,n){var i=a(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+o+"&&":"")+i+r+o}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(h)),n=a(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function u(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function h(t,e){return te?1:0}e.exports=n;var f=["Unknown","Point","LineString","Polygon"]},{}],131:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;d=r-1)for(var c=a.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)i.push(n(l[h-1],u[h-1],arguments[h])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(u[f-1],c[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},u.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],u[f-1],i[o++]+d)),a.push(d*h)}}},u.idle=function(t){var e=this.lastT();if(!(t=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":64,"cubic-hermite":107}],132:[function(t,e,r){"use strict";function n(t){t=t||{};var e,r,n=t.canvas||document.createElement("canvas"),o=t.family||"sans-serif",s=t.shape||[512,512],l=t.step||[32,32],u=parseFloat(t.size)||16,c=t.chars||[32,126],h=Math.floor((l[0]-u)/2),f=t.radius||1.5*h,d=new a(u,h,f,0,o),p=null==t.align?"optical":t.align,m=null==t.fit||1==t.fit?.5:t.fit;if(Array.isArray(c)){if(2===c.length&&"number"==typeof c[0]&&"number"==typeof c[1]){var v=[];for(e=c[0],r=0;e<=c[1];e++)v[r++]=String.fromCharCode(e);c=v}}else c=String(c).split("");s=s.slice(),n.width=s[0],n.height=s[1];var g=n.getContext("2d");g.fillStyle="#000",g.fillRect(0,0,n.width,n.height),g.textBaseline="middle";var y=l[0],b=l[1],x=0,_=0,w=u/b,M=Math.min(c.length,Math.floor(s[0]/y)*Math.ceil(s[1]/b)),k=d.ctx.textAlign,A=d.buffer,T=d.middle;for(d.ctx.textAlign="center",d.buffer=d.size/2,e=0;es[0]-l[0]&&(x=0,_+=l[1])}return d.ctx.textAlign=k,d.buffer=A,d.middle=T,n}function i(t,e,r){if(s[e]&&s[e][t])return s[e][t];var n=200*r,i=o(t,{size:200,fontSize:n,fontFamily:e});s[e]||(s[e]={});var a={center:[i.center[0]/200,i.center[1]/200],bounds:i.bounds.map(function(t){return t/200}),radius:i.radius/200};return s[e][t]=a,a}var a=t("tiny-sdf"),o=t("optical-properties");e.exports=n;var s={}},{"optical-properties":469,"tiny-sdf":531}],133:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r||(e.right?l(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){if(n.left){var i=u(t,e,r,n.left);if(i)return i}var i=r(n.key,n.value);if(i)return i}if(n.right)return u(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=g);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=g,r._color=g,s._color=g,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===v){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=g,n._color=g,e._color=g,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===g){if(r._color===v)return r._color=g,void(r.right=a(v,n));r.right=a(v,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+11){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===v){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=g,n._color=g,e._color=g,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===g){if(r._color===v)return r._color=g,void(r.left=a(v,n));r.left=a(v,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1e?1:0}function m(t){return new s(t||p,null)}e.exports=m;var v=0,g=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=c<=0?i.left:i.right}l.push(new n(v,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){var i=l[h];u[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(var h=l.length-1;h>1;--h){var f=l[h-1],i=l[h];if(f._color===g||i._color===g)break;var d=l[h-2];if(d.left===f)if(f.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=f.right,f._color=g,f.right=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.left===d?m.left=f:m.right=f}break}f._color=g,d.right=a(g,p),d._color=v,h-=1}else{var p=d.right;if(!p||p._color!==v){if(f.right=i.left,d._color=v,d.left=i.right,i._color=g,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.left===d?m.left=i:m.right=i}break}f._color=g,d.right=a(g,p),d._color=v,h-=1}else if(f.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=f.left,f._color=g,f.left=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.right===d?m.right=f:m.left=f}break}f._color=g,d.left=a(g,p),d._color=v,h-=1}else{var p=d.left;if(!p||p._color!==v){if(f.left=i.right,d._color=v,d.right=i.left,i._color=g,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.right===d?m.right=i:m.left=i}break}f._color=g,d.left=a(g,p),d._color=v,h-=1}}return l[0]._color=g,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),y.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var b=h.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new h(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===v){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],134:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],135:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(a(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}var u=t("geojson-area");e.exports=n},{"geojson-area":135}],137:[function(t,e,r){"use strict";function n(t,e,r,n,o,l,u,c){if(r/=e,n/=e,u>=r&&c<=n)return t;if(u>n||c=r&&p<=n)h.push(m);else if(!(d>n||p=e&&s<=r&&i.push(o)}return i}function a(t,e,r,n,i,a){for(var s=[],l=0;lr?(x.push(i(u,p,e),i(u,p,r)),a||(x=o(s,x,v,g,y))):d>=e&&x.push(i(u,p,e)):f>r?dr&&(x.push(i(u,p,r)),a||(x=o(s,x,v,g,y))));u=m[b-1],f=u[n],f>=e&&f<=r&&x.push(u),h=x[x.length-1],a&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),o(s,x,v,g,y)}return s}function o(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":139}],138:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,a=0;a1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),b=this.tiles[y]=p(t,g,r,n,x,e===d.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,i){if(e===d.maxZoom||e===i)continue;var w=1<1&&console.time("clipping");var M,k,A,T,S,E,L=.5*d.buffer/d.extent,C=.5-L,z=.5+L,I=1+L;M=k=A=T=null,S=f(t,g,r-L,r+z,0,o,b.min[0],b.max[0]),E=f(t,g,r+C,r+I,0,o,b.min[0],b.max[0]),S&&(M=f(S,g,n-L,n+z,1,s,b.min[1],b.max[1]),k=f(S,g,n+C,n+I,1,s,b.min[1],b.max[1])),E&&(A=f(E,g,n-L,n+z,1,s,b.min[1],b.max[1]),T=f(E,g,n+C,n+I,1,s,b.min[1],b.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(h.push(M||[],e+1,2*r,2*n),h.push(k||[],e+1,2*r,2*n+1),h.push(A||[],e+1,2*r+1,2*n),h.push(T||[],e+1,2*r+1,2*n+1))}else i&&(v=e)}return v},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,f=t,d=e,p=r;!c&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),c=this.tiles[a(f,d,p)];if(!c||!c.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",f,d,p),u(c,i,n.buffer))return h.tile(c,i);o>1&&console.time("drilling down");var m=this.splitTile(c.source,f,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var v=1<n&&(o=r,n=a);n>s?(t[o][2]=n,h.push(u),h.push(o),u=o):(c=h.pop(),u=h.pop())}}function i(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],u=a-n,c=o-i;if(0!==u||0!==c){var h=((s-n)*u+(l-i)*c)/(u*u+c*c);h>1?(n=a,i=o):h>0&&(n+=u*h,i+=c*h)}return u=s-n,c=l-i,u*u+c*c}e.exports=n},{}],142:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;ls.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,o,s,l,u=e.geometry,c=e.type,h=[],f=r*r;if(1===c)for(i=0;if)&&(d.push(l),t.numSimplified++),t.numPoints++;3===c&&a(d,s.outer),h.push(d)}else t.numPoints+=s.length;if(h.length){var p={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function a(t,e){o(t)<0===e&&t.reverse()}function o(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),u=t("./lib/lines.js"),c=t("./lib/background.js"),h=t("./lib/cube.js"),f=t("./lib/ticks.js"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){ -function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var m=[new a,new a,new a],v=[0,0,0],g={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];p.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=h(r,i,a,s),u=l.cubeEdges,c=l.axis,f=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*f+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=c[k];for(var A=m,k=0;k<3;++k)o(m[k],k,this.bounds,u,c);for(var e=this.gl,T=v,k=0;k<3;++k)this.backgroundEnable[k]?T[k]=c[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(var k=0;k<3;++k){var S=[0,0,0];c[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);for(var z=n(y,A[k].primalMinor),I=n(b,A[k].mirrorMinor),D=this.lineTickLength,E=0;E<3;++E){var P=M/r[5*E];z[E]*=D[E]*P,I[E]*=D[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,I,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var k=0;k<3;++k){for(var O=A[k].primalMinor,R=n(x,A[k].primalOffset),E=0;E<3;++E)this.lineTickEnable[k]&&(R[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(var E=0;E<3;++E)R[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],R,this.tickColor[k])}if(this.labelEnable[k]){for(var E=0;E<3;++E)R[E]+=M*O[E]*this.labelPad[E]/r[5*E];R[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],R,this.labelColor[k])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":147,"./lib/cube.js":148,"./lib/lines.js":149,"./lib/text.js":151,"./lib/ticks.js":152}],147:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[u]=p;for(var m=-1;m<=1;m+=2)h[c]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),i+=1}var v=u;u=c,c=v}var g=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:g,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,g,b,x)}e.exports=i;var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders").bg,l=n.prototype;l.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":150,"gl-buffer":154,"gl-vao":269}],148:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<f[m][1]&&(O=m));for(var R=-1,m=0;m<3;++m){var F=O^1<f[j][0]&&(j=F)}}var N=v;N[0]=N[1]=N[2]=0,N[o.log2(R^O)]=O&R,N[o.log2(O^j)]=O&j;var B=7^j;B===_||B===P?(B=7^R,N[o.log2(j^B)]=B&j):N[o.log2(R^B)]=B&R;for(var U=g,V=_,k=0;k<3;++k)U[k]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}","precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":253}],151:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return l(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}function a(t,e,r,i,a,l){var c=o(t),h=s(t,[{buffer:c,size:3}]),f=u(t);f.attributes.position.location=0;var d=new n(t,f,c,h);return d.update(e,r,i,a,l),d}e.exports=a;var o=t("gl-buffer"),s=t("gl-vao"),l=t("vectorize-text"),u=t("./shaders").text,c=window||r.global||{},h=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var f=n.prototype,d=[0,0];f.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},f.update=function(t,e,r,n,a){function o(t,e,r,n){var a=h[r];a||(a=h[r]={});var o=a[e];o||(o=a[e]=i(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=o.positions,c=o.cells,f=0,d=c.length;f=0;--m){var v=u[p[m]];s.push(l*v[0],-l*v[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],f=[0,0,0],d=0;d<3;++d){c[d]=s.length/3|0,o(.5*(t[0][d]+t[1][d]),e[d],r),f[d]=(s.length/3|0)-c[d],l[d]=s.length/3|0;for(var p=0;p=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var h=""+u;h.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),o=new n(t,r,a,0,i);return o.update(e),o}var l=t("typedarray-pool"),u=t("ndarray-ops"),c=t("ndarray"),h=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],f=n.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)},f.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(h.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=l.malloc(t.size,r),s=c(n,t.shape);u.assign(s,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),l.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,f,e):i(this.gl,this.type,this.length,this.usage,f.subarray(0,t.length),e),l.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");t|=0,t<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:465,"ndarray-ops":459,"typedarray-pool":539}],155:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],156:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":155}],157:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-1/0,-1/0],this.numPoints=0,this.color=[0,0,0,1]}function i(t,e){var r=a(t.gl,l.vertex,l.fragment),i=o(t.gl),s=o(t.gl),u=new n(t,r,i,s);return u.update(e),t.addObject(u),u}var a=t("gl-shader"),o=t("gl-buffer"),s=t("typedarray-pool"),l=t("./lib/shaders");e.exports=i;var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,l=this.numPoints;if(l){var c=a.gl,h=a.dataBox,f=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],v=h[2]-h[0],g=h[3]-h[1],y=2*p/v,b=2*m/g,x=(s[0]-h[0]-.5*v)/p,_=(s[1]-h[1]-.5*g)/m;t[0]=y,t[1]=b,e[0]=y-t[0],e[1]=b-t[1],r[0]=x,r[1]=_,n[0]=x-r[0],n[1]=_-r[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(c.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(c.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(c.FLOAT,!1,16,8),c.drawArrays(c.TRIANGLES,0,l*u.length)}}}(),c.drawPick=function(t){return t},c.pick=function(){return null},c.update=function(t){t=t||{};var e,r,n,i=t.positions||[],a=t.errors||[],o=1;"lineWidth"in t&&(o=+t.lineWidth);var l=5;"capSize"in t&&(l=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var c=this.bounds=[1/0,1/0,-1/0,-1/0],h=this.numPoints=i.length>>1;for(e=0;e0&&(T*=_),S<0?S*=w:S>0&&(S*=M),v[b++]=f*(r-p+T),v[b++]=d*(n-m+S),v[b++]=o*A[2]+(l+o)*A[4],v[b++]=o*A[3]+(l+o)*A[5]}}for(e=0;e=1},h.isTransparent=function(){return this.opacity<1},h.drawTransparent=h.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();h.update=function(t){t=t||{},"lineWidth"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c0){var m=h.slice();m[u]+=d[1][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":161,"gl-buffer":154,"gl-vao":269}],160:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&f.drawBuffersWEBGL(y[h]);var g=r.getExtension("WEBGL_depth_texture");g?d?t.depth=s(r,u,c,g.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),u=0;uo||r<0||r>o)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if((s=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var h=!0;"depth"in n&&(h=!!n.depth);var f=!1;return"stencil"in n&&(f=!!n.stencil),new c(t,e,r,l,s,h,f,i)}var d=t("gl-texture2d");e.exports=f;var p,m,v,g,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return h(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,h(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},h.update=function(t){t=t||{};var e=t.shape||[0,0],r=t.x||o(e[0]),n=t.y||o(e[1]),i=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=h[2]=r[r.length-1],v=h[3]=n[n.length-1],g=1/(m-d),y=1/(v-p),b=e[0],x=e[1];this.shape=[b,x];var _=(b-1)*(x-1)*(f.length>>>1);this.numVertices=_;for(var w=s.mallocUint8(4*_),M=s.mallocFloat32(2*_),k=s.mallocUint8(2*_),A=s.mallocUint32(_),T=0,S=0;S2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,a),x.color=c,x.radius=s*u,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),f.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,u=this.pickShader,c=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,u.bind();var h=u.uniforms;this.setProjectionUniforms(h,i),h.width=o*l,h.pickOffset=t;var f=u.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),c.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},f.update=function(t){t=t||{};var e,r,n,a,o,s=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=t.dashes||[1],f=0;for(e=0;e1,this.dashPattern=l(s,u(d,[f,1,4],[1,0,0])),this.dashPattern.minFilter=s.NEAREST,this.dashPattern.magFilter=s.NEAREST,this.dashLength=f,c.free(d);var m=t.positions;this.data=m;var v=this.bounds;v[0]=v[1]=1/0,v[2]=v[3]=-1/0;var g=this.numPoints=m.length>>>1;if(0!==g){for(e=0;e1;){var A=--n;a=m[2*n],o=m[2*n+1];var T=A-1,S=m[2*T],E=m[2*T+1];if(!(isNaN(a)||isNaN(o)||isNaN(S)||isNaN(E))){k+=1,a=(a-v[0])/(v[2]-v[0]),o=(o-v[1])/(v[3]-v[1]),S=(S-v[0])/(v[2]-v[0]),E=(E-v[1])/(v[3]-v[1]);var L=S-a,C=E-o,z=A|1<<24,I=A-1,D=A,P=A-1|1<<24;y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=I,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=D,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=E,y[--w]=S,_[--M]=D,_[--M]=P,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=D,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=I,y[--w]=C,y[--w]=L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=I}}for(e=0;e FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":253}],170:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=m(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3, -r.attributes.color.location=4;var n=v(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),h=0;h<1024;++h)s.data[h]=255;var f=c(e,s);f.wrap=e.REPEAT;var p=new o(e,r,n,i,a,f);return p.update(t),p}e.exports=s;var l=t("gl-buffer"),u=t("gl-vao"),c=t("gl-texture2d"),h=t("glsl-read-float"),f=t("binary-search-bounds"),d=t("ndarray"),p=t("./lib/shaders"),m=p.createShader,v=p.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],h=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],v=!1;t:for(e=1;e0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,v=!0}continue t}m[0][r]=Math.min(m[0][r],g[r],y[r]),m[1][r]=Math.max(m[1][r],g[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=h;if(h+=n(g,y),v){for(r=0;r<2;++r)l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,v=!1}l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],g[0],g[1],g[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],g[0],g[1],g[2],h,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],g[0],g[1],g[2],h,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(h),c.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=c,this.arcLength=u,"dashes"in t){var k=t.dashes,A=k.slice();for(A.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,c=o+o,h=i*l,f=i*u,d=i*c,p=a*u,m=a*c,v=o*c,g=s*l,y=s*u,b=s*c,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+v))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*_,t[5]=(1-(h+v))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-g)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,h=s+s,f=a*u,d=a*c,p=a*h,m=o*c,v=o*h,g=s*h,y=l*u,b=l*c,x=l*h,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+g))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(v-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-h-p,t[1]=c+g,t[2]=f-v,t[3]=0,t[4]=c-g,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+v,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,u,c,h,f,d,p,m,v=e[0],g=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(v-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*c+o*s+i*u-a*l,t[1]=i*c+o*l+a*s-n*u,t[2]=a*c+o*u+n*l-i*s,t[3]=o*c-n*s-i*l-a*u,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],v=r[3];return a=u*d+c*p+h*m+f*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*v,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":192,"./mat3.js":195,"./vec3.js":199,"./vec4.js":200}],198:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*u+i[0]*c,t[1]=e[1]*s+r[1]*l+n[1]*u+i[1]*c,t[2]=e[2]*s+r[2]*l+n[2]*u+i[2]*c,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,c=3*a*s,h=3*l*o,f=l*a;return t[0]=e[0]*u+r[0]*c+n[0]*h+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*h+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*h+i[2]*f,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":192}],200:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}, -i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;v+=m[c]}return Math.abs(v-1)>.001?null:[h,o(t,m),m]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:47,"polytope-closest-point/lib/closest_point_2d.js":484}],202:[function(t,e,r){var n="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}";r.meshShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],203:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_,w,M,k,A,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=g,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=x,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=D,this._view=D,this._projection=D,this._resolution=[1,1]}function i(t){for(var e=w({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i=1},P.isTransparent=function(){return this.opacity<1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t},P.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=M(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=k.mallocFloat32(6*a),s=0,l=0;l0){var f=this.triShader;f.bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var f=this.lineShader;f.bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var f=this.pointShader;f.bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var f=this.contourShader;f.bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},P.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||D,n=t.view||D,i=t.projection||D,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},P.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;as[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n],a.uniforms.angle=g[n],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n]&&M&&(e[1^n]-=T*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,M)),e[1^n]=T*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],ks[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n+2],a.uniforms.angle=g[n+2],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n+2]&&M&&(e[1^n]+=T*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],h=a[u+2],f=h-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],m=l[u],v=l[u+2],g=v-m,y=s[u],b=s[u+2],x=b-y;e[u]=2*f/p*g/x,t[u]=2*(c-d)/p*g/x}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,o=[],l=t.ticks,u=t.bounds;for(a=0;a<2;++a){var c=[Math.floor(o.length/3)],h=[-1/0],f=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;w[b]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":211,"./lib/create-attributes":212,"./lib/create-uniforms":213,"./lib/reflect":214,"./lib/runtime-reflect":215,"./lib/shader-cache":216}],211:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],212:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;c=0){var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);i(t,e,d[0],n,p,o,h)}else{if(!(f.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+h+": "+f);var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);a(t,e,d,n,p,o,h)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":211}],213:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function h(e){for(var n=["return function updateProperty(obj){"],i=c("",e),o=0;o4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:h(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:h(i),enumerable:!0,configurable:!1}):t[e]=f(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],f[p]):o.drawLine(e[0],m,e[2],m,d[p],f[p])}}for(var p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return"boolean"!=typeof t||t}function s(t){function e(){if(!w&&G.autoResize){var t=M.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*G.pixelRatio),i=0|Math.ceil(r*G.pixelRatio);if(n!==M.width||i!==M.height){M.width=n,M.height=i;var a=M.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",N=!0}}}function r(){for(var t=O.length,e=j.length,r=0;r0&&0===F[e-1];)F.pop(),j.pop().dispose()}function s(){if(G.contextLost)return!0;A.isContextLost()&&(G.contextLost=!0,G.mouseListener.enabled=!1,G.selection.object=null,G.oncontextloss&&G.oncontextloss())}function b(){if(!s()){A.colorMask(!0,!0,!0,!0),A.depthMask(!0),A.disable(A.BLEND),A.enable(A.DEPTH_TEST);for(var t=O.length,e=j.length,r=0;rS.distance)continue;for(var u=0;u>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=s(r),a=s(r),l=o(r,u.pointVertex,u.pointFragment),c=o(r,u.pickVertex,u.pickFragment),h=new n(t,i,a,l,c);return h.update(e),t.addObject(h),h}var o=t("gl-shader"),s=t("gl-buffer"),l=t("typedarray-pool"),u=t("./lib/shader");e.exports=a;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),u=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var f=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return f&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),f&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":220,"gl-buffer":154,"gl-shader":221,"typedarray-pool":539}],229:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],v=r[3];return a=u*d+c*p+h*m+f*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*v,t}e.exports=n},{}],230:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],231:[function(t,e,r){arguments[4][82][0].apply(r,arguments)},{dup:82}],232:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{"./lib/GLError":233,"./lib/create-attributes":234,"./lib/create-uniforms":235,"./lib/reflect":236,"./lib/runtime-reflect":237,"./lib/shader-cache":238,dup:210}],233:[function(t,e,r){arguments[4][211][0].apply(r,arguments)},{dup:211}],234:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{"./GLError":233,dup:212}],235:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{"./GLError":233,"./reflect":236,dup:213}],236:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{dup:214}],237:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{dup:215}],238:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{"./GLError":233,dup:216,"gl-format-compiler-error":163,"weakmap-shim":560}],239:[function(t,e,r){"use strict";function n(t,e,r,n,a){a<=4*f?i(0,a-1,t,e,r,n):h(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=u,i[f]=c,a[f]=h}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],u=i[t],c=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=u,a[e]=c}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],u=i[2*t+1],c=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=u,a[r]=c,o[r]=h}function l(t,e,r,n,i,a,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,u[e]=a,c[e]=o}function u(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function h(t,e,r,n,d,p){var m=(e-t+1)/6|0,v=t+m,g=e-m,y=t+e>>1,b=y-m,x=y+m,_=v,w=b,M=y,k=x,A=g,T=t+1,S=e-1,E=0;u(_,w,r,n,d,p)&&(E=_,_=w,w=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E),u(_,M,r,n,d,p)&&(E=_,_=M,M=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(_,k,r,n,d,p)&&(E=_,_=k,k=E),u(M,k,r,n,d,p)&&(E=M,M=k,k=E),u(w,A,r,n,d,p)&&(E=w,w=A,A=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E);var L=r[w],C=n[2*w],z=n[2*w+1],I=d[w],D=p[w],P=r[k],O=n[2*k],R=n[2*k+1],F=d[k],j=p[k],N=_,B=M,U=A,V=v,H=y,q=g,G=r[N],Y=r[B],X=r[U];r[V]=G,r[H]=Y,r[q]=X;for(var W=0;W<2;++W){var Z=n[2*N+W],J=n[2*B+W],K=n[2*U+W];n[2*V+W]=Z,n[2*H+W]=J,n[2*q+W]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[H]=$,d[q]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[H]=rt,p[q]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,z,I,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!c(it,P,O,R,F,r,n,d))for(;;){if(c(S,P,O,R,F,r,n,d)){c(S,L,C,z,I,r,n,d)?(s(it,T,S,r,n,d,p),++T,--S):(a(it,S,r,n,d,p),--S);break}if(--S=Math.max(.9*d,32)){var b=u+s>>>1;l(v,g,h,f,b,c+1),f=b}l(v,g,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,h=1/0,f=-1/0,d=-1/0,p=0;p=0;--_){t[2*_]=(t[2*_]-c)*g,t[2*_+1]=(t[2*_+1]-h)*y;var A=x[_];A!==M&&(w.push(new i(b*Math.pow(.5,A),_+1,k-(_+1))),k=_+1,M=A)}return w.push(new i(b*Math.pow(.5,A+1),0,k)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=a},{"./lib/sort":239,"typedarray-pool":539}],241:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=m(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=m(this.plot.gl,[256,1])}function i(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,i=r[2]-r[0],a=r[3]-r[1],u=2/i,c=2/a,h=-r[0]-.5*i,f=-r[1]-.5*a;_[0]=u,w[0]=u-_[0],_[1]=c,w[1]=c-_[1],M[0]=h,k[0]=h-M[0],M[1]=f,k[1]=f-M[1];var d=e[2]-e[0],p=e[3]-e[1];o=Math.min(i/d,a/p),A[0]=2*n/d,A[1]=2*n/p,s=r[0],l=r[2]}function a(t,e){var r=t.gl,i=u(r,f.vertex,f.fragment),a=u(r,f.pickVertex,f.pickFragment),o=c(r),s=c(r),l=c(r),h=c(r),d=c(r),p=new n(t,i,a,o,s,l,h,d);return p.update(e),t.addObject(p),p}e.exports=a;var o,s,l,u=t("gl-shader"),c=t("gl-buffer"),h=t("typedarray-pool"),f=t("./lib/shaders"),d=t("snap-points-2d"),p=t("font-atlas-sdf"),m=t("gl-texture2d"),v=t("color-id"),g=t("ndarray"),y=t("clamp"),b=t("binary-search-bounds"),x=n.prototype,_=new Float32Array([0,0]),w=new Float32Array([0,0]),M=new Float32Array([0,0]),k=new Float32Array([0,0]),A=[0,0],T=[0,0,0,0];x.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,a=n>this.snapThreshold;if(!n)return t;i.call(this);var u=r.gl,c=e?this.pickShader:this.shader,h=u.isEnabled(u.BLEND);if(c.bind(),e){this.pickOffset=t;for(var f=0;f<4;++f)T[f]=t>>8*f&255;c.uniforms.pickOffset=T,this.idBuffer.bind(),c.attributes.id.pointer(u.UNSIGNED_BYTE,!1)}else u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA),u.blendColor(0,0,0,1),h||u.enable(u.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(u.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(u.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(u.FLOAT,!1,8,0),e||c.attributes.border.pointer(u.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(u.FLOAT,!1,16,0),c.attributes.positionLo.pointer(u.FLOAT,!1,16,8),c.uniforms.pixelRatio=r.pixelRatio,c.uniforms.scaleHi=_,c.uniforms.scaleLo=w,c.uniforms.translateHi=M,c.uniforms.translateLo=k,c.uniforms.viewBox=r.viewBox;var d=this.scales;if(a)for(var p=d.length-1;p>=0;p--){var m=d[p];if(!(m.pixelSize&&m.pixelSize<1.25*o&&p>1)){var v=m.offset,g=m.count+v,y=b.ge(this.xCoords,s,v,g-1),x=b.lt(this.xCoords,l,y,g-1)+1;x>y&&u.drawArrays(u.POINTS,y,x-y)}}else u.drawArrays(u.POINTS,0,n);if(e)return t+n;h?u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA):u.disable(u.BLEND)},x.draw=x.drawPick,x.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},x.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,l=this.points.length/2,u=l>this.snapThreshold;var c=h.mallocFloat32(2*l),f=h.mallocFloat64(2*l),m=h.mallocUint32(l),b=h.mallocFloat32(4*l);f.set(this.points),u&&(this.i2idx&&h.free(this.i2idx),this.i2idx=h.mallocInt32(l),this.scales=d(f,this.i2idx,c)),this.pointCount=l;for(var x=0;xF&&(F=i[x]);var j=this.charStep;this.charStep=y(Math.ceil(4*F),128,768);var N=Object.keys(O),B=this.charStep,U=Math.floor(B/2),V=s.getParameter(s.MAX_TEXTURE_SIZE),H=V/B*(V/B),q=Math.min(V,B*N.length),G=Math.min(V,B*Math.ceil(B*N.length/V)),Y=Math.floor(q/B);N.length>H&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==N+""&&this.charStep==j||(this.charCanvas=p({canvas:this.charCanvas,family:"sans-serif",size:U,shape:[q,G],step:[B,B],chars:N,align:!0,fit:this.charFit}),this.chars=N);for(var x=0;x>>1,n=u.mallocInt32(r),i=u.mallocFloat32(r),a=u.mallocFloat64(2*r);if(a.set(this.points),this.snapPoints)this.scales=l(a,n,i,this.bounds);else{this.bounds=f(a,2),h(a,2,this.bounds);for(var o=0;o>8&255,y[2]=t>>16&255,y[3]=t>>24&255,n.uniforms.pickOffset=y,s.bind(),n.attributes.pickId.pointer(h.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var z=!0;if(this.snapPoints)for(var I=i.length-1;I>=0;I--){var D=i[I];if(!(D.pixelSize1)){var P=this.getVisibleRange(D),O=P[0],R=P[1];R>O&&h.drawArrays(h.POINTS,O,R-O),!e&&z&&(z=!1,n.uniforms.useWeight=0)}}else h.drawArrays(h.POINTS,0,this.pointCount);return t+this.pointCount},d.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,i=this.size,a=this.plot.pixelRatio,o=r[2]-r[0];r[3],r[1];if(!t)for(var t,l=this.scales.length-1;l>=0&&(t=this.scales[l],t.pixelSize1);l--);var u=this.xCoords,c=(e[0]-r[0]-n*i*a)/o,h=(e[2]-r[0]+n*i*a)/o,f=t.offset,d=t.count+f,p=s.ge(u,c,f,d-1);return[p,s.lt(u,h,p,d-1)+1]},d.drawPick=d.draw,d.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":242,"array-bounds":42,"array-normalize":43,"binary-search-bounds":243,"gl-buffer":154,"gl-shader":253,"snap-points-2d":245,"typedarray-pool":539}],247:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(R[1])){var F=O;O=R,R=F,F=D,D=P,P=F;var j=z;z=I,I=j}O[0]<0&&(D[z]=-1),R[1]>0&&(P[I]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*z+C],2),B+=Math.pow(p[4*I+C],2);D[z]/=Math.sqrt(N),P[I]/=Math.sqrt(B),d.axes[0]=D,d.axes[1]=P, -d.fragClipBounds[0]=u(E,b[0],_,-1e8),d.fragClipBounds[1]=u(E,b[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=I,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new o(e,r,n,i,u,c,h,f,d,a,s,l);return v.update(t),v}var p=t("gl-buffer"),m=t("gl-vao"),v=t("typedarray-pool"),g=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],k=[0,0,0],A=[0,0,0,1],T=[0,0,0,1],S=x.slice(),E=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],z=[1e8,1e8,1e8],I=[C,z];_.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,g=n.length;t:for(var y=0;y0&&(z[0]=-a[0]*(1+A[0][0]));for(var H=M.cells,q=M.positions,_=0;_0){var g=r*c;o.drawBox(h-g,f-g,d+g,f+g,a),o.drawBox(h-g,p-g,d+g,p+g,a),o.drawBox(h-g,f-g,h+g,p+g,a),o.drawBox(d-g,f-g,d+g,p+g,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":250,"gl-buffer":154,"gl-shader":253}],252:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function a(t,e){return new i(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":254,"./lib/create-attributes":255,"./lib/create-uniforms":256,"./lib/reflect":257,"./lib/runtime-reflect":258,"./lib/shader-cache":259}],254:[function(t,e,r){arguments[4][211][0].apply(r,arguments)},{dup:211}],255:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{"./GLError":254,dup:212}],256:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{"./GLError":254,"./reflect":257,dup:213}],257:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{dup:214}],258:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{dup:215}],259:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{"./GLError":254,dup:216,"gl-format-compiler-error":163,"weakmap-shim":560}],260:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],261:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":253}],262:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new n(t,l,u,c);return h.update(e),h}var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],h=[0,0,0],f=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=h,p=0;p<3;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(var p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":261,"gl-buffer":154,"gl-vao":269}],263:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular_1_1(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":253}],264:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:R,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(g.mallocFloat(1024),[0,0]),_(g.mallocFloat(1024),[0,0]),_(g.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||j,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=N.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],M(l,t.model,l);var u=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||D,n.view=t.view||D,n.projection=t.projection||D,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=k(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),k(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var h=o(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},F.pickSlots=1,F.setPickBase=function(t){this.pickId=t};var j=[0,0,0],N={showSurface:!1,showContour:!1,projections:[D.slice(),D.slice(),D.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:D,view:D,projection:D,inverseModel:D.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=D.slice(),V=[1,0,0,0,1,0,0,0,1];F.draw=function(t){return s.call(this,t,!1)},F.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:D,view:D,projection:D,inverseModel:D,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};F.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||D,r.view=t.view||D,r.projection=t.projection||D,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var d=f?l:1-l,p=i+c,m=s+f,v=h*d,g=0;g<3;++g)u[g]+=this._field[g].get(p,m)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=A.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},F.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=h(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=h(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(g.freeFloat(this._field[2].data),this._field[2].data=g.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(g.freeFloat(this._field[o].data),this._field[o].data=g.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=s[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[o],c)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=f[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var m=_(p.data,a);m.stride[o]=p.stride[0],m.stride[1^o]=0,l(this._field[o],m)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)tt.pop();H-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),H+=1}}nt.push(H)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=g.mallocFloat(tt.length);for(o=0;oi||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,i,a,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var h=0,f=0,d=s(c,l.stride.slice());"float32"===u?h=t.FLOAT:"float64"===u?(h=t.FLOAT,d=!1,u="float32"):"uint8"===u?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,d=!1,u="uint8");if(2===c.length)f=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])f=t.ALPHA;else if(2===c[2])f=t.LUMINANCE_ALPHA;else if(3===c[2])f=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");f=t.RGBA}c[2]}if(f!==t.LUMINANCE&&f!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(f=i),f!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var g=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),h===a&&d)0===l.offset&&l.data.length===g?y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+g));else{var b;b=a===t.FLOAT?v.mallocFloat32(g):v.mallocUint8(g);var _=p(b,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?x(_,l):m.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,b.subarray(0,g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,b.subarray(0,g)),a===t.FLOAT?v.freeFloat32(b):v.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function h(t,e,r,n,i,a){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new o(t,s,r,n,i,a)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var a=s(n,e.stride.slice()),l=0;"float32"===r?l=t.FLOAT:"float64"===r?(l=t.FLOAT,a=!1,r="float32"):"uint8"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,a=!1);var h,f,d=e.size;if(a)h=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var g=[n[2],n[2]*n[0],1];f=v.malloc(d,r);var y=p(f,n,g,0);"float32"!==r&&"float64"!==r||l!==t.UNSIGNED_BYTE?m.assign(y,e):x(y,e),h=f.subarray(0,d)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,h),a||v.free(f),new o(t,b,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(g||n(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=i(e)?e:e.raw;if(r)return h(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),m=t("ndarray-ops"),v=t("typedarray-pool");e.exports=d;var g=null,y=null,b=null,x=function(t,e){m.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&g.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&g.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(b.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var a=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=i(t)?t:t.raw;if(o){this._mipLevels.indexOf(n)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,o)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:465,"ndarray-ops":459,"typedarray-pool":539}],266:[function(t,e,r){"use strict";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],275:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}e.exports=n},{}],276:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],277:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r0)continue;n=t.slice(0,1).join("")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function z(){return/[^a-fA-F0-9]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function I(){return"."===O?(U.push(O),B=v,R=O,j+1):/[eE]/.test(O)?(U.push(O),B=v,R=O,j+1):"x"===O&&1===U.length&&"0"===U[0]?(B=w,U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function D(){return"f"===O&&(U.push(O),R=O,j+=1),/[eE]/.test(O)?(U.push(O),R=O,j+1):"-"===O&&/[eE]/.test(R)?(U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=u,j):(U.push(O),R=O,j+1)}function P(){if(/[^\d\w_]/.test(O)){var t=U.join("");return B=J.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:g,e(U.join("")),B=u,j}return U.push(O),R=O,j+1}var O,R,F,j=0,N=0,B=u,U=[],V=[],H=1,q=0,G=0,Y=!1,X=!1,W="";t=t||{};var Z=o,J=i;return"300 es"===t.version&&(Z=l,J=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):n()}}e.exports=n;var i=t("./lib/literals"),a=t("./lib/operators"),o=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),u=999,c=9999,h=0,f=1,d=2,p=3,m=4,v=5,g=6,y=7,b=8,x=9,_=10,w=11,M=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":280,"./lib/builtins-300es":279,"./lib/literals":282,"./lib/literals-300es":281,"./lib/operators":283}],279:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":280}],280:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],281:[function(t,e,r){var n=t("./literals") -;e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":282}],282:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],283:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],284:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t("./index");e.exports=n},{"./index":278}],285:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=u[f+0]&&n>=u[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=u;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*m}},{}],288:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=h[t];i||(i=h[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;o<0&&(l[0]=1,l[1]=0);for(var h=new n(l,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),m=0;m<=i;++m)m===c&&(p[m]=-1);var v=p[0];p[0]=p[1],p[1]=v;var g=new n(p,new Array(i+1),!0);f[c]=g,d[c]=g}d[i+1]=h;for(var c=0;c<=i;++c)for(var p=f[c].vertices,y=f[c].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=h;else for(var x=0;x<=i;++x)f[x].vertices.indexOf(b)<0&&(y[m]=f[x])}for(var _=new s(i,a,d),w=!!e,c=i+1;c0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;h<=r;++h){var f=c[h];i[h]=f<0?e:a[f]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},f.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var d=this.orient();if(a[c]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},f.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var e=h.pop(),d=e.vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var v=0;v<=o;++v)if(v!==m){var g=p[v];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,g.boundary=!1,u.push(g),h.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var w=g.adjacent,M=d.slice(),k=p.slice(),A=new n(M,k,!0);c.push(A);var T=w.indexOf(e);if(!(T<0)){w[T]=A,k[m]=g,M[v]=-1,k[v]=e,p[v]=A,A.flip();for(var x=0;x<=o;++x){var S=M[x];if(!(S<0||S===r)){for(var E=new Array(o-1),L=0,C=0;C<=o;++C){var z=M[C];z<0||C===x||(E[L++]=z)}f.push(new i(E,A,x))}}}}}}f.sort(a);for(var v=0;v+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":506,"simplicial-complex":517}],289:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r>1],a=[],o=[],s=[],r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,f),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var r=this.left.remove(t);return 2===r?(this.left=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(t[0]>this.mid){if(!this.right)return y;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);var r=this.right.remove(t);return 2===r?(this.right=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var o=this.left,r=this.right;n.count-=a.count,n.right=a.left,a.left=o,a.right=r}i(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var o=g.ge(this.leftPoints,t,f);othis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var _=m.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":64}],290:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;r=r&&s<=i&&l>=n&&l<=a&&c.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var v=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(v)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(v))}}return c}e.exports=n},{}],298:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,u=r-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-u*h/l+f)),Math.min(o,Math.floor(r+(l-u)*h/l+f)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):(m++,a(t,e,m,o)),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],299:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s=[0,t.length-1,0],l=[],u=a*a;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)i(e[2*d],e[2*d+1],r,n)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],v=e[2*p+1];i(m,v,r,n)<=u&&l.push(t[p]);var g=(c+1)%2;(0===c?r-a<=m:n-a<=v)&&(s.push(f),s.push(p-1),s.push(g)),(0===c?r+a>=m:n+a>=v)&&(s.push(p+1),s.push(h),s.push(g))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],300:[function(t,e,r){"use strict";function n(t,e){var r;if(h(t)){var l,u=t.stops&&"object"==typeof t.stops[0][0],c=u||void 0!==t.property,f=u||!c,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(u){for(var p={},m=[],v=0;v=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?c(t,e,r,n,i,a):u(t,e,r,n,i,a)}function u(t,e,r,n,i,a){var o,s=n-r,l=t-r;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function c(t,e,r,n,i,a){for(var o=[],s=0;s -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 mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / 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_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\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 vec2 v_linewidth;\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) * v_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 - (v_linewidth.t - blur), v_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 * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n", -vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\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 mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / 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_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\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) * v_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 - (v_linewidth.t - blur), v_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 * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\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 - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\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 mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / 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_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\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"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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;\nvarying vec2 v_pos;\n\nvoid main() {\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 // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\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 vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:474}],302:[function(t,e,r){"use strict";function n(t,e){this.message=(t?t+": ":"")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=n},{util:547}],303:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(c,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new n(c,l,'constant "%s" not found',l)];e=a({},e,{value:f.constants[l]})}return u.function&&"object"===i(l)?r(e):u.type&&s[u.type]?s[u.type](e):o(a({},e,{valueSpec:u.type?h[u.type]:u}))}},{"../error/validation_error":302,"../util/extend":303,"../util/get_type":304,"./validate_array":307,"./validate_boolean":308,"./validate_color":309,"./validate_constants":310,"./validate_enum":311,"./validate_filter":312,"./validate_function":313,"./validate_layer":315,"./validate_number":317,"./validate_object":318,"./validate_source":320,"./validate_string":321}],307:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":302,"../util/get_type":304}],311:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":302,"../util/unbundle_jsonlint":305}],312:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=a(s[1]),"string"!==r?c.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;h=8&&(f&&!t.valueSpec["property-function"]?p.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&p.push(new n(t.key,t.value,"zoom functions not supported"))),p}},{"../error/validation_error":302,"../util/get_type":304,"./validate":306,"./validate_array":307,"./validate_number":317,"./validate_object":318}],314:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":302,"./validate_string":321}],315:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":302,"../util/get_type":304}],318:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],h=i(r);if("object"!==h)return[new n(e,r,"object expected, %s found",h)];for(var f in r){var d=f.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?c=c.concat((m||a)({key:(e?e+".":e)+f,value:r[f],valueSpec:p,style:l,styleSpec:u,object:r,objectKey:f})):""!==e&&1!==e.split(".").length&&c.push(new n(e,r[f],'unknown property "%s"',f))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":302,"../util/get_type":304,"./validate":306}],319:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":302,"./validate":306}],320:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var u=[];if(u=u.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var c in e)["type","url","tileSize"].indexOf(c)<0&&u.push(new n(r+"."+c,e[c],'a source with a "url" property may not include a "%s" property',c));return u;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":302,"../util/unbundle_jsonlint":305,"./validate_enum":311,"./validate_object":318}],321:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":302,"../util/get_type":304}],322:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),u=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":323,"./validate/validate":306,"./validate/validate_constants":310,"./validate/validate_filter":312,"./validate/validate_glyphs_url":314,"./validate/validate_layer":315,"./validate/validate_layout_property":316,"./validate/validate_paint_property":319,"./validate/validate_source":320}],323:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":324}],324:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,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:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,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:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},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:!1},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","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,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","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},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","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],325:[function(t,e,r){"use strict";function n(t){return!!(i()&&a()&&o()&&s()&&l()&&u()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function a(){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 o(){return Function.prototype&&Function.prototype.bind}function s(){return 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 l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function h(t){return void 0===d[t]&&(d[t]=f(t)),d[t]}function f(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var d={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],326:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":440}],327:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=c.mapObject(t.arrays,function(r,n){var i=e[n],a=t.paintVertexArrayTypes[n];return r.map(function(t){return new u(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:a})})})}}function i(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i1?p.name+_:p.name;x[w]=m[_]*v}}},n.VertexArrayType=function(t){return new h({members:t,alignment:4})},n.ElementArrayType=function(t){return new h({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":438,"../util/util":440,"./array_group":326,"./bucket/circle_bucket":328,"./bucket/fill_bucket":329,"./bucket/line_bucket":330,"./bucket/symbol_bucket":331,"./buffer_group":333,assert:45,"feature-filter":130}],328:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||c<0||c>=s)){var h=this.prepareArrayGroup("circle",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,u,c,-1,-1);this.addCircleVertex(f,u,c,1,-1),this.addCircleVertex(f,u,c,1,1),this.addCircleVertex(f,u,c,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":440,"../bucket":327,"../load_geometry":335}],329:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var c=0;c=1&&n.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,u=t[0],c=t[a-1],h=u.equals(c);if(this.prepareArrayGroup("line",10*a),2!==a||!h){this.distance=0;var f,d,p,m,v,g,y,b=r,x=h?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,h&&(f=t[a-2],v=u.sub(f)._unit()._perp());for(var w=0;w0){var S=f.dist(d);if(S>2*o){var E=f.sub(f.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?b:x;if(L&&"round"===C&&(An&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A100)M=v.clone();else{var z=m.x*v.y-m.y*v.x>0?-1:1,I=A*m.add(v).mag()/m.sub(v).mag();M._perp()._mult(I*z)}this.addCurrentVertex(f,this.distance,M,0,0,!1),this.addCurrentVertex(f,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var D=m.x*v.y-m.y*v.x>0,P=-Math.sqrt(A*A-1);if(D?(y=0,g=P):(g=0,y=P),_||this.addCurrentVertex(f,this.distance,m,g,y,!1),"fakeround"===C){for(var O,R=Math.floor(8*(.5-(k-.5))),F=0;F=0;j--)O=m.mult((j+1)/(R+1))._add(v)._unit(),this.addPieSliceVertex(f,this.distance,O,D)}p&&this.addCurrentVertex(f,this.distance,v,-g,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(f,this.distance,m,0,0,!1),p&&this.addCurrentVertex(f,this.distance,v,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(f,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(f,this.distance,v,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(f,this.distance,m,0,0,!1),this.addCurrentVertex(f,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(f,this.distance,v,-1,-1,!0),this.addCurrentVertex(f,this.distance,v,0,0,!1)));if(T&&w2*o){var B=f.add(p.sub(f)._mult(o/N)._round());this.distance+=B.dist(f),this.addCurrentVertex(B,this.distance,v.mult(1),0,0,!1),f=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],c=l.layoutVertexArray,h=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(c,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(c,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>u/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":440,"../bucket":327,"../load_geometry":335}],331:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,u,c){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(u||0),c,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),u=t("../../util/token"),c=t("../../symbol/quads"),h=t("../../symbol/shaping"),f=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),v=t("../load_geometry"),g=t("../../symbol/collision_feature"),y=h.shapeText,b=h.shapeIcon,x=c.getGlyphQuads,_=c.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,n.prototype=m.inherit(o,{}),n.prototype.serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,c=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":c=1;break;case"top":case"top-right":case"top-left":c=0}for(var h="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,f=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,g=24*a["text-letter-spacing"],x=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var z=C||x;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,u,m,y,h,v,b,{zoom:this.zoom},n.properties)}}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var v=p.tl,g=p.tr,y=p.bl,b=p.br,x=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(c,_.x,_.y,v.x,v.y,x.x,x.y,w,M,f,k);i(c,_.x,_.y,g.x,g.y,x.x+x.w,x.y,w,M,f,k),i(c,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,f,k),i(c,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,f,k),u.emplaceBack(A,A+1,A+2),u.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(D,P,O,R,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":389,"../../symbol/clip_line":391,"../../symbol/collision_feature":393,"../../symbol/get_anchors":395,"../../symbol/mergelines":398,"../../symbol/quads":399,"../../symbol/resolve_text":400,"../../symbol/shaping":401,"../../util/token":439,"../../util/util":440,"../bucket":327,"../load_geometry":335,"point-geometry":482}],332:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||f.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":440,"./bucket":327,assert:45}],336:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],337:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":440}],338:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((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 i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(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()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{ -"./lng_lat":337}],339:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),u=t("../source/tile_coord"),c=t("../data/bucket").EXTENT,h=t("gl-matrix"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.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 a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),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._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this,i=n.locationCoordinate(n.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return u.cover(e,[n.pointCoordinate(new a(0,0))._zoomTo(e),n.pointCoordinate(new a(n.width,0))._zoomTo(e),n.pointCoordinate(new a(n.width,n.height))._zoomTo(e),n.pointCoordinate(new a(0,n.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),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,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,u=e[1]/n,c=r[1]/i,h=e[2]/n,d=r[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(u,c,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return f.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/c,n/c,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),i=e-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":327,"../source/tile_coord":367,"../util/interpolate":434,"../util/util":440,"./coordinate":336,"./lng_lat":337,"gl-matrix":191,"point-geometry":482}],340:[function(t,e,r){"use strict";var n={" ":[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]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,u,c,h,f,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(n.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(n.u_matrix,!1,t.transform.calculatePosMatrix(g)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}var i=t("../source/pixels_to_tile_units"),a=t("./create_uniform_pragmas"),o=512;e.exports=n},{"../source/pixels_to_tile_units":361,"./create_uniform_pragmas":342}],344:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,f>>16),o.uniform2f(a.u_pixel_coord_lower,65535&h,65535&f),o.activeTexture(o.TEXTURE0),i.spriteAtlas.bind(o,!0)}}var s=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":361}],348:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("gl-matrix").mat2,a=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(r.paint["line-width"]<=0)){var l=1/n.devicePixelRatio,u=r.paint["line-blur"]+l,c=r.paint["line-color"],h=t.transform,f=i.create();i.scale(f,f,[1,Math.cos(h._pitch)]),i.rotate(f,f,t.transform.angle);var d,p,m,v,g,y=Math.sqrt(h.height*h.height/4*(1+h.altitude*h.altitude)),b=h.height/2*Math.tan(h._pitch),x=(y+b)/y-1,_=r.paint["line-dasharray"],w=r.paint["line-pattern"];if(_)d=t.useProgram("linesdfpattern"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),p=t.lineAtlas.getDash(_.from,"round"===r.layout["line-cap"]),m=t.lineAtlas.getDash(_.to,"round"===r.layout["line-cap"]),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.lineAtlas.bind(s),s.uniform1f(d.u_tex_y_a,p.y),s.uniform1f(d.u_tex_y_b,m.y),s.uniform1f(d.u_mix,_.t),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f);else if(w){if(v=t.spriteAtlas.getPosition(w.from,!0),g=t.spriteAtlas.getPosition(w.to,!0),!v||!g)return;d=t.useProgram("linepattern"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform2fv(d.u_pattern_tl_a,v.tl),s.uniform2fv(d.u_pattern_br_a,v.br),s.uniform2fv(d.u_pattern_tl_b,g.tl),s.uniform2fv(d.u_pattern_br_b,g.br),s.uniform1f(d.u_fade,w.t),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f)}else d=t.useProgram("line"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint["line-opacity"]);for(var M=0;M0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,r,n){var i=[1,0],a=r.paint["raster-fade-duration"];if(t.source&&a>0){var o=(new Date).getTime(),s=(o-t.timeAdded)/a,l=e?(o-e.timeAdded)/a:-1,c=n.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c);!e||h?(i[0]=u.clamp(s,0,1),i[1]=1-i[0]):(i[0]=u.clamp(1-l,0,1),i[1]=1-i[0])}var f=r.paint["raster-opacity"];return i[0]*=f,i[1]*=f,i}var u=t("../util/util"),c=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new c({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":438,"../util/util":440}],350:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),o=t.gl;a?o.disable(o.STENCIL_TEST):o.enable(o.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.DEPTH_TEST),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,r,n)}}function i(t,e,r,n,i,o,s,l,u,c,h,f,d,p,m){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=e-this.changeTimes[r],i=n/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+i:this.changeOpacities[r]-i}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],352:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":327,"../data/buffer":332,"../source/pixels_to_tile_units":361,"../source/source_cache":365,"../util/browser":424,"../util/struct_array":438,"../util/util":440,"./create_uniform_pragmas":342,"./draw_background":343,"./draw_circle":344,"./draw_debug":346,"./draw_fill":347,"./draw_line":348,"./draw_raster":349,"./draw_symbol":350,"./frame_history":351,"./painter/use_program":354,"./vertex_array_object":355,"gl-matrix":191}],354:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var u=this.gl,c=u.createProgram(),h=o[t],f="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":327,"../util/evented":432,"../util/util":440,"resolve-url":499}],357:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),h.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),u=t("supercluster"),c=t("geojson-vt"),h=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,u(e.superclusterOptions).load(t.features)):r(null,c(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":423,"../util/util":440,"./geojson_wrapper":358,"./vector_tile_worker_source":369,"geojson-rewind":136,"geojson-vt":140,supercluster:527,"vt-pbf":554}],358:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;a=this._tiles[s],a&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r;this._cache.setMaxSize(Math.floor(5*n))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),c={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rh-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[g]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)c[y]||(this._coveredTiles[y]=!0);for(y in p)c[y]=!0;var b=f.keysDifference(this._tiles,c);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,c=0;c=0&&g[1].y>=0){for(var y=[],b=0;b=0&&t%1==0),l(!isNaN(e)&&e>=0&&e%1==0),l(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<0;a--)n=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,f=a;fc.dy&&(l=u,u=c,c=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy&&o(h,u,n,i,s),c.dy&&o(h,c,n,i,s)}var l=t("assert"),u=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var s,l,u;if(i>=0&&i<=a)for(s=t;sthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":432,"../util/mapbox":437,"../util/util":440,"./load_tilejson":360}],369:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(a.data=r.tile,a.parse(a.data,this.styleLayers.getLayerFamilies(),this.actor,r.rawTileData,e),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=a)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var a=this.loading[n][i]=new s(t);a.abort=this.loadVectorData(t,r.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){function r(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}var n=i.getArrayBuffer(t.url,r.bind(this));return function(){n.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i],o=a.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);o.result&&e(null,o.result,o.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":423,"./worker_tile":372,pbf:476,"vector-tile":548}],370:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,u.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),u=t("../util/ajax"),c=t("../data/bucket").EXTENT,h=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),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,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":327,"../data/buffer":332,"../geo/lng_lat":337,"../render/draw_raster":349,"../render/vertex_array_object":355,"../util/ajax":423,"../util/evented":432,"../util/util":440,"./tile_coord":367,"point-geometry":482}],371:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new u(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),u=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)b(E,P[e]);x()}}function b(t,e){if(e.populateArrays(A,j,F),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||(k=c.create({layer:w,index:z++,childLayers:e[I],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")}),k.createFilter(),L[w.id]=k,t.layers&&(M=w.sourceLayer,C[M]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&g(w,C[M]);else g(t,L);var D=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var R in L)k=L[R],0!==k.features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),D.push(k),"symbol"===k.type?P.push(k):O.push(k));var F={},j={},N=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(F),P[_].updateFont(j);for(var B in j)j[B]=Object.keys(j[B]).map(Number);F=Object.keys(F),r.send("get glyphs",{uid:this.uid,stacks:j},function(t,e){j=e,y(t)}),F.length?r.send("get icons",{icons:F},function(t,e){F=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)b(this,O[_]);if(0===P.length)return x()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var c=n.serialize(),h=s.filter(i);return{result:{buckets:h.map(a),collisionTile:c.data},transferables:o(h).concat(c.transferables)}}},{"../data/bucket":327,"../data/feature_index":334,"../symbol/collision_box":392,"../symbol/collision_tile":394,"../symbol/symbol_instances":403,"../symbol/symbol_quads":404,"../util/dictionary_coder":430,"../util/util":440}],373:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],374:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){if(t)return void this.fire("error",{error:t});this.data=e,this.img&&this.fire("load")}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)return void this.fire("error",{error:t});for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":423,"../util/browser":424,"../util/evented":432,"../util/mapbox":437}],375:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":440,"./style_function":378,csscolorparser:106}],376:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)return void this.fire("error",{error:t});if(!v.emitErrors(this,v(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),u=t("../render/line_atlas"),c=t("../util/util"),h=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),v=t("./validate_style"),g=t("../source/source"),y=t("../source/query_features"),b=t("../source/source_cache"),x=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=c.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(v.source,"sources."+t,e)?this:(e=new b(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(v.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(v.filter,"layers."+r.id+".filter",e)?this:c.deepEqual(r.filter,e)?this:(r.filter=c.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return c.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(c.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);return i.setPaintProperty(e,r,n),!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=u+(1-u)*c,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-c)*u,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:1,t:n}}}var a=t("./style_function"),o=t("./parse_color"),s=t("../util/util");e.exports=n},{"../util/util":440,"./parse_color":375,"./style_function":378}],378:[function(t,e,r){"use strict";var n=t("mapbox-gl-function");r.interpolated=function(t){var e=n.interpolated(t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r["piecewise-constant"]=function(t){var e=n["piecewise-constant"](t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r.isFunctionDefinition=n.isFunctionDefinition},{"mapbox-gl-function":300}],379:[function(t,e,r){"use strict";function n(t,e){this.set(t,e)}function i(t){return t.value}var a=t("../util/util"),o=t("./style_transition"),s=t("./style_declaration"),l=t("./style_spec"),u=t("./validate_style"),c=t("./parse_color"),h=t("../util/evented");e.exports=n;n.create=function(e,r){return new({background:t("./style_layer/background_style_layer"),circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),line:t("./style_layer/line_style_layer"),raster:t("./style_layer/raster_style_layer"),symbol:t("./style_layer/symbol_style_layer")}[(r||e).type])(e,r)},n.prototype=a.inherit(h,{set:function(t,e){this.id=t.id,this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)["source-layer"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l["paint_"+this.type],this._layoutSpecifications=l["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var r,n;for(var i in t){var a=i.match(/^paint(?:\.(.*))?$/);if(a){var o=a[1]||"";for(r in t[i])this.setPaintProperty(r,t[i][r],o)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(n in t.layout)this.setLayoutProperty(n,t.layout[n]);for(r in this._paintSpecifications)this.paint[r]=this.getPaintValue(r);for(n in this._layoutSpecifications)this._updateLayoutValue(n)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var r="layers."+this.id+".layout."+t;if(this._handleErrors(u.layoutProperty,r,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,r){var n=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,r):n.default},setPaintProperty:function(t,e,r){var n="layers."+this.id+(r?'["paint.'+r+'"].':".paint.")+t;if(a.endsWith(t,"-transition"))if(this._paintTransitionOptions[r||""]||(this._paintTransitionOptions[r||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintTransitionOptions[r||""][t]=e}else if(this._paintDeclarations[r||""]||(this._paintDeclarations[r||""]={}),null===e||void 0===e)delete this._paintDeclarations[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintDeclarations[r||""][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",a.endsWith(t,"-transition")?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},getPaintValue:function(t,e,r){var n=this._paintSpecifications[t],i=this._paintTransitions[t];return i?i.calculate(e,r):"color"===n.type&&n.default?c(n.default):n.default},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){return this._paintTransitions[t].declaration.calculateInterpolationT({zoom:e})},isPaintValueFeatureConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isFeatureConstant},isLayoutValueFeatureConstant:function(t){var e=this._layoutDeclarations[t];return!e||e.isFeatureConstant},isPaintValueZoomConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isZoomConstant},isHidden:function(t){return!!(this.minzoom&&t=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=h.dist(f)}return!0}e.exports=n},{}],391:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var o=[],s=0;s=n&&f.x>=n||(h.x>=n?h=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),l&&h.equals(l[l.length-1])||(l=[h],o.push(l)),l.push(f)))))}return o}var i=t("point-geometry");e.exports=n},{"point-geometry":482}],392:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":438,"../util/util":440,"point-geometry":482}],393:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c){var h=o.top*s-l,f=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,u){var m=f-h,v=p-d;if(m>0)if(m=Math.max(10*s,m),c){var g=e[r.segment+1].sub(e[r.segment])._unit()._mult(v),y=[r.sub(g),r.add(g)];this._addLineCollisionBoxes(t,y,r,0,v,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,v,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,h,p,f,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var u=a/2,c=Math.floor(i/u),h=-a/2,f=this.boxes,d=r,p=n+1,m=h;do{if(--p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var v=e[p].dist(e[p+1]),g=0;g=e.length)return f;v=e[p].dist(e[p+1])}var b=y-m,x=e[p],_=e[p+1],w=_.sub(x)._unit()._mult(b)._add(x)._round(),M=Math.max(Math.abs(y-h)-u/2,0),k=i/2/M;t.emplaceBack(w.x,w.y,-a/2,-a/2,a/2,a/2,k,o,s,l,0,0,0,0,0)}return f}},{}],394:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(u.x1,u.y1).matMult(w),k=new i(u.x2,u.y1).matMult(w),A=new i(u.x1,u.y2).matMult(w),T=new i(u.x2,u.y2).matMult(w);_=this.tempCollisionBox,_.anchorPointX=u.anchorPoint.x,_.anchorPointY=u.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=u.maxScale}else _=u;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new i(t,e)._matMult(u),h=this.tempCollisionBox;h.anchorX=c.x,h.anchorY=c.y,h.x1=0,h.y1=0,h.x2=r-t,h.y2=n-e,h.maxScale=a,a=h.maxScale;for(var f=[c.x+h.x1/a,c.y+h.y1/a*this.yStretch,c.x+h.x2/a,c.y+h.y2/a*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m=a&&(o[y][b]=!0,s.push(d[v]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,u=(i.y1-r.y2)*this.yStretch/o,c=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var h=Math.min(Math.max(s,l),Math.max(u,c)),f=i.maxScale,d=r.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&A=0&&T=0&&g+d<=p){var S=new o(A,T,M,b)._round();n&&!s(t,S,u,n,l)||y.push(S)}}v+=w}return h||y.length||c||(y=i(t,v/2,r,n,l,u,c,!0,f)),y}var a=t("../util/interpolate"),o=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":389,"../util/interpolate":434,"./check_max_angle":390}],396:[function(t,e,r){"use strict";function n(){this.width=o,this.height=o,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}var i=t("shelf-pack"),a=t("../util/util"),o=128;e.exports=n,n.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},n.prototype.getRects=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]={}),n[e][r]=this.index[i];return n},n.prototype.addGlyph=function(t,e,r,n){if(!r)return null;var i=e+"#"+r.id;if(this.index[i])return this.ids[i].indexOf(t)<0&&this.ids[i].push(t),this.index[i];if(!r.bitmap)return null;var o=r.width+2*n,s=r.height+2*n,l=o+2,u=s+2;l+=4-l%4,u+=4-u%4;var c=this.bin.packOne(l,u);if(c||(this.resize(),c=this.bin.packOne(l,u)),!c)return a.warnOnce("glyph bitmap overflow"),null;this.index[i]=c,this.ids[i]=[t];for(var h=this.data,f=r.bitmap,d=0;d=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=256*e+"-"+(256*e+255),o=a(t,i,this.url);s(o,function(t,r){for(var i=!t&&new l(new c(new Uint8Array(r))),a=0;an&&null!==c){var x=g[c+1].x;v=Math.max(x,v);for(var _=c+1;_<=y;_++)g[_].y+=r,g[_].x-=x;if(o){var w=c;h[g[c].codePoint]&&w--,s(g,e,p,w,o)}p=c+1,c=null,d+=x,m++}f[b.codePoint]&&(c=y)}var M=g[g.length-1],k=M.x+e[M.codePoint].advance;v=Math.max(v,k);var A=(m+1)*r;s(g,e,p,g.length-1,o),l(g,o,i,a,v,r,m,u),t.top+=-a*A,t.bottom=t.top+A,t.left+=-i*v,t.right=t.left+v}function s(t,e,r,n,i){for(var a=e[t[n].codePoint].advance,o=(t[n].x+a)*i,s=r;s<=n;s++)t[s].x-=o}function l(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],u=(-n*(o+1)+.5)*a+s[1],c=0;c1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(w?(clearTimeout(w),w=null,g("dblclick",e)):w=setTimeout(d,300))}function c(t){y("touchmove",t)}function h(t){y("touchend",t)}function f(t){y("touchcancel",t)}function d(){w=null}function p(t){n.mousePos(b,t).equals(_)&&g("click",t)}function m(t){g("dblclick",t),t.preventDefault()}function v(t){x=t,t.preventDefault()}function g(e,r){var i=n.mousePos(b,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function y(e,r){var a=n.touchPos(b,r),o=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:r})}var b=t.getCanvasContainer(),x=null,_=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();b.addEventListener("mouseout",r,!1),b.addEventListener("mousedown",o,!1),b.addEventListener("mouseup",s,!1),b.addEventListener("mousemove",l,!1),b.addEventListener("touchstart",u,!1),b.addEventListener("touchend",h,!1),b.addEventListener("touchmove",c,!1),b.addEventListener("touchcancel",f,!1),b.addEventListener("click",p,!1),b.addEventListener("dblclick",m,!1),b.addEventListener("contextmenu",v,!1)}},{"../util/dom":426,"./handler/box_zoom":411,"./handler/dblclick_zoom":412,"./handler/drag_pan":413,"./handler/drag_rotate":414,"./handler/keyboard":415,"./handler/scroll_zoom":416,"./handler/touch_zoom_rotate":417,"point-geometry":482}],406:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),u=e.exports=function(){};n.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var b=c.zoomScale(v-f),x=c.point,_="center"in t?c.project(m).sub(h.div(b)):x,w=c.worldSize,M=t.curve,k=Math.max(c.width,c.height),A=k/b,T=_.sub(x).mag();if("minZoom"in t){var S=n.clamp(Math.min(t.minZoom,f,v),c.minZoom,c.maxZoom),E=k/c.zoomScale(S-f);M=Math.sqrt(E/T*2)}var L=M*M,C=r(0),z=function(t){return s(C)/s(C+M*t)},I=function(t){return k*((s(C)*u(C+M*t)-a(C))/L)/T},D=(r(1)-C)/M;if(Math.abs(T)<1e-6){if(Math.abs(k-A)<1e-6)return this.easeTo(t);var P=A=0)return!1;return!0}),e.join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":426,"../../util/util":440,"./control":408}],408:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":432,"../../util/util":440}],409:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":424,"../../util/dom":426,"../../util/util":440,"./control":408}],410:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":426,"../../util/util":440,"./control":408}],411:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_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),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":338,"../../util/dom":426,"../../util/util":440}],412:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],413:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)return void e();var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))return void e();var l=a.mult(.3/s),u=l.mag();u>1400&&(u=1400,l._unit()._mult(u));var c=u/750,h=l.mult(-c/2);this._map.panBy(h,{duration:1e3*c,easing:o,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":426,"../../util/util":440}],414:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;u+=h*d*(p/2),Math.abs(e._normalizeBearing(u,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":426,"../../util/util":440,"point-geometry":482}],415:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],416:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),u=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":424,"../../util/dom":426,"../../util/util":440}],417:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(u,{originalEvent:t})}else{var c=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":c&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,u=(n[0]-i[0])/1e3,c=n[2];if(0===u||a===s)return void r.snapToNorth({},{originalEvent:t});var h=.15*l/u;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=a+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:o,around:r.unproject(c)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":426,"../../util/util":440}],418:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)} -e.exports=n;var i=t("../util/util");n.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)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":440}],419:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),u=t("../util/dom"),c=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),v=t("./camera"),g=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if(t=a.extend({},_,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,v.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(g.convert(t))},unproject:function(t){return this.transform.pointLocation(b.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof b||"number"==typeof t[0])e=[b.convert(t)];else{var r=[b.convert(t[0]),b.convert(t[1])];e=[r[0],new b(r[1].x,r[0].y),r[1],new b(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof c?t:new c(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=u.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=u.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=u.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});if(!t)return void this.fire("error",{error:new Error("Failed to initialize WebGL")});this.painter=new f(t,this.transform)},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":337,"../geo/lng_lat_bounds":338,"../geo/transform":339,"../render/painter":353,"../style/animation_loop":373,"../style/style":376,"../util/browser":424,"../util/canvas":425,"../util/dom":426,"../util/evented":432,"../util/util":440,"./bind_handlers":405,"./camera":406,"./control/attribution":407,"./hash":418,"point-geometry":482}],420:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":337,"../util/dom":426,"point-geometry":482}],421:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;;){if(!(e=n.firstChild))break;r.appendChild(e)}return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={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%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":337,"../util/dom":426,"../util/evented":432,"../util/util":440}],422:[function(t,e,r){"use strict";function n(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)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],423:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":325}],425:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":440,"mapbox-gl-supported":325}],426:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var h=0;h=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i=3)for(var l=0;l1){if(s(t,e))return!0;for(var n=0;n(e.y-t.y)*(r.x-t.x)}function u(t,e,r,n){return l(t,r,n)!==l(e,r,n)&&l(t,e,r)!==l(t,e,n)}function c(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function f(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function d(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],436:[function(t,e,r){"use strict";function n(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=n,n.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],437:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||o.ACCESS_TOKEN)&&o.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,o.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),u=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==l.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,l.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;if("mapbox:"!==l.parse(e).protocol)return t;var i=s.supportsWebp?".webp":"$1",o=s.devicePixelRatio>=2||512===r?"@2x":"";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,o+i),query:a(n.query)})}},{"./browser":424,"./config":429,"./util":440,url:543}],438:[function(t,e,r){"use strict";function n(t){function e(){f.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(v[n])return v[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,g=["Uint8"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type, -components:r.components||1},p(r.name.length),p(r.type in m),g.indexOf(r.type)<0&&g.push(r.type);var n=o(r.type);u=Math.max(u,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;ithis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":336,unitbezier:542}],441:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],442:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],443:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;iv[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":445,"gl-mat4/clone":173,"gl-mat4/create":174,"gl-mat4/determinant":175,"gl-mat4/invert":179,"gl-mat4/transpose":189,"gl-vec3/cross":270,"gl-vec3/dot":271,"gl-vec3/length":272,"gl-vec3/normalize":274}],445:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],446:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,f.translate,f.scale,f.skew,f.perspective,f.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!(!i||!a)&&(s(p.translate,f.translate,d.translate,n),s(p.skew,f.skew,d.skew,n),s(p.scale,f.scale,d.scale,n),s(p.perspective,f.perspective,d.perspective,n),h(p.quaternion,f.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),h=t("quat-slerp"),f=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":175,"gl-vec3/lerp":273,"mat4-decompose":444,"mat4-recompose":447,"quat-slerp":487}],447:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":174,"gl-mat4/fromRotationTranslation":177,"gl-mat4/identity":178,"gl-mat4/multiply":181,"gl-mat4/scale":187,"gl-mat4/translate":188}],448:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}function i(t){return t=t||{},new n(t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),h=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var m=n.prototype;m.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;u<16;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(c<1e-6||f)for(var u=0;u<16;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],d(m,m);var v=this.computedInverse;s(v,n);var g=this.computedEye,y=v[15];g[0]=v[12]/y,g[1]=v[13]/y,g[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;u<3;++u)b[u]=g[u]-n[2+4*u]*x}},m.idle=function(t){if(!(t1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,n=0,f=o.length;n0;--d)r[h++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":506}],450:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==v.alt,v.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==v.shift,v.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==v.control,v.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==v.meta,v.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==m||r(n))&&(d=0|t,p=a||0,m=o||0,e&&e(d,p,m,v))}function a(t){n(0,t)}function o(){(d||p||m||v.shift||v.alt||v.meta||v.control)&&(p=m=0,d=0,v.shift=v.alt=v.control=v.meta=!1,e&&e(0,0,0,v))}function s(t){r(t)&&e&&e(d,p,m,v)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function u(t){n(d|i.buttons(t),t)}function c(t){n(d&~i.buttons(t),t)}function h(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function f(){g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",u),t.removeEventListener("mouseup",c),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,m=0,v={shift:!1,alt:!1,control:!1,meta:!1},g=!1;h();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return g},set:function(t){t?h():f()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),y}e.exports=n;var i=t("mouse-event")},{"mouse-event":452}],451:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,a=t.clientY||0,o=i(e);return r[0]=n-o.left,r[1]=a-o.top,r}function i(t){return t===window||t===document||t===document.body?a:t.getBoundingClientRect()}var a={left:0,top:0};e.exports=n},{}],452:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<=0;--e)L(e,0);for(var r=[],e=0;e0;_=_-1&m)x.push(w+"["+T+"+"+v(_)+"]");x.push(g(0));for(var _=0;_0){",f(x[t]),"=1;"),P(t-1,e|1<0&&G.push(s(U,x[V-1])+"*"+o(x[V-1])),N.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;U=0;--U)Y.push(o(x[U]));N.push(A+"=("+Y.join("*")+")|0",M+"=mallocUint32("+A+")",w+"=mallocUint32("+A+")",T+"=0"),N.push(p(0)+"=0");for(var V=1;V<1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",k="N",A="Q",T="X",S="T"},{"typedarray-pool":539}],455:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":111}],456:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(u=""),r>0){a.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");a.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",u);a.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",c,",0);"):a.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?a.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}(p)}}a.push("return dst;};return gradient");for(var m=["diff","zero"],v=[h,f],o=1;o<=i;++o)m.push("grad"+o),v.push(n(o));m.push(a.join(""));var g=Function.apply(void 0,m),r=g.apply(void 0,v);return l[e]=r,r}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":108}],460:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":461,ndarray:465}],461:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":108}],462:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r1){for(var h=[],f=1;f1){o.push("dptr=0;sptr=ptr");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join(""));for(var f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var p=new Function("malloc","free",o.join("\n"));return p(u[0],u[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"1)for(var i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(var o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++A;c(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;c(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function v(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function g(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),v("k","less","great"),_.push("break"),_.push("}else{"),g("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k){var L=new Function("insertionSort","malloc","free",_.join("\n"));return L(r,k[0],k[1])}var L=new Function("insertionSort",_.join("\n"));return L(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c0?l.push(["d",v,"=s",v,"-d",p,"*n",p].join("")):l.push(["d",v,"=s",v].join("")),p=v);var d=t.length-1-c;0!==d&&(m>0?l.push(["e",d,"=s",d,"-e",m,"*n",m,",f",d,"=",h[d],"-f",m,"*n",m].join("")):l.push(["e",d,"=s",d,",f",d,"=",h[d]].join("")),m=d)}r.push("var "+l.join(","));var g=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e);return y(b,o(t,e,b))}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":539}],463:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":462}],464:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":111,"ndarray-linear-interpolate":458}],465:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),m=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+m.join(","));for(var v=0;v=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var v=0;v=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(h[t],i)}function o(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var i=h.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;lt==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":122}],467:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa)for(var x=i[u],_=1/Math.sqrt(v*y),b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(g[w]*m[M]-g[M]*m[w])}}for(var o=0;oa)for(var _=1/Math.sqrt(k),b=0;b<3;++b)x[b]*=_;else for(var b=0;b<3;++b)x[b]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0;for(var u=0;u<3;++u)f[u]*=d;i[o]=f}return i}},{}],468:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=n(t),u=1;uk&&(k=d[1]),T[r]=d}for(l=0,c=0,u=0,r=0;rA&&(A=m);return{center:[h,f],bounds:[M,_,k,w+1],radius:Math.sqrt(A)}}function o(t,e){var r=0,n=t.length,i=0;for(e||(e=4);!t[i]&&ir;)i-=e;return n=i,[r/e,n/e]}function s(t,e){return t*t+e*e}e.exports=n;var l=document.createElement("canvas"),u=l.getContext("2d");l.width=200,l.height=200,n.canvas=l},{}],470:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u),h=Math.sqrt(2*f-c+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}e.exports=n},{}],471:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),h=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=a[2],v=a[6],g=a[10],y=m*o+v*s+g*l,b=m*c+v*h+g*f;m-=y*o+b*c,v-=y*s+b*h,g-=y*l+b*f;var x=n(m,v,g);m/=x,v/=x,g/=x;var _=c*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],v=e*s+r*c,g=e*l+r*h,y=e*u+r*f,b=-(p*y-m*g),x=-(m*v-d*y),_=-(d*g-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*b+T*_-S*x,C=T*w+E*x+S*b-A*_,z=S*w+E*_+A*x-T*b,I=E*w-A*b-T*x-S*_;if(a){b=d,x=p,_=m;var D=Math.sin(a)/n(b,x,_);b*=D,x*=D,_*=D,w=Math.cos(e),L=L*w+I*b+C*_-z*x,C=C*w+I*x+z*b-L*_,z=z*w+I*_+L*x-C*b,I=I*w-L*b-C*x-z*_}var P=i(L,C,z,I);P>1e-6?(L/=P,C/=P,z/=P,I/=P):(L=C=z=0,I=1),this.rotation.set(t,L,C,z,I)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;l<3;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":470,"filtered-vector":131,"gl-mat4/fromQuat":176,"gl-mat4/invert":179,"gl-mat4/lookAt":180}],472:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":498}],473:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],474:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){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);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?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}e.exports=n;var a,o,s,l=t("ieee754");a={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 l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.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 a=e;a=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,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)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);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,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455)return void a(t,this);this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=v.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},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 e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":475}],477:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return a.freeUint32(l),a.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;a0;--a)n=e/o|0,e=e-n*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}var a=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":290,"typedarray-pool":539}],479:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=s[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,l,u,c=0;c<2;++c)if(s[c][n].length>0){o=s[c][n][0],u=c;break}l=o[1^u];for(var h=0;h<2;++h)for(var f=s[h][n],d=0;d0&&(o=p,l=m,u=h)}return a?l:(o&&r(o,u),l)}for(var a=0|e.length,o=t.length,s=[new Array(a),new Array(a)],l=0;l0;){var d=(s[0][l].length,function(t,a){var o=s[a][t][0],l=[t];r(o,a);for(var u=o[1^a];;){for(;u!==t;)l.push(u),u=n(l[l.length-2],u,!1);if(s[0][t].length+s[1][t].length===0)break;var c=l[l.length-1],h=t,f=l[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;l.push(t),u=n(c,h)}return l}(l,h));!function(t,e){return e[1]===e[e.length-1]}(f,d)?(f.length>0&&c.push(f),f=d):f.push.apply(f,d)}f.length>0&&c.push(f)}return c}e.exports=n;var i=t("compare-angle")},{"compare-angle":98}],480:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s0}function a(t){for(var e=t.length,r=0;r0;){var U=N.pop(),V=I[U];h(V,function(t,e){return t-e});var H,q=V.length,G=B[U];if(0===G){var T=g[U];H=[T]}for(var v=0;v=0)&&(B[Y]=1^G,N.push(Y),0===G)){var T=g[Y];a(T)||(T.reverse(),H.push(T))}}0===G&&d.push(H)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":480,"edges-to-adjacency-list":125,"planar-dual":479,"point-in-big-polygon":483,"robust-sum":511,"two-product":537,uniq:541}],482:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(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 e=t.x-this.x,r=t.y-this.y;return e*e+r*r},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,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,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 e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this}, -_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],483:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;i=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p)):(x=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):(_=-d/h,y=d*_+p));else if(_<0)_=0,f>=0?(x=0,y=p):-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p);else{var w=1/b;x*=w,_*=w,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p}else{var M,k,A,T;x<0?(M=c+f,k=h+d,k>M?(A=k-M,T=u-2*c+h,A>=T?(x=1,_=0,y=u+2*f+p):(x=A/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(x=0,k<=0?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):(_=-d/h,y=d*_+p))):_<0?(M=c+d,k=u+f,k>M?(A=k-M,T=u-2*c+h,A>=T?(_=1,x=0,y=h+2*d+p):(_=A/T,x=1-_,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(_=0,k<=0?(x=1,y=u+2*f+p):f>=0?(x=0,y=p):(x=-f/u,y=f*x+p))):(A=h+d-c-f,A<=0?(x=0,_=1,y=h+2*d+p):(T=u-2*c+h,A>=T?(x=1,_=0,y=u+2*f+p):(x=A/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)))}for(var S=1-x-_,l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(D,"."),n+o(t.split("."),e).join(".")}function l(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(t-=65536,e+=F(t>>>10&1023|55296),t=56320|1023&t),e+=F(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function h(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?R(t/S):t>>1,t+=R(t/e);t>O*A>>1;n+=M)t=R(t/O);return R(n+(O+1)*t/(t+T))}function d(t){var e,r,n,i,o,s,l,h,d,p,m=[],v=t.length,g=0,y=L,b=E;for(r=t.lastIndexOf(C),r<0&&(r=0),n=0;n=128&&a("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=v&&a("invalid-input"),h=c(t.charCodeAt(i++)),(h>=M||h>R((w-g)/s))&&a("overflow"),g+=h*s,d=l<=b?k:l>=b+A?A:l-b,!(hR(w/p)&&a("overflow"),s*=p;e=m.length+1,b=f(g-o,e,0==o),R(g/e)>w-y&&a("overflow"),y+=R(g/e),g%=e,m.splice(g++,0,y)}return u(m)}function p(t){var e,r,n,i,o,s,u,c,d,p,m,v,g,y,b,x=[];for(t=l(t),v=t.length,e=L,r=0,o=E,s=0;s=e&&mR((w-r)/g)&&a("overflow"),r+=(u-e)*g,e=u,s=0;sw&&a("overflow"),m==e){for(c=r,d=M;p=d<=o?k:d>=o+A?A:d-o,!(c= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=M-k,R=Math.floor,F=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:v,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(g&&y)if(r.exports==g)y.exports=x;else for(_ in x)x.hasOwnProperty(_)&&(g[_]=x[_]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],487:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":229}],488:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var c=0;c=0?(h=m.substr(0,v),f=m.substr(v+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],489:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;nr;){if(o-r>600){var l=o-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-u*h/l+f)),Math.min(o,Math.floor(e+(l-u)*h/l+f)),s)}var d=t[e],p=r,m=o;for(i(t,r,e),s(t[o],d)>0&&i(t,r,o);p0;)m--}0===s(t[r],d)?i(t,r,m):(m++,i(t,m,o)),m<=e&&(r=m+1),e<=m&&(o=m-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function a(t,e){return te?1:0}e.exports=n},{}],492:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":83,"compare-cell":99,"compare-oriented-cell":100}],497:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.createREGL=i()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?": "+t:""}function i(t,r,i){t in r||e("unknown parameter ("+t+")"+n(i)+". possible values: "+Object.keys(r).join())}function a(t,r){Qt(t)||e("invalid parameter type"+n(r)+". must be a typed array")}function o(t,r,i){typeof t!==r&&e("invalid parameter type"+n(i)+". expected "+r+", got "+typeof t)}function s(t,r){t>=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")}function l(t,r,i){r.indexOf(t)<0&&e("invalid value"+n(i)+". must be one of: "+r)}function u(t){Object.keys(t).forEach(function(t){te.indexOf(t)<0&&e('invalid regl constructor argument "'+t+'". must be one of '+te)})}function c(t,e){for(t+="";t.length0&&e.push(new d("unknown",0,t))}}),e}function y(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function b(t,e,n,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";T(n,"string",s+" shader source must be a string",a);var l=v(n,a),u=g(o);y(l,u),Object.keys(l).forEach(function(t){function e(t,e){n.push(t),i.push(e||"")}var r=l[t];if(r.hasErrors){var n=[""],i=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(a){var o=a[1];switch(i=a[2],o){case"assign":o="="}r=Math.max(t.line.indexOf(o,r),0)}else r=0;e(c("| ",6)),e(c("^^^",r+3)+"\n","font-weight:bold"),e(c("| ",6)),e(i+"\n","font-weight:bold")}),e(c("| ",6)+"\n")}else e(c(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=n.join("%c"),console.log.apply(console,i)):console.log(n.join(""))}}),r.raise("Error compiling "+s+" shader, "+l[0].name)}}function x(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=v(n,a),l=v(i,a),u='Error linking program with vertex shader, "'+l[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+o),r.raise(u)}}function _(t){t._commandRef=p()}function w(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}_(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic}function M(t,r){var n=m();e(t+" in command "+(r||p())+("unknown"===n?"":" called from "+n))}function k(t,e,r){t||M(e,r||p())}function A(t,e,r,i){t in e||M("unknown parameter ("+t+")"+n(r)+". possible values: "+Object.keys(e).join(),i||p())}function T(t,e,r,i){typeof t!==e&&M("invalid parameter type"+n(r)+". expected "+e+", got "+typeof t,i||p())}function S(t){t()}function E(t,e,r){t.texture?l(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):l(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")}function L(t,e){return t===ue||t===le||t===ce?2:t===he?4:fe[t]*e}function C(t){return!(t&t-1||!t)}function z(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ee&&t.wrapT===ee||r(C(a)&&C(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==ne&&t.minFilter!==ae&&t.minFilter!==ie&&t.minFilter!==oe,"min filter requires mipmap"):(r(C(a)&&C(o),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),e.type===se&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===re&&t.magFilter===re,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var u=a>>i,c=o>>i;r(e.mipmask&1<0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(e.wrapS===ee&&e.wrapT===ee,"wrap mode not supported by cube map");for(var l=0;l>h,p=o>>h;r(u.mipmask&1<1&&e===r&&('"'===e||"'"===e))return['"'+P(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return O(t.substr(0,n.index)).concat(O(n[1])).concat(O(t.substr(n.index+n[0].length)));var i=t.split(".");if(1===i.length)return['"'+P(t)+'"'];for(var a=[],o=0;o0,"invalid pixel ratio"))):de.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){de("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=U(r||document.body,h,u);if(!d)return null;n=d.canvas,f=d.onDestroy}i=V(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:u,profile:c,onDone:h,onDestroy:f}:(f(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function W(t,e){function r(e){de.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var n={},i=0;i65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function $(t){var e=K(t),r=Ee[Q(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function tt(t){Ee[Q(t.byteLength)>>2].push(t)}function et(t,e){var r=null;switch(t){case _e:r=new Int8Array($(e),0,e);break;case we:r=new Uint8Array($(e),0,e);break;case Me:r=new Int16Array($(2*e),0,e);break;case ke:r=new Uint16Array($(2*e),0,e);break;case Ae:r=new Int32Array($(4*e),0,e);break;case Te:r=new Uint32Array($(4*e),0,e);break;case Se:r=new Float32Array($(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r}function rt(t){tt(t.buffer)}function nt(t,e,r){for(var n=0;n0){var l;if(Array.isArray(e[0])){s=Pe(e);for(var u=1,c=1;c0)if("number"==typeof t[0]){var i=Le.allocType(p.dtype,t.length);ct(i,t),h(i,n),Le.freeType(i)}else if(Array.isArray(t[0])||Qt(t[0])){r=Pe(t);var a=De(t,r,p.dtype);h(a,n),Le.freeType(a)}else de.raise("invalid buffer data")}else if(Qt(t))h(t,n);else if(Z(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,f=0;1===r.length?(s=r[0],l=1,u=o[0],f=0):2===r.length?(s=r[0],l=r[1],u=o[0],f=o[1]):de.raise("invalid shape");var d=Array.isArray(t.data)?p.dtype:ut(t.data),m=Le.allocType(d,s*l);ht(m,t.data,s,l,u,f,t.offset),h(m,n),Le.freeType(m)}else de.raise("invalid data for buffer subdata");return c}e.bufferCount++;var p=new n(a);return f[p.id]=p,o||c(i),c._reglType="buffer",c._buffer=p,c.subdata=d,r.profile&&(c.stats=p.stats),c.destroy=function(){l(p)},c}function c(){xe(f).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})}var h=0,f={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){l(this)};var d=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:u,createStream:i,destroyStream:a,clear:function(){xe(f).forEach(l),d.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:c,_initBuffer:s}}function dt(t,e,r,n){function i(t){this.id=h++,c[this.id]=this,this.buffer=t,this.primType=He,this.vertCount=0,this.type=0}function a(t){var e=d.pop();return e||(e=new i(r.create(null,Je,!0,!1)._buffer)),s(e,t,Ke,-1,-1,0,0),e}function o(t){d.push(t)}function s(n,i,a,o,s,l,u){if(n.buffer.bind(),i){var c=u;u||Qt(i)&&(!Z(i)||Qt(i.data))||(c=e.oes_element_index_uint?Ze:Xe),r._initBuffer(n.buffer,i,a,c,3)}else t.bufferData(Je,l,a),n.buffer.dtype=h||Ge,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var h=u;if(!u){switch(n.buffer.dtype){case Ge:case qe:h=Ge;break;case Xe:case Ye:h=Xe;break;case Ze:case We:h=Ze;break;default:de.raise("unsupported type for element array")}n.buffer.dtype=h}n.type=h,de(h!==Ze||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=s;f<0&&(f=n.buffer.byteLength,h===Xe?f>>=1:h===Ze&&(f>>=2)),n.vertCount=f;var d=o;if(o<0){d=He;var p=n.buffer.dimension;1===p&&(d=Ue),2===p&&(d=Ve),3===p&&(d=He)}n.primType=d}function l(t){n.elementsCount--,de(null!==t.buffer,"must not double destroy elements"),delete c[t.id],t.buffer.destroy(),t.buffer=null}function u(t,e){function a(t){if(t)if("number"==typeof t)o(t),u.primType=He,u.vertCount=0|t,u.type=Ge;else{var e=null,r=Qe,n=-1,i=-1,l=0,c=0;Array.isArray(t)||Qt(t)||Z(t)?e=t:(de.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,de(Array.isArray(e)||Qt(e)||Z(e),"invalid data for element buffer")),"usage"in t&&(de.parameter(t.usage,Ie,"invalid element buffer usage"),r=Ie[t.usage]),"primitive"in t&&(de.parameter(t.primitive,Be,"invalid element buffer primitive"),n=Be[t.primitive]),"count"in t&&(de("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(de.parameter(t.type,f,"invalid buffer type"),c=f[t.type]),"length"in t?l=0|t.length:(l=i,c===Xe||c===Ye?l*=2:c!==Ze&&c!==We||(l*=4))),s(u,e,r,n,i,l,c)}else o(),u.primType=He,u.vertCount=0,u.type=Ge;return a}var o=r.create(null,Je,!0),u=new i(o._buffer);return n.elementsCount++,a(t),a._reglType="elements",a._elements=u,a.subdata=function(t,e){return o.subdata(t,e),a},a.destroy=function(){l(u)},a}var c={},h=0,f={uint8:Ge,uint16:Xe};e.oes_element_index_uint&&(f.uint32=Ze),i.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:u,createStream:a,destroyStream:o,getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){xe(c).forEach(l)}}}function pt(t){for(var e=Le.allocType(er,t.length),r=0;r>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function mt(t){return Array.isArray(t)||Qt(t)}function vt(t){return"[object "+t+"]"}function gt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function yt(t){return!!Array.isArray(t)&&!(0===t.length||!mt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===dn}function _t(t){return bt(t)===pn}function wt(t){return bt(t)===mn}function Mt(t){return bt(t)===vn}function kt(t){if(!t)return!1;var e=bt(t);return gn.indexOf(e)>=0||(gt(t)||yt(t)||Z(t))}function At(t){return 0|Kt[Object.prototype.toString.call(t)]}function Tt(t,e){var r=e.length;switch(t.type){case Or:case Rr:case Fr:case jr:var n=Le.allocType(t.type,r);n.set(e),t.data=n;break;case wr:t.data=pt(e);break;default:de.raise("unsupported texture type, must specify a typed array")}}function St(t,e){return Le.allocType(t.type===wr?jr:t.type,e)}function Et(t,e){t.type===wr?(t.data=pt(e),Le.freeType(e)):t.data=e}function Lt(t,e,r,n,i,a){ -for(var o=t.width,s=t.height,l=t.channels,u=o*s*l,c=St(t,u),h=0,f=0;f=1;)s+=o*l*l,l/=2;return s}return o*r*n}function zt(t,e,r,n,i,a,o){function s(){this.internalformat=or,this.format=or,this.type=Or,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function u(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(de.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(de.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(de.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(de.parameter(n.colorSpace,j,"invalid colorSpace"),t.colorSpace=j[n.colorSpace]),"type"in n){var i=n.type;de(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),de(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),de(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(i,N,"invalid texture type"),t.type=N[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(de(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],de(s>0&&s<=4,"invalid number of channels"),l=!0),de(a>=0&&a<=r.maxTextureSize,"invalid width"),de(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,de(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,de(a>=0&&a<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,de(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,de(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var u=!1;if("format"in n){var c=n.format;de(e.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(c,B,"invalid texture format");var h=t.internalformat=B[c];t.format=J[h],c in N&&("type"in n||(t.type=N[c])),c in U&&(t.compressed=!0),u=!0}!l&&u?t.channels=fn[t.format]:l&&!u?t.channels!==hn[t.format]&&(t.format=t.internalformat=hn[t.channels]):u&&l&&de(t.channels===fn[t.format],"number of channels inconsistent with specified format")}}function c(e){t.pixelStorei(an,e.flipY),t.pixelStorei(on,e.premultiplyAlpha),t.pixelStorei(sn,e.colorSpace),t.pixelStorei(nn,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var n=null;if(kt(e)?n=e:e&&(de.type(e,"object","invalid pixel data type"),u(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),kt(e.data)&&(n=e.data)),de(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){de(!n,"can not specify copy and data field for the same texture");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,de(t.xOffset>=0&&t.xOffset=0&&t.yOffset0&&t.width<=a&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(Qt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==Or||(t.type=At(n));else if(gt(n))t.channels=t.channels||4,Tt(t,n),t.alignment=1,t.needsFree=!0;else if(Z(n)){var s=n.data;Array.isArray(s)||t.type!==Or||(t.type=At(s));var l,c,h,f,d,p,m=n.shape,v=n.stride;3===m.length?(h=m[2],p=v[2]):(de(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),l=m[0],c=m[1],f=v[0],d=v[1],t.alignment=1,t.width=l,t.height=c,t.channels=h,t.format=t.internalformat=hn[h],t.needsFree=!0,Lt(t,s,f,d,p,n.offset)}else if(xt(n)||_t(n))xt(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(wt(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(Mt(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(yt(n)){var g=t.width||n[0].length,y=t.height||n.length,b=t.channels;b=mt(n[0][0])?b||n[0][0].length:b||1;for(var x=Ce.shape(n),_=1,w=0;w=0,"oes_texture_float extension not enabled"):t.type===wr&&de(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,u=e.type,h=e.width,f=e.height;c(e),a?t.texImage2D(r,i,l,l,u,a):e.compressed?t.compressedTexImage2D(r,i,s,h,f,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(r,i,l,h,f,0,l,u,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,u=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;c(e),s?t.texSubImage2D(r,o,i,a,h,f,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,u,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,h,f,l)}function m(){return K.pop()||new h}function v(t){t.needsFree&&Le.freeType(t.data),h.call(t),K.push(t)}function g(){s.call(this),this.genMipmaps=!1,this.mipmapHint=$r,this.mipmask=0,this.images=Array(16)}function y(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function b(t,e){var r=null;if(kt(e))r=t.images[0]=m(),l(r,t),f(r,e),t.mipmask=1;else if(u(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;de.parameter(i,R),t.magFilter=R[i]}var a=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(de.parameter(s,O),a=o=O[s]):Array.isArray(s)&&(de.parameter(s[0],O),de.parameter(s[1],O),a=O[s[0]],o=O[s[1]])}else{if("wrapS"in e){var l=e.wrapS;de.parameter(l,O),a=O[l]}if("wrapT"in e){var u=e.wrapT;de.parameter(u,O),o=O[u]}}if(t.wrapS=a,t.wrapT=o,"anisotropic"in e){var c=e.anisotropic;de("number"==typeof c&&c>=1&&c<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var h=!1;switch(typeof e.mipmap){case"string":de.parameter(e.mipmap,P,"invalid mipmap hint"),t.mipmapHint=P[e.mipmap],t.genMipmaps=!0,h=!0;break;case"boolean":h=t.genMipmaps=e.mipmap;break;case"object":de(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,h=!0;break;default:de.raise("invalid mipmap type")}!h||"min"in e||(t.minFilter=Wr)}}function A(r,n){t.texParameteri(n,Gr,r.minFilter),t.texParameteri(n,qr,r.magFilter),t.texParameteri(n,Nr,r.wrapS),t.texParameteri(n,Br,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,rn,r.anisotropic),r.genMipmaps&&(t.hint(Qr,r.mipmapHint),t.generateMipmap(n))}function T(e){s.call(this),this.mipmask=0,this.internalformat=or,this.id=$++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,o.profile&&(this.stats={size:0})}function S(e){t.activeTexture(un),t.bindTexture(e.target,e.texture)}function E(){var e=rt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(nr,null)}function L(e){var r=e.texture;de(r,"must not double destroy texture");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(un+n),t.bindTexture(i,null),rt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete tt[e.id],a.textureCount--}function C(e,n){function i(t,e){var n=c.texInfo;M.call(n);var a=_();return"number"==typeof t?"number"==typeof e?y(a,0|t,0|e):y(a,0|t,0|t):t?(de.type(t,"object","invalid arguments to regl.texture"),k(n,t),b(a,t)):y(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),c.mipmask=a.mipmask,l(c,a),de.texture2D(n,a,r),c.internalformat=a.internalformat,i.width=a.width,i.height=a.height,S(c),x(a,nr),A(n,nr),E(),w(a),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,a.width,a.height,n.genMipmaps,!1)),i.format=q[c.internalformat],i.type=G[c.type],i.mag=Y[n.magFilter],i.min=X[n.minFilter],i.wrapS=W[n.wrapS],i.wrapT=W[n.wrapT],i}function s(t,e,r,n){de(!!t,"must specify image data");var a=0|e,o=0|r,s=0|n,u=m();return l(u,c),u.width=0,u.height=0,f(u,t),u.width=u.width||(c.width>>s)-a,u.height=u.height||(c.height>>s)-o,de(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+u.width<=c.width&&o+u.height<=c.height,"texture.subimage write out of bounds"),de(c.mipmask&1<>s;++s)t.texImage2D(nr,s,c.format,n>>s,a>>s,0,c.format,c.type,null);return E(),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,n,a,!1,!1)),i}var c=new T(nr);return tt[c.id]=c,a.textureCount++,i(e,n),i.subimage=s,i.resize=u,i._reglType="texture2d",i._texture=c,o.profile&&(i.stats=c.stats),i.destroy=function(){c.decRef()},i}function z(e,n,i,s,c,h){function d(t,e,n,i,a,s){var c,h=C.texInfo;for(M.call(h),c=0;c<6;++c)z[c]=_();if("number"!=typeof t&&t)if("object"==typeof t)if(e)b(z[0],t),b(z[1],e),b(z[2],n),b(z[3],i),b(z[4],a),b(z[5],s);else if(k(h,t),u(C,t),"faces"in t){var f=t.faces;for(de(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),c=0;c<6;++c)de("object"==typeof f[c]&&!!f[c],"invalid input for cube map face"),l(z[c],C),b(z[c],f[c])}else for(c=0;c<6;++c)b(z[c],t);else de.raise("invalid arguments to cube map");else{var p=0|t||1;for(c=0;c<6;++c)y(z[c],p,p)}for(l(C,z[0]),h.genMipmaps?C.mipmask=(z[0].width<<1)-1:C.mipmask=z[0].mipmask,de.textureCube(C,h,z,r),C.internalformat=z[0].internalformat,d.width=z[0].width,d.height=z[0].height,S(C),c=0;c<6;++c)x(z[c],ar+c);for(A(h,ir),E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,h.genMipmaps,!0)),d.format=q[C.internalformat],d.type=G[C.type],d.mag=Y[h.magFilter],d.min=X[h.minFilter],d.wrapS=W[h.wrapS],d.wrapT=W[h.wrapT],c=0;c<6;++c)w(z[c]);return d}function g(t,e,r,n,i){de(!!e,"must specify image data"),de("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var a=0|r,o=0|n,s=0|i,u=m();return l(u,C),u.width=0,u.height=0,f(u,e),u.width=u.width||(C.width>>s)-a,u.height=u.height||(C.height>>s)-o,de(C.type===u.type&&C.format===u.format&&C.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+u.width<=C.width&&o+u.height<=C.height,"texture.subimage write out of bounds"),de(C.mipmask&1<>i;++i)t.texImage2D(ar+n,i,C.format,r>>i,r>>i,0,C.format,C.type,null);return E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,!1,!0)),d}}var C=new T(ir);tt[C.id]=C,a.cubeCount++;var z=new Array(6);return d(e,n,i,s,c,h),d.subimage=g,d.resize=L,d._reglType="textureCube",d._texture=C,o.profile&&(d.stats=C.stats),d.destroy=function(){C.decRef()},d}function I(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(ar+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);A(e.texInfo,e.target)})}var P={"don't care":$r,"dont care":$r,nice:en,fast:tn},O={repeat:Ur,clamp:Vr,mirror:Hr},R={nearest:Yr,linear:Xr},F=$t({mipmap:Kr,"nearest mipmap nearest":Wr,"linear mipmap nearest":Zr,"nearest mipmap linear":Jr,"linear mipmap linear":Kr},R),j={none:0,browser:ln},N={uint8:Or,rgba4:pr,rgb565:vr,"rgb5 a1":mr},B={alpha:sr,luminance:ur,"luminance alpha":cr,rgb:lr,rgba:or,rgba4:hr,"rgb5 a1":fr,rgb565:dr},U={};e.ext_srgb&&(B.srgb=xr,B.srgba=_r),e.oes_texture_float&&(N.float32=N.float=jr),e.oes_texture_half_float&&(N.float16=N["half float"]=wr),e.webgl_depth_texture&&($t(B,{depth:yr,"depth stencil":br}),$t(N,{uint16:Rr,uint32:Fr,"depth stencil":gr})),e.webgl_compressed_texture_s3tc&&$t(U,{"rgb s3tc dxt1":Mr,"rgba s3tc dxt1":kr,"rgba s3tc dxt3":Ar,"rgba s3tc dxt5":Tr}),e.webgl_compressed_texture_atc&&$t(U,{"rgb atc":Sr,"rgba atc explicit alpha":Er,"rgba atc interpolated alpha":Lr}),e.webgl_compressed_texture_pvrtc&&$t(U,{"rgb pvrtc 4bppv1":Cr,"rgb pvrtc 2bppv1":zr,"rgba pvrtc 4bppv1":Ir,"rgba pvrtc 2bppv1":Dr}),e.webgl_compressed_texture_etc1&&(U["rgb etc1"]=Pr);var V=Array.prototype.slice.call(t.getParameter(rr));Object.keys(U).forEach(function(t){var e=U[t];V.indexOf(e)>=0&&(B[t]=e)});var H=Object.keys(B);r.textureFormats=H;var q=[];Object.keys(B).forEach(function(t){var e=B[t];q[e]=t});var G=[];Object.keys(N).forEach(function(t){var e=N[t];G[e]=t});var Y=[];Object.keys(R).forEach(function(t){var e=R[t];Y[e]=t});var X=[];Object.keys(F).forEach(function(t){var e=F[t];X[e]=t});var W=[];Object.keys(O).forEach(function(t){var e=O[t];W[e]=t});var J=H.reduce(function(t,e){var r=B[e];return r===ur||r===sr||r===ur||r===cr||r===yr||r===br?t[r]=r:r===fr||e.indexOf("rgba")>=0?t[r]=or:t[r]=lr,t},{}),K=[],Q=[],$=0,tt={},et=r.maxTextureUnits,rt=Array(et).map(function(){return null});return $t(T.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n0)continue;i.unit=-1}rt[n]=e,r=n;break}r>=et&&de.raise("insufficient number of texture units"),o.profile&&a.maxTextureUnits=Sn&&e=2,"invalid shape for framebuffer"),u=I[0],d=I[1]}else"radius"in z&&(u=d=z.radius),"width"in z&&(u=z.width),"height"in z&&(d=z.height);("color"in z||"colors"in z)&&(y=z.color||z.colors,Array.isArray(y)&&de(1===y.length||o,"multiple render targets not supported")),y||("colorCount"in z&&(T=0|z.colorCount,de(T>0,"invalid color buffer count")),"colorTexture"in z&&(b=!!z.colorTexture,x="rgba4"),"colorType"in z&&(A=z.colorType,b?(de(e.oes_texture_float||!("float"===A||"float32"===A),"you must enable OES_texture_float in order to use floating point framebuffer objects"),de(e.oes_texture_half_float||!("half float"===A||"float16"===A),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===A||"float16"===A?(de(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==A&&"float32"!==A||(de(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),de.oneOf(A,k,"invalid color type")),"colorFormat"in z&&(x=z.colorFormat,w.indexOf(x)>=0?b=!0:M.indexOf(x)>=0?b=!1:b?de.oneOf(z.colorFormat,w,"invalid color format for texture"):de.oneOf(z.colorFormat,M,"invalid color format for renderbuffer"))),("depthTexture"in z||"depthStencilTexture"in z)&&(C=!(!z.depthTexture&&!z.depthStencilTexture),de(!C||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in z&&("boolean"==typeof z.depth?p=z.depth:(S=z.depth,v=!1)),"stencil"in z&&("boolean"==typeof z.stencil?v=z.stencil:(E=z.stencil,p=!1)),"depthStencil"in z&&("boolean"==typeof z.depthStencil?p=v=z.depthStencil:(L=z.depthStencil,p=!1,v=!1))}else u=d=1;var D=null,P=null,O=null,R=null;if(Array.isArray(y))D=y.map(c);else if(y)D=[c(y)];else for(D=new Array(T),a=0;a=0||D[a].renderbuffer&&Bn.indexOf(D[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),D[a]&&D[a].texture){var j=On[D[a].texture._texture.format]*Rn[D[a].texture._texture.type];null===F?F=j:de(F===j,"all color attachments much have the same number of bits per pixel.")}return l(P,u,d),de(!P||P.texture&&P.texture._texture.format===Dn||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Fn,"invalid depth attachment for framebuffer object"),l(O,u,d),de(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===jn,"invalid stencil attachment for framebuffer object"),l(R,u,d),de(!R||R.texture&&R.texture._texture.format===Nn||R.renderbuffer&&R.renderbuffer._renderbuffer.format===Nn,"invalid depth-stencil attachment for framebuffer object"),m(s),s.width=u,s.height=d,s.colorAttachments=D,s.depthAttachment=P,s.stencilAttachment=O,s.depthStencilAttachment=R,i.color=D.map(f),i.depth=f(P),i.stencil=f(O),i.depthStencil=f(R),i.width=s.width,i.height=s.height,g(s),i}function o(t,e){de(_.next!==s,"can not resize a framebuffer which is currently in use");var r=0|t,n=0|e||r;if(r===s.width&&n===s.height)return i;for(var a=s.colorAttachments,o=0;o=2,"invalid shape for framebuffer"),de(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&de(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(u=d.color||d.colors,Array.isArray(u)&&de(1===u.length||a,"multiple render targets not supported")),u||("colorCount"in d&&(f=0|d.colorCount,de(f>0,"invalid color buffer count")),"colorType"in d&&(de.oneOf(d.colorType,k,"invalid color type"),h=d.colorType),"colorFormat"in d&&(c=d.colorFormat,de.oneOf(d.colorFormat,w,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(u)if(Array.isArray(u))for(m=[],r=0;r0&&(s.depth=o[0].depth,s.stencil=o[0].stencil,s.depthStencil=o[0].depthStencil),o[r]?o[r](s):o[r]=y(s)}return $t(i,{width:l,height:l,color:m})}function a(t){var e,n=0|t;if(de(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===i.width)return i;var a=i.color;for(e=0;e1)for(var m=0;mt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);xe(c).forEach(e),c={},xe(h).forEach(e),h={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,f={},r.shaderCount=0},program:function(t,e,n){de.command(t>=0,"missing vertex shader",n),de.command(e>=0,"missing fragment shader",n);var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a,n),i[t]=a,d.push(a)),a},restore:u,shader:o,frag:-1,vert:-1}}function Ft(t,e,r,n,i,a){function o(o){var s;null===e.next?(de(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),s=Wn):(de(null!==e.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),s=e.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?de(s===Wn||s===Jn,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"):de(s===Wn,"Reading from a framebuffer is only allowed for the type 'uint8'"));var l=0,u=0,c=n.framebufferWidth,h=n.framebufferHeight,f=null;Qt(o)?f=o:o&&(de.type(o,"object","invalid arguments to regl.read()"),l=0|o.x,u=0|o.y,de(l>=0&&l=0&&u0&&c+l<=n.framebufferWidth,"invalid width for read pixels"),de(h>0&&h+u<=n.framebufferHeight,"invalid height for read pixels"),r();var d=c*h*4;return f||(s===Wn?f=new Uint8Array(d):s===Jn&&(f=f||new Float32Array(d))),de.isTypedArray(f,"data buffer for regl.read() must be a typedarray"),de(f.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(Zn,4),t.readPixels(l,u,c,h,Xn,s,f),f}function s(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}function l(t){return t&&"framebuffer"in t?s(t):o(t)}return l}function jt(t){return Array.prototype.slice.call(t)}function Nt(t){return jt(t).join("")}function Bt(){function t(t){for(var e=0;e0&&(r.push(t,"="),r.push.apply(r,jt(arguments)),r.push(";")),t}var r=[],n=[];return $t(t,{def:e,toString:function(){return Nt([n.length>0?"var "+n+";":"",Nt(r)])}})}function r(){function t(t,e){n(t,e,"=",r.def(t,e),";")}var r=e(),n=e(),i=r.toString,a=n.toString;return $t(function(){r.apply(r,jt(arguments))},{def:r.def,entry:r,exit:n,save:t,set:function(e,n,i){t(e,n),r(e,n,"=",i,";")},toString:function(){return i()+a()}})}function n(){var t=Nt(arguments),e=r(),n=r(),i=e.toString,a=n.toString;return $t(e,{then:function(){return e.apply(e,jt(arguments)),this},else:function(){return n.apply(n,jt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Nt(["if(",t,"){",i(),"}",e])}})}function i(t,e){function n(){var t="a"+i.length;return i.push(t),t}var i=[];e=e||0;for(var a=0;a=1,n>=2,e)}if(r===ai){var i=t.data;return new Ht(i.thisDep,i.contextDep,i.propDep,e)}return new Ht(r===ii,r===ni,r===ri,e)}function Xt(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p){function m(t){return t.replace(".","_")}function v(t,e,r){var n=m(t);et.push(t),tt[n]=$[n]=!!r,rt[n]=e}function g(t,e,r){var n=m(t);et.push(t), -Array.isArray(r)?($[n]=r.slice(),tt[n]=r.slice()):$[n]=tt[n]=r,nt[n]=e}function y(){var t=Bt(),r=t.link,n=t.global;t.id=ot++,t.batchId="0";var i=r(it),a=t.shared={props:"a0"};Object.keys(it).forEach(function(t){a[t]=n.def(i,".",t)}),de.optional(function(){t.CHECK=r(de),t.commandStr=de.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},at.invalidBlendCombinations=Ua});var o=t.next={},s=t.current={};Object.keys(nt).forEach(function(t){Array.isArray($[t])&&(o[t]=n.def(a.next,".",t),s[t]=n.def(a.current,".",t))});var l=t.constants={};Object.keys(at).forEach(function(t){l[t]=n.def(JSON.stringify(at[t]))}),t.invoke=function(e,n){switch(n.type){case ei:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case ri:return e.def(a.props,n.data);case ni:return e.def(a.context,n.data);case ii:return e.def("this",n.data);case ai:return n.data.append(t,e),n.data.ref}},t.attribCache={};var c={};return t.scopeAttrib=function(t){var n=e.id(t);if(n in c)return c[n];var i=u.scope[n];return i||(i=u.scope[n]=new W),c[n]=r(i)},t}function b(t){var e,r=t.static,n=t.dynamic;if(Di in r){var i=!!r[Di];e=Gt(function(t,e){return i}),e.enable=i}else if(Di in n){var a=n[Di];e=Yt(a,function(t,e){return t.invoke(e,a)})}return e}function x(t,e){var r=t.static,n=t.dynamic;if(Pi in r){var i=r[Pi];return i?(i=s.getFramebuffer(i),de.command(i,"invalid framebuffer object"),Gt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,".next",r);var a=n.context;return e.set(a,"."+Vi,r+".width"),e.set(a,"."+Hi,r+".height"),r})):Gt(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Vi,n+"."+Yi),e.set(n,"."+Hi,n+"."+Xi),"null"})}if(Pi in n){var a=n[Pi];return Yt(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,".getFramebuffer(",r,")");de.optional(function(){t.assert(e,"!"+r+"||"+o,"invalid framebuffer object")}),e.set(i,".next",o);var s=n.context;return e.set(s,"."+Vi,o+"?"+o+".width:"+s+"."+Yi),e.set(s,"."+Hi,o+"?"+o+".height:"+s+"."+Xi),o})}return null}function _(t,e,r){function n(t){if(t in i){var n=i[t];de.commandType(n,"object","invalid "+t,r.commandStr);var o,s,l=!0,u=0|n.x,c=0|n.y;return"width"in n?(o=0|n.width,de.command(o>=0,"invalid "+t,r.commandStr)):l=!1,"height"in n?(s=0|n.height,de.command(s>=0,"invalid "+t,r.commandStr)):l=!1,new Ht(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var r=t.shared.context,i=o;"width"in n||(i=e.def(r,".",Vi,"-",u));var a=s;return"height"in n||(a=e.def(r,".",Hi,"-",c)),[u,c,i,a]})}if(t in a){var h=a[t],f=Yt(h,function(e,r){var n=e.invoke(r,h);de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,a=r.def(n,".x|0"),o=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Vi,"-",a,")"),l=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",Hi,"-",o,")");return de.optional(function(){e.assert(r,s+">=0&&"+l+">=0","invalid "+t)}),[a,o,s,l]});return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new Ht(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Vi),e.def(r,".",Hi)]}):null}var i=t.static,a=t.dynamic,o=n(Ii);if(o){var s=o;o=new Ht(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+qi,r[2]),e.set(n,"."+Gi,r[3]),r})}return{viewport:o,scissor_box:n(zi)}}function w(t){function r(t){if(t in i){var r=e.id(i[t]);de.optional(function(){c.shader(qa[t],r,de.guessCommand())});var n=Gt(function(){return r});return n.id=r,n}if(t in a){var o=a[t];return Yt(o,function(e,r){var n=e.invoke(r,o),i=r.def(e.shared.strings,".id(",n,")");return de.optional(function(){r(e.shared.shader,".shader(",qa[t],",",i,",",e.command,");")}),i})}return null}var n,i=t.static,a=t.dynamic,o=r(Ri),s=r(Oi),l=null;return qt(o)&&qt(s)?(l=c.program(s.id,o.id),n=Gt(function(t,e){return t.link(l)})):n=new Ht(o&&o.thisDep||s&&s.thisDep,o&&o.contextDep||s&&s.contextDep,o&&o.propDep||s&&s.propDep,function(t,e){var r,n=t.shared.shader;r=o?o.append(t,e):e.def(n,".",Ri);var i;i=s?s.append(t,e):e.def(n,".",Oi);var a=n+".program("+i+","+r;return de.optional(function(){a+=","+t.command}),e.def(a+")")}),{frag:o,vert:s,progVar:n,program:l}}function M(t,e){function r(t,r){if(t in n){var a=0|n[t];return de.command(!r||a>=0,"invalid "+t,e.commandStr),Gt(function(t,e){return r&&(t.OFFSET=a),a})}if(t in i){var s=i[t];return Yt(s,function(e,n){var i=e.invoke(n,s);return r&&(e.OFFSET=i,de.optional(function(){e.assert(n,i+">=0","invalid "+t)})),i})}return r&&o?Gt(function(t,e){return t.OFFSET="0",0}):null}var n=t.static,i=t.dynamic,o=function(){if(Fi in n){var t=n[Fi];Ut(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),de.command(t,"invalid elements",e.commandStr));var r=Gt(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return r.value=t,r}if(Fi in i){var o=i[Fi];return Yt(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),l=e.def(n,"(",a,")"),u=t.cond(l).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return de.optional(function(){t.assert(u.else,"!"+a+"||"+s,"invalid elements")}),e.entry(u),e.exit(t.cond(l).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}(),s=r(Bi,!0);return{elements:o,primitive:function(){if(ji in n){var t=n[ji];return de.commandParameter(t,Be,"invalid primitve",e.commandStr),Gt(function(e,r){return Be[t]})}if(ji in i){var r=i[ji];return Yt(r,function(t,e){var n=t.constants.primTypes,i=t.invoke(e,r);return de.optional(function(){t.assert(e,i+" in "+n,"invalid primitive, must be one of "+Object.keys(Be))}),e.def(n,"[",i,"]")})}return o?qt(o)?Gt(o.value?function(t,e){return e.def(t.ELEMENTS,".primType")}:function(){return Aa}):new Ht(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",Aa)}):null}(),count:function(){if(Ni in n){var t=0|n[Ni];return de.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),Gt(function(){return t})}if(Ni in i){var r=i[Ni];return Yt(r,function(t,e){var n=t.invoke(e,r);return de.optional(function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")}),n})}if(o){if(qt(o)){if(o)return s?new Ht(s.thisDep,s.contextDep,s.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return de.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):Gt(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var a=Gt(function(){return-1});return de.optional(function(){a.MISSING=!0}),a}var l=new Ht(o.thisDep||s.thisDep,o.contextDep||s.contextDep,o.propDep||s.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return de.optional(function(){l.DYNAMIC=!0}),l}return null}(),instances:r(Ui,!1),offset:s}}function k(t,e){var r=t.static,i=t.dynamic,a={};return et.forEach(function(t){function o(e,n){if(t in r){var o=e(r[t]);a[s]=Gt(function(){return o})}else if(t in i){var l=i[t];a[s]=Yt(l,function(t,e){return n(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case vi:case si:case oi:case Ai:case hi:case Ci:case xi:case wi:case Mi:case pi:return o(function(r){return de.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return de.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case fi:return o(function(r){return de.commandParameter(r,Va,"invalid "+t,e.commandStr),Va[r]},function(e,r,n){var i=e.constants.compareFuncs;return de.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Va))}),r.def(i,"[",n,"]")});case di:return o(function(t){return de.command(mt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case ci:return o(function(t){de.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,a="dstAlpha"in t?t.dstAlpha:t.dst;return de.commandParameter(r,Ba,s+".srcRGB",e.commandStr),de.commandParameter(n,Ba,s+".srcAlpha",e.commandStr),de.commandParameter(i,Ba,s+".dstRGB",e.commandStr),de.commandParameter(a,Ba,s+".dstAlpha",e.commandStr),de.command(-1===Ua.indexOf(r+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ba[r],Ba[i],Ba[n],Ba[a]]},function(e,r,n){function i(i,o){var s=r.def('"',i,o,'" in ',n,"?",n,".",i,o,":",n,".",i);return de.optional(function(){e.assert(r,s+" in "+a,"invalid "+t+"."+i+o+", must be one of "+Object.keys(Ba))}),s}var a=e.constants.blendFuncs;de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var o=i("src","RGB"),s=i("dst","RGB");de.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+o+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var l=r.def(a,"[",o,"]"),u=r.def(a,"[",i("src","Alpha"),"]");return[l,r.def(a,"[",s,"]"),u,r.def(a,"[",i("dst","Alpha"),"]")]});case ui:return o(function(r){return"string"==typeof r?(de.commandParameter(r,Z,"invalid "+t,e.commandStr),[Z[r],Z[r]]):"object"==typeof r?(de.commandParameter(r.rgb,Z,t+".rgb",e.commandStr),de.commandParameter(r.alpha,Z,t+".alpha",e.commandStr),[Z[r.rgb],Z[r.alpha]]):void de.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,a=r.def(),o=r.def(),s=e.cond("typeof ",n,'==="string"');return de.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(Z))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(a,"=",o,"=",i,"[",n,"];"),s.else(a,"=",i,"[",n,".rgb];",o,"=",i,"[",n,".alpha];"),r(s),[a,o]});case li:return o(function(t){return de.command(mt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),J(4,function(e){return+t[e]})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),J(4,function(t){return e.def("+",r,"[",t,"]")})});case Ti:return o(function(t){return de.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return de.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Si:return o(function(r){de.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,a="mask"in r?r.mask:-1;return de.commandParameter(n,Va,t+".cmp",e.commandStr),de.commandType(i,"number",t+".ref",e.commandStr),de.commandType(a,"number",t+".mask",e.commandStr),[Va[n],i,a]},function(t,e,r){var n=t.constants.compareFuncs;return de.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Da),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Ei:case Li:return o(function(r){de.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",a=r.zpass||"keep";return de.commandParameter(n,Ha,t+".fail",e.commandStr),de.commandParameter(i,Ha,t+".zfail",e.commandStr),de.commandParameter(a,Ha,t+".zpass",e.commandStr),[t===Li?Sa:Ta,Ha[n],Ha[i],Ha[a]]},function(e,r,n){function i(i){return de.optional(function(){e.assert(r,'!("'+i+'" in '+n+")||("+n+"."+i+" in "+a+")","invalid "+t+"."+i+", must be one of "+Object.keys(Ha))}),r.def('"',i,'" in ',n,"?",a,"[",n,".",i,"]:",Da)}var a=e.constants.stencilOps;return de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Li?Sa:Ta,i("fail"),i("zfail"),i("zpass")]});case _i:return o(function(t){de.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return de.commandType(r,"number",s+".factor",e.commandStr),de.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case gi:return o(function(t){var r=0;return"front"===t?r=Ta:"back"===t&&(r=Sa),de.command(!!r,s,e.commandStr),r},function(t,e,r){return de.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Ta,":",Sa)});case bi:return o(function(t){return de.command("number"==typeof t&&t>=n.lineWidthDims[0]&&t<=n.lineWidthDims[1],"invalid line width, must positive number between "+n.lineWidthDims[0]+" and "+n.lineWidthDims[1],e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+n.lineWidthDims[0]+"&&"+r+"<="+n.lineWidthDims[1],"invalid line width")}),r});case yi:return o(function(t){return de.commandParameter(t,Ga,s,e.commandStr),Ga[t]},function(t,e,r){return de.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+Ea+":"+La)});case mi:return o(function(t){return de.command(mt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),J(4,function(t){return"!!"+r+"["+t+"]"})});case ki:return o(function(t){de.command("object"==typeof t&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return de.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return de.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),a}function A(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,a=r[t];if("number"==typeof a||"boolean"==typeof a)n=Gt(function(){return a});else if("function"==typeof a){var o=a._reglType;"texture2d"===o||"textureCube"===o?n=Gt(function(t){return t.link(a)}):"framebuffer"===o||"framebufferCube"===o?(de.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=Gt(function(t){return t.link(a.color[0])})):de.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else mt(a)?n=Gt(function(e){return e.global.def("[",J(a.length,function(r){return de.command("number"==typeof a[r]||"boolean"==typeof a[r],"invalid uniform "+t,e.commandStr),a[r]}),"]")}):de.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=a,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=Yt(e,function(t,r){return t.invoke(r,e)})}),i}function T(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var a=n[t],s=e.id(t),l=new W;if(Ut(a))l.state=$n,l.buffer=i.getBuffer(i.create(a,Zi,!1,!0)),l.type=0;else{var u=i.getBuffer(a);if(u)l.state=$n,l.buffer=u,l.type=0;else if(de.command("object"==typeof a&&a,"invalid data for attribute "+t,r.commandStr),a.constant){var c=a.constant;l.buffer="null",l.state=ti,"number"==typeof c?l.x=c:(de.command(mt(c)&&c.length>0&&c.length<=4,"invalid constant for attribute "+t,r.commandStr),Kn.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',r.commandStr);var f=0|a.stride;de.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',r.commandStr);var d=0|a.size;de.command(!("size"in a)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',r.commandStr);var p=!!a.normalized,m=0;"type"in a&&(de.commandParameter(a.type,ze,"invalid type for attribute "+t,r.commandStr),m=ze[a.type]);var v=0|a.divisor;"divisor"in a&&(de.command(0===v||K,'cannot specify divisor for attribute "'+t+'", instancing not supported',r.commandStr),de.command(v>=0,'invalid divisor for attribute "'+t+'"',r.commandStr)),de.optional(function(){var e=r.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(a).forEach(function(r){de.command(n.indexOf(r)>=0,'unknown parameter "'+r+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",e)})}),l.buffer=u,l.state=$n,l.size=d,l.normalized=p,l.type=m||u.dtype,l.offset=h,l.stride=f,l.divisor=v}}o[t]=Gt(function(t,e){var r=t.attribCache;if(s in r)return r[s];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[s]=n,n})}),Object.keys(a).forEach(function(t){function e(e,n){function i(t){n(u[t],"=",a,".",t,"|0;")}var a=e.invoke(n,r),o=e.shared,s=o.isBufferArgs,l=o.buffer;de.optional(function(){e.assert(n,a+"&&(typeof "+a+'==="object"||typeof '+a+'==="function")&&('+s+"("+a+")||"+l+".getBuffer("+a+")||"+l+".getBuffer("+a+".buffer)||"+s+"("+a+'.buffer)||("constant" in '+a+"&&(typeof "+a+'.constant==="number"||'+o.isArrayLike+"("+a+".constant))))",'invalid dynamic attribute "'+t+'"')});var u={isStream:n.def(!1)},c=new W;c.state=$n,Object.keys(c).forEach(function(t){u[t]=n.def(""+c[t])});var h=u.buffer,f=u.type;return n("if(",s,"(",a,")){",u.isStream,"=true;",h,"=",l,".createStream(",Zi,",",a,");",f,"=",h,".dtype;","}else{",h,"=",l,".getBuffer(",a,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',a,"){",u.state,"=",ti,";","if(typeof "+a+'.constant === "number"){',u[Kn[0]],"=",a,".constant;",Kn.slice(1).map(function(t){return u[t]}).join("="),"=0;","}else{",Kn.map(function(t,e){return u[t]+"="+a+".constant.length>="+e+"?"+a+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",a,".buffer)){",h,"=",l,".createStream(",Zi,",",a,".buffer);","}else{",h,"=",l,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",h,".dtype;",u.normalized,"=!!",a,".normalized;"),i("size"),i("offset"),i("stride"),i("divisor"),n("}}"),n.exit("if(",u.isStream,"){",l,".destroyStream(",h,");","}"),u}var r=a[t];o[t]=Yt(r,e)}),o}function S(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=Gt(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Yt(e,function(t,r){return t.invoke(r,e)})}),n}function E(t,e,r,n,i){function a(t){var e=u[t];e&&(h[t]=e)}var o=t.static,s=t.dynamic;de.optional(function(){function t(t){Object.keys(t).forEach(function(t){de.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',i.commandStr)})}var e=[Pi,Oi,Ri,Fi,ji,Bi,Ni,Ui,Di].concat(et);t(o),t(s)});var l=x(t,i),u=_(t,l,i),c=M(t,i),h=k(t,i),f=w(t,i);a(Ii),a(m(zi));var d=Object.keys(h).length>0,p={framebuffer:l,draw:c,shader:f,state:h,dirty:d};return p.profile=b(t,i),p.uniforms=A(r,i),p.attributes=T(e,i),p.context=S(n,i),p}function L(t,e,r){var n=t.shared,i=n.context,a=t.scope();Object.keys(r).forEach(function(n){e.save(i,"."+n);var o=r[n];a(i,".",n,"=",o.append(t,e),";")}),e(a)}function C(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;Q&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,u=t.constants,c=u.drawBuffer,h=u.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",ja,",",l,".framebuffer);"),Q&&e(i,".drawBuffersWEBGL(",c,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",ja,",null);"),Q&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function z(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,u=t.cond(s,".dirty");et.forEach(function(e){var n=m(e);if(!(n in r.state)){var c,h;if(n in o){c=o[n],h=a[n];var f=J($[n].length,function(t){return u.def(c,"[",t,"]")});u(t.cond(f.map(function(t,e){return t+"!=="+h+"["+e+"]"}).join("||")).then(i,".",nt[n],"(",f,");",f.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";"))}else{c=u.def(l,".",n);var d=t.cond(c,"!==",s,".",n);u(d),n in rt?d(t.cond(c).then(i,".enable(",rt[n],");").else(i,".disable(",rt[n],");"),s,".",n,"=",c,";"):d(i,".",nt[n],"(",c,");",s,".",n,"=",c,";")}}}),0===Object.keys(r.state).length&&u(s,".dirty=false;"),e(u)}function I(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;Vt(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var u=l.append(t,e);if(rt[i]){var c=rt[i];qt(l)?u?e(s,".enable(",c,");"):e(s,".disable(",c,");"):e(t.cond(u).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(o,".",i,"=",u,";")}else if(mt(u)){var h=a[i];e(s,".",nt[i],"(",u,");",u.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";")}else e(s,".",nt[i],"(",u,");",o,".",i,"=",u,";")}})}function D(t,e){K&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function P(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){u=e.def(),t(u,"=",a(),";"),"string"==typeof i?t(p,".count+=",i,";"):t(p,".count++;"),d&&(n?(c=e.def(),t(c,"=",v,".getNumPendingQueries();")):t(v,".beginQuery(",p,");"))}function s(t){t(p,".cpuTime+=",a(),"-",u,";"),d&&(n?t(v,".pushScopeStats(",c,",",v,".getNumPendingQueries(),",p,");"):t(v,".endQuery();"))}function l(t){var r=e.def(m,".profile");e(m,".profile=",t,";"),e.exit(m,".profile=",r,";")}var u,c,h,f=t.shared,p=t.stats,m=f.current,v=f.timer,g=r.profile;if(g){if(qt(g))return void(g.enable?(o(e),s(e.exit),l("true")):l("false"));h=g.append(t,e),l(h)}else h=e.def(m,".profile");var y=t.block();o(y),e("if(",h,"){",y,"}");var b=t.block();s(b),e.exit("if(",h,"){",b,"}")}function O(t,e,r,n,i){function a(t){switch(t){case ua:case da:case ga:return 2;case ca:case pa:case ya:return 3;case ha:case ma:case ba:return 4;default:return 1}}function o(r,n,i){function a(){e("if(!",c,".buffer){",l,".enableVertexAttribArray(",u,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",c,".type!==",a,"||",c,".size!==",r,"||",p.map(function(t){return c+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",Zi,",",f,".buffer);",l,".vertexAttribPointer(",[u,r,a,i.normalized,i.stride,i.offset],");",c,".type=",a,";",c,".size=",r,";",p.map(function(t){return c+"."+t+"="+i[t]+";"}).join(""),"}"),K){var o=i.divisor;e("if(",c,".divisor!==",o,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,o],");",c,".divisor=",o,";}")}}function o(){e("if(",c,".buffer){",l,".disableVertexAttribArray(",u,");","}if(",Kn.map(function(t,e){return c+"."+t+"!=="+d[e]}).join("||"),"){",l,".vertexAttrib4f(",u,",",d,");",Kn.map(function(t,e){return c+"."+t+"="+d[e]+";"}).join(""),"}")}var l=s.gl,u=e.def(r,".location"),c=e.def(s.attributes,"[",u,"]"),h=i.state,f=i.buffer,d=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];h===$n?a():h===ti?o():(e("if(",h,"===",$n,"){"),a(),e("}else{"),o(),e("}"))}var s=t.shared;n.forEach(function(n){var s,l=n.name,u=r.attributes[l];if(u){if(!i(u))return;s=u.append(t,e)}else{if(!i(Ya))return;var c=t.scopeAttrib(l);de.optional(function(){t.assert(e,c+".state","missing attribute "+l)}),s={},Object.keys(new W).forEach(function(t){s[t]=e.def(c,".",t)})}o(t.link(n),a(n.info.type),s)})}function R(t,r,n,i,a){for(var o,s=t.shared,l=s.gl,u=0;u1?J(_,function(t){return c+"["+t+"]"}):c);r(");")}}function F(t,e,r,n){function i(i){var a=c[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(u,".",i)}function a(){function t(){r(v,".drawElementsInstancedANGLE(",[f,p,g,d+"<<(("+g+"-"+Qn+")>>1)",m],");")}function e(){r(v,".drawArraysInstancedANGLE(",[f,d,p,m],");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[f,p,g,d+"<<(("+g+"-"+Qn+")>>1)"]+");")}function e(){r(l+".drawArrays("+[f,d,p]+");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,u=s.draw,c=n.draw,h=function(){var i,a=c.elements,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(u,".",Fi),i&&o("if("+i+")"+l+".bindBuffer("+Ji+","+i+".buffer.buffer);"),i}(),f=i(ji),d=i(Bi),p=function(){var i,a=c.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),de.optional(function(){a.MISSING&&t.assert(e,"false","missing vertex count"),a.DYNAMIC&&t.assert(o,i+">=0","missing vertex count")})):(i=o.def(u,".",Ni),de.optional(function(){t.assert(o,i+">=0","missing vertex count")})),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,v;K&&(m=i(Ui),v=t.instancing);var g=h+".type",y=c.elements&&qt(c.elements);K&&("number"!=typeof m||m>=0)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function j(t,e,r,n,i){var a=y(),o=a.proc("body",i);return de.optional(function(){a.commandStr=e.commandStr,a.command=a.link(e.commandStr)}),K&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function N(t,e,r,n){D(t,e),O(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),F(t,e,e,r)}function B(t,e){var r=t.proc("draw",1);D(t,r),L(t,r,e.context),C(t,r,e.framebuffer),z(t,r,e),I(t,r,e.state),P(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)N(t,r,e,e.shader.program);else{var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link(function(r){return j(N,t,e,r,1)}),"(",n,");",o,".call(this,a0);"))}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}function U(t,e,r,n){function i(){return!0}t.batchId="a1",D(t,e),O(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),F(t,e,e,r)}function V(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}D(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();if(e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&L(t,c,r.context),r.needsFramebuffer&&C(t,c,r.framebuffer),I(t,c,r.state,i),r.profile&&i(r.profile)&&P(t,c,r,!1,!0),n)O(t,u,r,n.attributes,a),O(t,c,r,n.attributes,i),R(t,u,r,n.uniforms,a),R(t,c,r,n.uniforms,i),F(t,u,c,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,c),d=c.def(f,".id"),p=c.def(h,"[",d,"]");c(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link(function(e){return j(U,t,r,e,2)}),"(",f,");}",p,".call(this,a0[",s,"],",s,");")}}function H(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",D(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(L(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||C(t,n,o)):C(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),z(t,n,e),I(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||P(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)V(t,n,e,null);else{var u=l.append(t,n);if(n(t.shared.gl,".useProgram(",u,".program);"),e.shader.program)V(t,n,e,e.shader.program);else{var c=t.global.def("{}"),h=n.def(u,".id"),f=n.def(c,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",c,"[",h,"]=",t.link(function(r){return j(V,t,e,r,2)}),"(",u,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}function q(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;L(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),Vt(Object.keys(r.state)).forEach(function(e){var n=r.state[e],o=n.append(t,i);mt(o)?o.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,o)}),P(t,i,r,!0,!0),[Fi,Bi,Ni,Ui,ji].forEach(function(e){var n=r.draw[e] -;n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new W).forEach(function(t){i.set(a,"."+t,n[t])})}),n(Oi),n(Ri),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function G(t){if("object"==typeof t&&!mt(t)){for(var e=Object.keys(t),r=0;r=0;--t){var r=q[t];r&&r(E,null,0)}g.flush(),k&&k.update()}function r(){!J&&q.length>0&&(J=ge.next(e))}function n(){J&&(ge.cancel(e),J=null)}function i(t){t.preventDefault(),b=!0,n(),G.forEach(function(t){t()})}function a(t){g.getError(),b=!1,x.restore(),O.restore(),I.restore(),R.restore(),F.restore(),j.restore(),k&&k.restore(),N.procs.refresh(),r(),Y.forEach(function(t){t()})}function o(){q.length=0,n(),H&&(H.removeEventListener(eo,i),H.removeEventListener(ro,a)),O.clear(),j.clear(),F.clear(),R.clear(),D.clear(),I.clear(),k&&k.clear(),Z.forEach(function(t){t()})}function s(t){function e(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];ve.isDynamic(i)?r[n]=ve.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}function r(t){for(;d.length0)return h.call(this,r(0|t),0|t)}else{if(!Array.isArray(t))return c.call(this,t);if(t.length)return h.call(this,t,t.length)}}de(!!t,"invalid args to regl({...})"),de.type(t,"object","invalid args to regl({...})");var i=e(t.context||{}),a=e(t.uniforms||{}),o=e(t.attributes||{}),s=e(function(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}var r=$t({},t);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),r}(t)),l={gpuTime:0,cpuTime:0,count:0},u=N.compile(s,o,a,i,l),c=u.draw,h=u.batch,f=u.scope,d=[];return $t(n,{stats:l})}function l(t,e){var r=0;N.procs.poll();var n=e.color;n&&(g.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=Ka),"depth"in e&&(g.clearDepth(+e.depth),r|=Qa),"stencil"in e&&(g.clearStencil(0|e.stencil),r|=$a),de(!!r,"called regl.clear with no buffer specified"),g.clear(r)}function u(t){if(de("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;e<6;++e)K($t({framebuffer:t.framebuffer.faces[e]},t),l);else K(t,l);else l(null,t)}function c(t){function e(){function e(){var t=Zt(q,e);q[t]=q[q.length-1],q.length-=1,q.length<=0&&n()}var r=Zt(q,t);de(r>=0,"cannot cancel a frame twice"),q[r]=e}return de.type(t,"function","regl.frame() callback must be a function"),q.push(t),r(),{cancel:e}}function h(){var t=V.viewport,e=V.scissor_box;t[0]=t[1]=e[0]=e[1]=0,E.viewportWidth=E.framebufferWidth=E.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,E.viewportHeight=E.framebufferHeight=E.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){E.tick+=1,E.time=p(),h(),N.procs.poll()}function d(){h(),N.procs.refresh(),k&&k.update()}function p(){return(ye()-A)/1e3}function m(t,e){de.type(e,"function","listener callback must be a function");var r;switch(t){case"frame":return c(e);case"lost":r=G;break;case"restore":r=Y;break;case"destroy":r=Z;break;default:de.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(e),{cancel:function(){for(var t=0;t=0},read:U,destroy:o,_gl:g,_refresh:d,poll:function(){f(),k&&k.update()},now:p,stats:w});return v.onDone(null,Q),Q}var Kt={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Qt=function(t){return Object.prototype.toString.call(t)in Kt},$t=function(t,e){for(var r=Object.keys(e),n=0;n=2,"invalid renderbuffer shape"),a=0|d[0],o=0|d[1]}else"radius"in f&&(a=o=0|f.radius),"width"in f&&(a=0|f.width),"height"in f&&(o=0|f.height);"format"in f&&(de.parameter(f.format,u,"invalid renderbuffer format"),l=u[f.format])}else"number"==typeof e?(a=0|e,o="number"==typeof n?0|n:a):e?de.raise("invalid arguments to renderbuffer constructor"):a=o=1;if(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),a!==h.width||o!==h.height||l!==h.format)return s.width=h.width=a,s.height=h.height=o,h.format=l,t.bindRenderbuffer(xn,h.renderbuffer),t.renderbufferStorage(xn,l,a,o),i.profile&&(h.stats.size=It(h.format,h.width,h.height)),s.format=c[h.format],s}function l(e,n){var a=0|e,o=0|n||a;return a===h.width&&o===h.height?s:(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),s.width=h.width=a,s.height=h.height=o,t.bindRenderbuffer(xn,h.renderbuffer),t.renderbufferStorage(xn,h.format,a,o),i.profile&&(h.stats.size=It(h.format,h.width,h.height)),s)}var h=new a(t.createRenderbuffer());return f[h.id]=h,n.renderbufferCount++,s(e,o),s.resize=l,s._reglType="renderbuffer",s._renderbuffer=h,i.profile&&(s.stats=h.stats),s.destroy=function(){h.decRef()},s}function l(){xe(f).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(xn,e.renderbuffer),t.renderbufferStorage(xn,e.format,e.width,e.height)}),t.bindRenderbuffer(xn,null)}var u={rgba4:_n,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(u.srgba=35907),e.ext_color_buffer_half_float&&(u.rgba16f=34842,u.rgb16f=34843),e.webgl_color_buffer_float&&(u.rgba32f=34836);var c=[];Object.keys(u).forEach(function(t){var e=u[t];c[e]=t});var h=0,f={};return a.prototype.decRef=function(){--this.refCount<=0&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:s,clear:function(){xe(f).forEach(o)},restore:l}},kn=36160,An=36161,Tn=3553,Sn=34069,En=36064,Ln=36096,Cn=36128,zn=33306,In=36053,Dn=6402,Pn=[6408],On=[];On[6408]=4;var Rn=[];Rn[5121]=1,Rn[5126]=4,Rn[36193]=2;var Fn=33189,jn=36168,Nn=34041,Bn=[32854,32855,36194,35907,34842,34843,34836],Un={};Un[In]="complete",Un[36054]="incomplete attachment",Un[36057]="incomplete dimensions",Un[36055]="incomplete, missing attachment",Un[36061]="unsupported";var Vn=5126,Hn=35632,qn=35633,Gn=35718,Yn=35721,Xn=6408,Wn=5121,Zn=3333,Jn=5126,Kn="xyzw".split(""),Qn=5121,$n=1,ti=2,ei=0,ri=1,ni=2,ii=3,ai=4,oi="dither",si="blend.enable",li="blend.color",ui="blend.equation",ci="blend.func",hi="depth.enable",fi="depth.func",di="depth.range",pi="depth.mask",mi="colorMask",vi="cull.enable",gi="cull.face",yi="frontFace",bi="lineWidth",xi="polygonOffset.enable",_i="polygonOffset.offset",wi="sample.alpha",Mi="sample.enable",ki="sample.coverage",Ai="stencil.enable",Ti="stencil.mask",Si="stencil.func",Ei="stencil.opFront",Li="stencil.opBack",Ci="scissor.enable",zi="scissor.box",Ii="viewport",Di="profile",Pi="framebuffer",Oi="vert",Ri="frag",Fi="elements",ji="primitive",Ni="count",Bi="offset",Ui="instances",Vi=Pi+"Width",Hi=Pi+"Height",qi=Ii+"Width",Gi=Ii+"Height",Yi="drawingBufferWidth",Xi="drawingBufferHeight",Wi=[ci,ui,Si,Ei,Li,ki,Ii,zi,_i],Zi=34962,Ji=34963,Ki=3553,Qi=34067,$i=2884,ta=3042,ea=3024,ra=2960,na=2929,ia=3089,aa=32823,oa=32926,sa=32928,la=5126,ua=35664,ca=35665,ha=35666,fa=5124,da=35667,pa=35668,ma=35669,va=35670,ga=35671,ya=35672,ba=35673,xa=35674,_a=35675,wa=35676,Ma=35678,ka=35680,Aa=4,Ta=1028,Sa=1029,Ea=2304,La=2305,Ca=32775,za=32776,Ia=519,Da=7680,Pa=0,Oa=1,Ra=32774,Fa=513,ja=36160,Na=36064,Ba={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ua=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Va={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ha={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},qa={frag:35632,vert:35633},Ga={cw:Ea,ccw:La},Ya=new Ht(!1,!1,!1,function(){}),Xa=34918,Wa=34919,Za=35007,Ja=function(t,e){function r(){return f.pop()||h.createQueryEXT()}function n(t){f.push(t)}function i(t){var e=r();h.beginQueryEXT(Za,e),d.push(e),u(d.length-1,d.length,t)}function a(){h.endQueryEXT(Za)}function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}function s(){return p.pop()||new o}function l(t){p.push(t)}function u(t,e,r){var n=s();n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,m.push(n)}function c(){var t,e,r=d.length;if(0!==r){g.length=Math.max(g.length,r+1),v.length=Math.max(v.length,r+1),v[0]=0,g[0]=0;var i=0;for(t=0,e=0;e=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a+=t,a=a.substr(0,r)}var i,a="";e.exports=n},{}],499:[function(e,r,n){!function(e,i){"function"==typeof t&&t.amd?t(i):"object"==typeof n?r.exports=i():e.resolveUrl=i()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return!0&t?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var a=0;a0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?o[t]:o)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}var o=t("robust-determinant"),s=6,l=[i,a];!function(){for(;l.length>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:m(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*u,p=o*l,m=o*s,g=i*u,y=i*l,b=a*s,x=c*(d-p)+h*(m-g)+f*(y-b),_=(Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(h)+(Math.abs(y)+Math.abs(b))*Math.abs(f),w=7.771561172376103e-16*_;return x>w||-x>w?x:v(t,e,r,n)}];!function(){for(;g.length<=p;)g.push(l(g.length));for(var t=[],r=["slow"],n=0;n<=p;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=p;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&s>0||o<0&&s<0)return!1;var l=a(r,t,e),u=a(i,t,e);return!(l>0&&u>0||l<0&&u<0)&&(0!==o||0!==s||0!==l||0!==u||n(t,e,r,i))}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":506}],510:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=-e[h],v=f(m);p=i?(a=d,(c+=1)=i?(a=d,(c+=1)0){for(var s=0,l=0,u=0;un.h||t>n.free||rc)&&(h=2*Math.max(t,c)),(ll)&&(u=2*Math.max(r,l)),this.resize(h,u),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],513:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],514:[function(t,e,r){"use strict";function n(t){return a(i(t))}e.exports=n;var i=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":67,"reduce-simplicial-complex":496}],515:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--n){n0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}(i[s]),l.push("break;");l.push("}}")}return l.push("}return R;};return getContour",t,"d"),new Function("pool",l.join(""))(a)}function i(t){var e=s[t];return e||(e=s[t]=n(t)),e}e.exports=i;var a=t("typedarray-pool"),o=t("marching-simplex-table"),s={}},{"marching-simplex-table":443,"typedarray-pool":539}],517:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;n>1,s=o(t[a],e);s<=0?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function h(t,e){for(var r=new Array(t.length),n=0,i=r.length;n=t.length||0!==o(t[m],a))break}return r}function f(t,e){if(!e)return h(u(p(t,0)),t,0);for(var r=new Array(e),n=0;n>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function p(t,e){if(e<0)return[];for(var r=[],n=(1<>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(n0;){var r=l(t);if(r>=0){if(e0){var t=k[0];return a(0,T-1),T-=1,u(0),t}return-1}function f(t,e){var r=k[t];return y[r]===e?t:(y[r]=-1/0,c(t),h(),y[r]=e,T+=1,c(T-1))}function d(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var p=e.length,m=t.length,v=new Array(p),g=new Array(p),y=new Array(p),b=new Array(p),x=0;x>1;x>=0;--x)u(x);for(;;){var S=h();if(S<0||y[S]>r)break;!function(t){if(!b[t]){b[t]=!0;var e=v[t],r=g[t];v[r]>=0&&(v[r]=e),g[e]>=0&&(g[e]=r),A[e]>=0&&f(A[e],i(e)),A[r]>=0&&f(A[r],i(r))}}(S)}for(var E=[],x=0;x=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&L.push([n,i])}}),o.unique(o.normalize(L)),{positions:E,edges:L}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":506,"simplicial-complex":519}],522:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),u=a(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=a(s,o,i),u=a(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":506}],523:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c=l.length)return n;d=l[c]}}if(d.start)if(o){var p=h(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":522,"binary-search-bounds":64,"functional-red-black-tree":133,"robust-orientation":506}],524:[function(t,e,r){"use strict";function n(t,e){var r=u(l(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=n-e,a=-e/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;u0||o>0&&c<0){var h=i(s,c,l,o);r.push(h),a.push(h.slice())}c<0?a.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=c}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&u<0)&&r.push(i(o,u,s,a)),u>=0&&r.push(s.slice()),a=u}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&u<0)&&r.push(i(o,u,s,a)),u<=0&&r.push(s.slice()),a=u}return r}var l=t("robust-dot-product"),u=t("robust-sum");e.exports=a,e.exports.positive=o,e.exports.negative=s},{"robust-dot-product":503,"robust-sum":511}],525:[function(e,r,n){!function(){"use strict";function e(t){return i(a(t),arguments)}function r(t,r){return e.apply(null,[t].concat(r||[]))}function i(t,r){var n,i,a,s,l,u,c,h,f,d=1,p=t.length,m="";for(i=0;i=0),s[8]){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s[6]?parseInt(s[6]):0);break;case"e":n=s[7]?parseFloat(n).toExponential(s[7]):parseFloat(n).toExponential();break;case"f":n=s[7]?parseFloat(n).toFixed(s[7]):parseFloat(n);break;case"g":n=s[7]?String(Number(n.toPrecision(s[7]))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s[7]?n.substring(0,s[7]):n;break;case"t":n=String(!!n),n=s[7]?n.substring(0,s[7]):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s[7]?n.substring(0,s[7]):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s[7]?n.substring(0,s[7]):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}o.json.test(s[8])?m+=n:(!o.number.test(s[8])||h&&!s[3]?f="":(f=h?"+":"-",n=n.toString().replace(o.sign,"")),u=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",c=s[6]-(f+n).length,l=s[6]&&c>0?u.repeat(c):"",m+=s[5]?f+n+l:"0"===u?f+l+n:l+f+n)}return m}function a(t){if(s[t])return s[t];for(var e,r=t,n=[],i=0;r;){if(null!==(e=o.text.exec(r)))n.push(e[0]);else if(null!==(e=o.modulo.exec(r)))n.push("%");else{if(null===(e=o.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){i|=1;var a=[],l=e[2],u=[];if(null===(u=o.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=o.key_access.exec(l)))a.push(u[1]);else{if(null===(u=o.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(u[1])}e[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push(e)}r=r.substring(e[0].length)}return s[t]=n}var o={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},s=Object.create(null);void 0!==n&&(n.sprintf=e,n.vsprintf=r),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=r,"function"==typeof t&&t.amd&&t(function(){return{sprintf:e,vsprintf:r}}))}()},{}],526:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l0;){e=f[f.length-1];var d=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=p}else{if(n[e]===r[e]){for(var v=[],g=[],y=0,p=l.length-1;p>=0;--p){var b=l[p];if(i[b]=!1,v.push(b),g.push(s[b]),y+=s[b].length,o[b]=c.length,b===e){l.length=p;break}}c.push(v);for(var x=new Array(y),p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return d(d({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function h(t){return 360*(t-.5)}function f(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var r in e)t[r]=e[r];return t}function p(t){return t.x}function m(t){return t.y}var v=t("kdbush");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(o);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=v(n,p,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=v(n,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),i=[],a=0;a c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],u=0;u>>7){");for(var u=0;u<1<<(1<128&&u%128==0){h.length>0&&f.push("}}");var d="vExtra"+h.length;n.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),f=["function ",d,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&u,":");for(var p=new Array(r),m=new Array(r),v=new Array(r),g=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(A="+"+v[x]+"*c");var T=p[x].length/y*.5,S=.5+g[x]/y*.5;k.push("d"+x+"-"+S+"-"+T+"*("+p[x].join("+")+A+")/("+m[x].join("+")+")")}f.push("a.push([",k.join(),"]);","break;")}n.push("}},"),h.length>0&&f.push("}}");for(var E=[],u=0;u<1<0&&(f+=.02);for(var p=new Float32Array(h),m=0,v=-.5*f,d=0;d=0?1.2:1))}function i(t,e,r,n,i,o,s){for(var l=0;l.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=S(t,360),e=S(e,100),r=S(r,100),0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function l(t,e,r){t=S(t,255),e=S(e,255),r=S(r,255);var n,i,a=q(t,e,r),o=H(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(e>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(n(i));return o}function A(t,e){e=e||6;for(var r=n(t).toHsv(),i=r.h,a=r.s,o=r.v,s=[],l=1/e;e--;)s.push(n({h:i,s:a,v:o})),o=(o+l)%1;return s}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function S(t,r){C(t)&&(t="100%");var n=z(t);return t=H(r,q(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function E(t){return H(1,q(0,t))}function L(t){return parseInt(t,16)}function C(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function z(t){return"string"==typeof t&&-1!=t.indexOf("%")}function I(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function P(t){return e.round(255*parseFloat(t)).toString(16)}function O(t){return L(t)/255}function R(t){return!!W.CSS_UNIT.exec(t)}function F(t){t=t.replace(N,"").replace(B,"").toLowerCase();var e=!1;if(Y[t])t=Y[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=W.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=W.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=W.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=W.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=W.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=W.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=W.hex8.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),a:O(r[4]),format:e?"name":"hex8"}:(r=W.hex6.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),format:e?"name":"hex"}:(r=W.hex4.exec(t))?{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),a:O(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=W.hex3.exec(t))&&{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),format:e?"name":"hex"}}function j(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var N=/^\s+/,B=/\s+$/,U=0,V=e.round,H=e.min,q=e.max,G=e.random;n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,n,i,a,o,s=this.toRgb();return t=s.r/255,r=s.g/255,n=s.b/255,i=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),a=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=T(t),this._roundA=V(100*this._a)/100,this},toHsv:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=l(this._r,this._g,this._b),e=V(360*t.h),r=V(100*t.s),n=V(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=V(360*t.h),r=V(100*t.s),n=V(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return h(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:V(this._r),g:V(this._g),b:V(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+V(this._r)+", "+V(this._g)+", "+V(this._b)+")":"rgba("+V(this._r)+", "+V(this._g)+", "+V(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:V(100*S(this._r,255))+"%",g:V(100*S(this._g,255))+"%",b:V(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+V(100*S(this._r,255))+"%, "+V(100*S(this._g,255))+"%, "+V(100*S(this._b,255))+"%)":"rgba("+V(100*S(this._r,255))+"%, "+V(100*S(this._g,255))+"%, "+V(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(X[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=n(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return n(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]="a"===i?t[i]:D(t[i]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:G(),g:G(),b:G()})},n.mix=function(t,e,r){r=0===r?0:r||50;var i=n(t).toRgb(),a=n(e).toRgb(),o=r/100;return n({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},n.readability=function(t,r){var i=n(t),a=n(r);return(e.max(i.getLuminance(),a.getLuminance())+.05)/(e.min(i.getLuminance(),a.getLuminance())+.05)},n.isReadable=function(t,e,r){var i,a,o=n.readability(t,e);switch(a=!1,i=j(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},n.mostReadable=function(t,e,r){var i,a,o,s,l=null,u=0;r=r||{},a=r.includeFallbackColors,o=r.level,s=r.size;for(var c=0;cu&&(u=i,l=n(e[c]));return n.isReadable(t,l,{level:o,size:s})||!a?l:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var Y=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},X=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(Y),W=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],533:[function(t,e,r){"use strict";function n(t,e){var r=o(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function i(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return i(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return s;case"cm":return s/2.54;case"mm":return s/25.4;case"pt":return s/72;case"pc":return s/6}return 1}var o=t("parse-unit");e.exports=a;var s=96},{"parse-unit":473}],534:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.topojson=e.topojson||{})}(this,function(t){"use strict";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:"Feature",properties:a,geometry:o}:null==i?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=h[t<0?~t:t],n=0,i=r.length;n1)n=i(t,e,r);else for(a=0,n=new Array(o=t.arcs.length);a1)for(var i,a,l=1,u=o(n[0]);lu&&(a=n[0],n[0]=n[l],n[l]=a,u=i);return n})}}var s=function(t){return t},l=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+l,t}},u=function(t){function e(t){s[0]=t[0],s[1]=t[1],o(s),s[0]h&&(h=s[0]),s[1]f&&(f=s[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,o=l(t),s=new Array(2),u=1/0,c=u,h=-u,f=-u;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++eh&&(h=s[0]),s[1]f&&(f=s[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[u,c,h,f]}return n},c=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},h=function(t,r){return"GeometryCollection"===r.type?{type:"FeatureCollection",features:r.geometries.map(function(r){return e(t,r)})}:e(t,r)},f=function(t,e){function r(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[t<0?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var u=n===e?e:e.concat(n);a[u.start=e.start]=o[u.end=n.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var c=n===e?e:n.concat(e);a[c.start=n.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},d=function(t){return r(t,n.apply(this,arguments))},p=function(t){return r(t,o.apply(this,arguments))},m=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=u(t),o=a[0],s=(a[2]-o)/(e-1)||1,l=a[1],c=(a[3]-l)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,u=t.length,h=t[0],f=h[0]=Math.round((h[0]-o)/s),d=h[1]=Math.round((h[1]-l)/c);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];h(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=d(r,p)/s,v=d(i,p)/s;u=Math.acos(m),l=Math.acos(v)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),h=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;o<3;++o)r[o]/=u;var c=this.computedToward;h(c,e,r),f(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],v=Math.cos(p),g=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=v*y,w=g*y,M=b,k=-v*b,A=-g*b,T=y,S=this.computedEye,E=this.computedMatrix,o=0;o<3;++o){var L=_*r[o]+w*c[o]+M*e[o];E[4*o+1]=k*r[o]+A*c[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],I=E[9],D=E[2],P=E[6],O=E[10],R=z*O-I*P,F=I*D-C*O,j=C*P-z*D,N=n(R,F,j);R/=N,F/=N,j/=N,E[0]=R,E[4]=F,E[8]=j;for(var o=0;o<3;++o)S[o]=x[o]+E[2+4*o]*d;for(var o=0;o<3;++o){for(var l=0,B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var m=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;m[0]=i[2],m[1]=i[6],m[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,m);for(var l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=c*e+o*r,v=h*e+s*r,g=f*e+l*r;this.center.move(t,m,v,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],c=e[o+4],h=e[o+8];if(a){var f=Math.abs(l),d=Math.abs(c),p=Math.abs(h),m=Math.max(f,d,p);f===m?(l=l<0?-1:1,c=h=0):p===m?(h=h<0?-1:1,l=c=0):(c=c<0?-1:1,l=h=0)}else{var v=n(l,c,h);l/=v,c/=v,h/=v}var g=e[s],y=e[s+4],b=e[s+8],x=g*l+y*c+b*h;g-=l*x,y-=c*x,b-=h*x;var _=n(g,y,b);g/=_,y/=_,b/=_;var w=c*b-h*y,M=h*g-l*b,k=l*y-c*g,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,l,c,h),this.right.jump(t,g,y,b);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*g+L*y+C*b,I=E*w+L*M+C*k;T=R<0?-Math.PI/2:Math.PI/2,S=Math.atan2(I,z)}else{var D=e[2],P=e[6],O=e[10],R=D*l+P*c+O*h,F=D*g+P*y+O*b,j=D*w+P*M+O*k;T=Math.asin(i(R)),S=Math.atan2(j,F)}this.angle.jump(t,S,T),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,X=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*X,G-B*X,Y-U*X)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],u=n(o,s,l);if(!(u<1e-6)){o/=u,s/=u,l/=u;var c=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(c,h,f);if(!(d<1e-6)){c/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],v=p[1],g=p[2],y=o*m+s*v+l*g;m-=y*o,v-=y*s,g-=y*l;var b=n(m,v,g);if(!(b<.01&&(m=s*f-l*h,v=l*c-o*f,g=o*h-s*c,(b=n(m,v,g))<1e-6))){m/=b,v/=b,g/=b,this.up.set(t,o,s,l),this.right.set(t,m,v,g),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*g-l*v,_=l*m-o*g,w=o*v-s*m,M=n(x,_,w);x/=M,_/=M,w/=M;var k=o*c+s*h+l*f,A=m*c+v*h+g*f,T=x*c+_*h+w*f,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var I=Math.abs(C+2*Math.PI-E),D=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);I0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function u(t){return new Uint32Array(o(4*t),0,t)}function c(t){return new Int8Array(o(t),0,t)}function h(t){return new Int16Array(o(2*t),0,t)}function f(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function m(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function g(t){t=y.nextPow2(t);var e=y.log2(t),r=M[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,M=_.BUFFER;r.free=function(t){if(n.isBuffer(t))M[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){M[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return u(t);case"int8":return c(t);case"int16":return h(t);case"int32":return f(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return m(t);case"buffer":return g(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=h,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=m,r.mallocDataView=v,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,M[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":65,buffer:75,dup:123}],540:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],543:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&u.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function a(t){return u.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t("punycode"),u=t("./util");r.parse=i,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=n;var c=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),v=["%","/","?",";","#"].concat(m),g=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},M=t("querystring");n.prototype.parse=function(t,e,r){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?P+="x":P+=D[O];if(!P.match(y)){var F=z.slice(0,T),j=z.slice(T+1),N=D.match(b);N&&(F.push(N[1]),j.unshift(N[2])),j.length&&(s="/"+j.join(".")+s),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=l.toASCII(this.hostname));var B=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+B,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!x[p])for(var T=0,I=m.length;T0)&&r.host.split("@");A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return r.search=t.search,r.query=t.query,u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=M.slice(-1)[0],S=(r.host||t.host||M.length>1)&&("."===T||".."===T)||""===T,E=0,L=M.length;L>=0;L--)T=M[L],"."===T?M.splice(L,1):".."===T?(M.splice(L,1),E++):E&&(M.splice(L,1),E--);if(!b&&!x)for(;E--;E)M.unshift("..");!b||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),S&&"/"!==M.join("/").substr(-1)&&M.push("");var C=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=C?"":M.length?M.shift():"";var A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return b=b||r.host&&M.length,b&&!C&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=h.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":544,punycode:486,querystring:490}],544:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],545:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],546:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],547:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return b(i)||(i=l(t,i,n)),i}var a=u(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),A(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(e);if(0===o.length){if(T(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(k(e))return t.stylize(Date.prototype.toString.call(e),"date");if(A(e))return c(e)}var g="",y=!1,x=["{","}"];if(p(e)&&(y=!0,x=["[","]"]),T(e)){g=" [Function"+(e.name?": "+e.name:"")+"]"}if(w(e)&&(g=" "+RegExp.prototype.toString.call(e)),k(e)&&(g=" "+Date.prototype.toUTCString.call(e)),A(e)&&(g=" "+c(e)),0===o.length&&(!y||0==e.length))return x[0]+g+x[1];if(n<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var _;return _=y?h(t,e,n,m,o):o.map(function(r){return f(t,e,n,m,r,y)}),t.seen.pop(),d(_,g,x)}function u(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i){for(var a=[],o=0,s=e.length;o-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t,e,r){var n=0;return t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function _(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===E(t)}function M(t){return"object"==typeof t&&null!==t}function k(t){return M(t)&&"[object Date]"===E(t)}function A(t){return M(t)&&("[object Error]"===E(t)||t instanceof Error)}function T(t){return"function"==typeof t}function S(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function E(t){return Object.prototype.toString.call(t)}function L(t){return t<10?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[L(t.getHours()),L(t.getMinutes()),L(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}function z(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var I=/%[sdj%]/g;r.format=function(t){if(!b(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),au&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var o=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":550}],552:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d"))},{"./lib/vtext":553}],553:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}function l(t){for(var e=[],r=0,n=0,i=t.length,a=0;a=0?l[r]:e)}function e(t){var e=n(t);return e?u in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[u]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function o(t){var e,r,i=n(t);return i?u in i&&delete i[u]:!((e=s.indexOf(t))<0)&&(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0)}this instanceof x||a();var s=[],l=[],u=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};x.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?function(){function r(){function e(t,e){return c?u.has(t)?u.get(t):c.get___(t,e):u.get(t,e)}function r(t){return u.has(t)||!!c&&c.has___(t)}function n(t){var e=!!u.delete(t);return c?c.delete___(t)||e:e}this instanceof x||a();var l,u=new s,c=void 0,h=!1;return l=o?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new x),c.set(t,e)),this}:function(t,e){if(h)try{u.set(t,e)}catch(r){c||(c=new x),c.set___(t,e)}else u.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");h=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],558:[function(t,e,r){function n(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":559}],559:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],560:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":558}],561:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":145}],562:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){v[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];v[n]||r(n)}} -for(var s,l=Object.keys(a),u=0,c=l.length;u=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=p[a.year-p[0]];var l,u=o>>9&4095,c=o>>5&15,h=31&o,f=new Date(u,c-1,h),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-f)/864e5);var v,g=d[a.year-d[0]];for(v=0;v<13;v++){var y=g&1<<12-v?30:29;if(l>13;return!b||v=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var u,c=d[o.year-d[0]],h=c>>13;u=h?o.month>h?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var f=0;f>9&4095,g=m>>5&15,y=31&m,b=new Date(v,g-1,y+l);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}var o=t("../main"),s=t("object-assign"),l=o.instance();n.prototype=new o.baseCalendar,s(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(c);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(h);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(f);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t),n=r?12:11;if(e<0||e>n)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,o.local.invalidyear),a=p[i-p[0]],s=a>>9&4095,u=a>>5&15,c=31&a;n=l.newDate(s,u,c),n.add(4-(n.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=d[t-d[0]];if(e>(r>>13?12:11))throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,o.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),u=a(t,s,r,i);return l.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=l.fromJD(t),r=i(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(u),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if("y"===r){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),f=o&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);f!==c&&l.month(f)}return l}});var u=/^\s*(-?\d\d\d\d|\d\d)[-\/](\d?\d)([iI]?)[-\/](\d?\d)/m,c=/^\d?\d[iI]?/m,h=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,f=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;o.calendars.chinese=n;var d=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{"../main":579,"object-assign":468}],566:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.coptic=n},{"../main":579,"object-assign":468}],567:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){return(this._validate(t,e,r,i.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:o[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":579,"object-assign":468}],568:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":579,"object-assign":468}],569:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),a.calendars.hebrew=n},{"../main":579,"object-assign":468}],570:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":579,"object-assign":468}],571:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()<0?e.year()+1:e.year();return t%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=e+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),i.calendars.julian=n},{"../main":579,"object-assign":468}],572:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main"),s=t("object-assign");n.prototype=new o.baseCalendar,s(n.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if(t=t.split("."),t.length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate),i=n.toJD(),a=this._toHaab(i),s=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){t-=this.jdEpoch;var e=i(t+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":579,"object-assign":468}],573:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth),t=n.year();t<0&&t++;for(var a=n.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),i.calendars.nanakshahi=n},{"../main":579,"object-assign":468}],574:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance(),r=e.fromJD(t),n=r.year(),a=r.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)s++,s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=t-this.toJD(475,1,1),r=Math.floor(e/1029983),n=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),h=t-this.toJD(l,c,1)+1;return this.newDate(l,c,h)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":579,"object-assign":468}],576:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),i.calendars.taiwan=n},{"../main":579,"object-assign":468}],577:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),i.calendars.thai=n},{"../main":579,"object-assign":468}],578:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,i.local.invalidMonth),n=r.toJD()-24e5+.5,a=0,s=0;sn)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),a=12*(n.year()-1)+n.month()-15292;return n.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(t=null!=t.year?t.year:t,n=t>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":579,"object-assign":468}],579:[function(t,e,r){function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance(),n.newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),l(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name) -;var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0),i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new n;u.cdate=i,u.baseCalendar=o,u.calendars.gregorian=s},{"object-assign":468}],580:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat,r=r||{};for(var n=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;v+n1}),c=function(t,e,r,n){var i=""+e;if(u(t,n))for(;i.length1},b=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,_=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=m;for(var T=this.daysInMonth(f,d);p>T;T=this.daysInMonth(f,d))d++,p-=T}return h>-1?this.fromJD(h):this.newDate(f,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}t=t.toLowerCase();for(var e=(t.match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":579,"object-assign":468}],581:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":108}],582:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":581}],583:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,o,r,i)}s=s||{},l=l||{};var c=u("visible",!l.itemIsNotPlainObject),h=u("clicktoshow");if(!c&&!h)return e;a(t,e,r,u);for(var f=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},v=0;v<2;v++){var g=d[v],y=i.coerceRef(t,e,m,g,"","paper");if(i.coercePosition(e,m,u,y,g,.5),f){var b="a"+g,x=i.coerceRef(t,e,m,b,"pixel");"pixel"!==x&&x!==y&&(x=e[b]="pixel");var _="pixel"===x?p[v]:.4;i.coercePosition(e,m,u,x,b,_)}u(g+"anchor"),u(g+"shift")}if(n.noneOrAll(t,e,["x","y"]),f&&n.noneOrAll(t,e,["ax","ay"]),h){var w=u("xclick"),M=u("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":724,"../../plots/cartesian/axes":764,"./attributes":585,"./common_defaults":588}],584:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],585:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},i,{}),width:{valType:"number",min:1,dflt:null},height:{valType:"number",min:1,dflt:null},opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},xshift:{valType:"number",dflt:0},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},yshift:{valType:"number",dflt:0},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},hovertext:{valType:"string"},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:o({},i,{})},captureevents:{valType:"boolean"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":715,"../../plots/cartesian/constants":769,"../../plots/font_attributes":788,"./arrow_paths":584}],586:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i=a.getFromId(t,e.xref),o=a.getFromId(t,e.yref),s=3*e.arrowsize*e.arrowwidth||0;i&&i.autorange&&(r=s+e.xshift,n=s-e.xshift,e.axref===e.xref?(a.expand(i,[i.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(i,[i.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):a.expand(i,[i.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),o&&o.autorange&&(r=s-e.yshift,n=s+e.yshift,e.ayref===e.yref?(a.expand(o,[o.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(o,[o.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):a.expand(o,[o.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=!0,s[t.yref]=!0});if(a.list(t).filter(function(t){return t.autorange&&s[t._id]}).length)return i.syncOrAsync([o,n],t)}}},{"../../lib":724,"../../plots/cartesian/axes":764,"./draw":591}],587:[function(t,e,r){"use strict";function n(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0}function i(t,e){var r,n=a(t,e),i=n.on,o=n.off.concat(n.explicitOff),l={};if(i.length||o.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var o=j.selectAll("a");if(1===o.size()&&o.text()===j.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":o.attr("xlink:href"),"xlink:xlink:show":o.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(P.node())}var l=C.select(".annotation-text-math-group"),c=!l.empty(),d=f.bBox((c?l:j).node()),y=d.width,L=d.height,I=e.width||y,F=e.height||L,N=Math.round(I+2*D),B=Math.round(F+2*D);e._w=I,e._h=F;for(var U=!1,V=["x","y"],H=0;H1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;q=Q._offset+Q.r2p(e[Z]),X=.5}else"x"===Z?(Y=e[Z],q=_.l+_.w*Y):(Y=1-e[Z],q=_.t+_.h*Y),X=e.showarrow?.5:Y;if(e.showarrow){at.head=q;var st=e["a"+Z];W=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=W):(at.tail=q+st,G=W+st),at.text=at.tail+W;var lt=x["x"===Z?"width":"height"];if("paper"===J&&(at.head=u.constrain(at.head,1,lt-1)),"pixel"===K){var ut=-Math.max(at.tail-3,at.text),ct=Math.min(at.tail+3,at.text)-lt;ut>0?(at.tail+=ut,at.text+=ut):ct>0&&(at.tail-=ct,at.text-=ct)}at.tail+=it,at.head+=it}else W=rt*r(X,nt),G=W,at.text=q+W;at.text+=it,W+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=W}if(U)return void C.remove();var ht=0,ft=0;if("left"!==e.align&&(ht=(I-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ft=(F-L)*("middle"===e.valign?.5:1)),c)l.select("svg").attr({x:D+ht-1,y:D+ft}).call(f.setClipUrl,O?M:null);else{var dt=D+ft-d.top,pt=D+ht-d.left;j.call(p.positionText,pt,dt).call(f.setClipUrl,O?M:null)}R.select("rect").call(f.setRect,D,D,I,F),P.call(f.setRect,z/2,z/2,N-z,B-z),C.call(f.setTranslate,Math.round(k.x.text-N/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+A+","+k.x.text+","+k.y.text+")"});var mt=function(r,o){T.selectAll(".annotation-arrow-g").remove();var l=k.x.head,c=k.y.head,d=k.x.tail+r,p=k.y.tail+o,m=k.x.text+r,y=k.y.text+o,x=u.rotationXYMatrix(A,m,y),M=u.apply2DTransform(x),E=u.apply2DTransform2(x),L=+P.attr("width"),z=+P.attr("height"),I=m-.5*L,D=I+L,O=y-.5*z,R=O+z,F=[[I,O,I,R],[I,R,D,R],[D,R,D,O],[D,O,I,O]].map(E);if(!F.reduce(function(t,e){return t^!!u.segmentsIntersect(l,c,l+1e6,c+1e6,e[0],e[1],e[2],e[3])},!1)){F.forEach(function(t){var e=u.segmentsIntersect(d,p,l,c,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var j=e.arrowwidth,N=e.arrowcolor,B=T.append("g").style({opacity:h.opacity(N)}).classed("annotation-arrow-g",!0),U=B.append("path").attr("d","M"+d+","+p+"L"+l+","+c).style("stroke-width",j+"px").call(h.stroke,h.rgb(N));if(g(U,e.arrowhead,"end",e.arrowsize,e.standoff),w.annotationPosition&&U.node().parentNode&&!n){var V=l,H=c;if(e.standoff){var q=Math.sqrt(Math.pow(l-d,2)+Math.pow(c-p,2));V+=e.standoff*(d-l)/q,H+=e.standoff*(p-c)/q}var G,Y,X,W=B.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(p-H),transform:"translate("+V+","+H+")"}).style("stroke-width",j+6+"px").call(h.stroke,"rgba(0,0,0,0)").call(h.fill,"rgba(0,0,0,0)");v.init({element:W.node(),gd:t,prepFn:function(){var t=f.getTranslate(C);Y=t.x,X=t.y,G={},i&&i.autorange&&(G[i._name+".autorange"]=!0),a&&a.autorange&&(G[a._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(Y,X),o=n[0]+t,s=n[1]+r;C.call(f.setTranslate,o,s),G[b+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,G[b+".y"]=a?a.p2r(a.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(G[b+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(G[b+".ay"]=a.p2r(a.r2p(e.ay)+r)),B.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+A+","+o+","+s+")"})},doneFn:function(e){if(e){s.relayout(t,G);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(e.showarrow&&mt(0,0),E){var vt,gt;v.init({element:C.node(),gd:t,prepFn:function(){gt=S.attr("transform"),vt={}},moveFn:function(t,r){var o="pointer";if(e.showarrow)e.axref===e.xref?vt[b+".ax"]=i.p2r(i.r2p(e.ax)+t):vt[b+".ax"]=e.ax+t,e.ayref===e.yref?vt[b+".ay"]=a.p2r(a.r2p(e.ay)+r):vt[b+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)vt[b+".x"]=e.x+t/i._m;else{var s=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-s/2;vt[b+".x"]=v.align(l+t/_.w,s,0,1,e.xanchor)}if(a)vt[b+".y"]=e.y+r/a._m;else{var u=e._ysize/_.h,c=e.y-(e._yshift+e.yshift)/_.h-u/2;vt[b+".y"]=v.align(c-r/_.h,u,0,1,e.yanchor)}i&&a||(o=v.getCursor(i?.5:vt[b+".x"],a?.5:vt[b+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+gt}),m(C,o)},doneFn:function(e){if(m(C),e){s.relayout(t,vt);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var y,b,x=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,b=n+".annotations["+r+"]"):(y="annotation",b="annotations["+r+"]"),x._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+x._uid+"_ann"+r;if(!e._input||!1===e.visible)return void o.selectAll("#"+M).remove();var k={x:{},y:{}},A=+e.textangle||0,T=x._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=T.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(m,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:o.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();d.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:t})}).on("mouseout",function(){d.loneUnhover(x._hoverlayer.node())});var z=e.borderwidth,I=e.borderpad,D=z+I,P=C.append("rect").attr("class","bg").style("stroke-width",z+"px").call(h.stroke,e.bordercolor).call(h.fill,e.bgcolor),O=e.width||e.height,R=x._defs.select(".clips").selectAll("#"+M).data(O?[0]:[]);R.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),R.exit().remove();var F=e.font,j=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?j.call(p.makeEditable,{delegate:C,gd:t}).call(l).on("edit",function(r){e.text=r,this.call(l);var n={};n[b+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),a&&a.autorange&&(n[a._name+".autorange"]=!0),s.relayout(t,n)}):j.call(l)}var o=t("d3"),s=t("../../plotly"),l=t("../../plots/plots"),u=t("../../lib"),c=t("../../plots/cartesian/axes"),h=t("../color"),f=t("../drawing"),d=t("../fx"),p=t("../../lib/svg_text_utils"),m=t("../../lib/setcursor"),v=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:n,drawOne:i,drawRaw:a}},{"../../lib":724,"../../lib/setcursor":739,"../../lib/svg_text_utils":743,"../../plotly":759,"../../plots/cartesian/axes":764,"../../plots/plots":827,"../color":602,"../dragelement":623,"../drawing":626,"../fx":643,"./draw_arrow_head":592,d3:120}],592:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../color"),o=t("../drawing"),s=t("./arrow_paths");e.exports=function(t,e,r,l,u){function c(){t.style("stroke-dasharray","0px,100px")}function h(r,i){d.path&&(e>5&&(i=0),n.select(f.parentNode).append("path").attr({class:t.attr("class"),d:d.path,transform:"translate("+r.x+","+r.y+")rotate("+180*i/Math.PI+")scale("+y+")"}).style({fill:b,opacity:x,"stroke-width":0}))}i(l)||(l=1);var f=t.node(),d=s[e||0];"string"==typeof r&&r||(r="end");var p,m,v,g,y=(o.getPx(t,"stroke-width")||1)*l,b=t.style("stroke")||a.defaultLine,x=t.style("stroke-opacity")||1,_=r.indexOf("start")>=0,w=r.indexOf("end")>=0,M=d.backoff*y+u;if("line"===f.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},m={x:+t.attr("x2"),y:+t.attr("y2")};var k=p.x-m.x,A=p.y-m.y;if(v=Math.atan2(A,k),g=v+Math.PI,M){if(M*M>k*k+A*A)return void c();var T=M*Math.cos(v),S=M*Math.sin(v);_&&(p.x-=T,p.y-=S,t.attr({x1:p.x,y1:p.y})),w&&(m.x+=T,m.y+=S,t.attr({x2:m.x,y2:m.y}))}}else if("path"===f.nodeName){var E=f.getTotalLength(),L="";if(E1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l.pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":816,"../annotations/draw":591}],598:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"annotations3d",schema:{layout:{"scene.annotations":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),convert:t("./convert"),draw:t("./draw")}},{"./attributes":594,"./convert":595,"./defaults":596,"./draw":597}],599:[function(t,e,r){"use strict";e.exports=t("world-calendars/dist/main"),t("world-calendars/dist/plus"),t("world-calendars/dist/calendars/chinese"),t("world-calendars/dist/calendars/coptic"),t("world-calendars/dist/calendars/discworld"),t("world-calendars/dist/calendars/ethiopian"),t("world-calendars/dist/calendars/hebrew"),t("world-calendars/dist/calendars/islamic"),t("world-calendars/dist/calendars/julian"),t("world-calendars/dist/calendars/mayan"),t("world-calendars/dist/calendars/nanakshahi"),t("world-calendars/dist/calendars/nepali"),t("world-calendars/dist/calendars/persian"),t("world-calendars/dist/calendars/taiwan"),t("world-calendars/dist/calendars/thai"),t("world-calendars/dist/calendars/ummalqura")},{"world-calendars/dist/calendars/chinese":565,"world-calendars/dist/calendars/coptic":566,"world-calendars/dist/calendars/discworld":567,"world-calendars/dist/calendars/ethiopian":568,"world-calendars/dist/calendars/hebrew":569,"world-calendars/dist/calendars/islamic":570,"world-calendars/dist/calendars/julian":571,"world-calendars/dist/calendars/mayan":572,"world-calendars/dist/calendars/nanakshahi":573,"world-calendars/dist/calendars/nepali":574,"world-calendars/dist/calendars/persian":575,"world-calendars/dist/calendars/taiwan":576,"world-calendars/dist/calendars/thai":577,"world-calendars/dist/calendars/ummalqura":578,"world-calendars/dist/main":579,"world-calendars/dist/plus":580}],600:[function(t,e,r){"use strict";function n(t,e,r){for(var n,a,o,s,l,u=Math.floor((e+.05)/h)+c,f=i(r).fromJD(u),d=0;-1!==(d=t.indexOf("%",d));)n=t.charAt(d+1),"0"===n||"-"===n||"_"===n?(o=3,a=t.charAt(d+2),"_"===n&&(n="-")):(a=n,n="0",o=2),s=b[a],s?(l=s===y?y:f.formatDate(s[n]),t=t.substr(0,d)+l+t.substr(d+o),d+=l.length):d+=o;return t}function i(t){var e=x[t];return e||(e=x[t]=s.instance(t))}function a(t){return l.extendFlat({},f,{description:t})}function o(t){return"Sets the calendar system to use with `"+t+"` date data."}var s=t("./calendars"),l=t("../../lib"),u=t("../../constants/numerical"),c=u.EPOCHJD,h=u.ONEDAY,f={valType:"enumerated",values:Object.keys(s.calendars),dflt:"gregorian"},d=function(t,e,r,n){var i={};return i[r]=f,l.coerce(t,e,i,r,n)},p=function(t,e,r,n){for(var i=0;i=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var u=o.background=s.background;o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||u).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);return 1!==n.getAlpha()&&(n=i(o.combine(t,u))),(n.isDark()?e?n.lighten(e):u:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;es&&(a[1]-=(ct-s)/2):r.node()&&!r.classed("js-placeholder")&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===M.titleside)rt.domain[1]-=ct/E.h,a[1]*=-1;else{rt.domain[0]+=ct/E.h;var u=v.lineCount(r);a[1]+=(1-u)*s}e.attr("transform","translate("+a+")"),rt.setScale()}}lt.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(E.h*(1-rt.domain[1]))+")");var h=lt.select(".cbfills").selectAll("rect.cbfill").data(D);h.enter().append("rect").classed("cbfill",!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var r=[0===e?z[0]:(D[e]+D[e-1])/2,e===D.length-1?z[1]:(D[e]+D[e+1])/2].map(rt.c2p).map(Math.round);e!==D.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=O(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:J,width:Math.max(H,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var f=lt.select(".cblines").selectAll("path.cbline").data(M.line.color&&M.line.width?I:[]);return f.enter().append("path").classed("cbline",!0),f.exit().remove(),f.each(function(t){n.select(this).attr("d","M"+J+","+(Math.round(rt.c2p(t))+M.line.width/2%1)+"h"+H).call(d.lineGroupStyle,M.line.width,P(t),M.line.dash)}),rt._axislayer.selectAll("g."+rt._id+"tick,path").remove(),rt._pos=J+H+(M.outlinewidth||0)/2-("outside"===M.ticks?1:0),rt.side="right",c.syncOrAsync([function(){return l.doTicks(t,rt,!0)},function(){if(-1===["top","bottom"].indexOf(M.titleside)){var e=rt.titlefont.size,r=rt._offset+rt._length/2,i=E.l+(rt.position||0)*E.w+("right"===rt.side?10+e*(rt.showticklabels?1:.5):-10-e*(rt.showticklabels?.5:0));A("h"+rt._id+"title",{avoid:{selection:n.select(t).selectAll("g."+rt._id+"tick"),side:M.titleside,offsetLeft:E.l,offsetTop:E.t,maxShift:S.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function A(e,r){var n,i=w();n=s.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:rt,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:lt.select(".cbtitle")},o="h"===e.charAt(0)?e.substr(1):"h"+e;lt.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(t,e,h(a,r||{}))}function T(){var r=H+M.outlinewidth/2+d.bBox(rt._axislayer.node()).width;if(B=ut.select("text"),B.node()&&!B.classed("js-placeholder")){var n,i=ut.select(".h"+rt._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(M.titleside)?d.bBox(i).width:d.bBox(ut.node()).right-J-E.l,r=Math.max(r,n)}var a=2*M.xpad+r+M.borderwidth+M.outlinewidth/2,s=$-tt;lt.select(".cbbg").attr({x:J-M.xpad-(M.borderwidth+M.outlinewidth)/2,y:tt-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,M.bgcolor).call(p.stroke,M.bordercolor).style({"stroke-width":M.borderwidth}),lt.selectAll(".cboutline").attr({x:J,y:tt+M.ypad+("top"===M.titleside?ct:0),width:Math.max(H,2),height:Math.max(s-2*M.ypad-ct,2)}).call(p.stroke,M.outlinecolor).style({fill:"None","stroke-width":M.outlinewidth});var l=({center:.5,right:1}[M.xanchor]||0)*a;lt.attr("transform","translate("+(E.l-l)+","+E.t+")"),o.autoMargin(t,e,{x:M.x,y:M.y,l:a*({right:1,center:.5}[M.xanchor]||0),r:a*({left:1,center:.5}[M.xanchor]||0),t:s*({bottom:1,middle:.5}[M.yanchor]||0),b:s*({top:1,middle:.5}[M.yanchor]||0)})}var S=t._fullLayout,E=S._size;if("function"!=typeof M.fillcolor&&"function"!=typeof M.line.color)return void S._infolayer.selectAll("g."+e).remove();var L,C,z=n.extent(("function"==typeof M.fillcolor?M.fillcolor:M.line.color).domain()),I=[],D=[],P="function"==typeof M.line.color?M.line.color:function(){return M.line.color},O="function"==typeof M.fillcolor?M.fillcolor:function(){return M.fillcolor},R=M.levels.end+M.levels.size/100,F=M.levels.size,j=1.001*z[0]-.001*z[1],N=1.001*z[1]-.001*z[0];for(C=0;C<1e5&&(L=M.levels.start+C*F,!(F>0?L>=R:L<=R));C++)L>j&&L0?L>=R:L<=R));C++)L>z[0]&&L1){var st=Math.pow(10,Math.floor(Math.log(ot)/Math.LN10));it*=st*c.roundUp(ot/st,[2,5,10]),(Math.abs(M.levels.start)/M.levels.size+1e-6)%1<2e-6&&(rt.tick0=0)}rt.dtick=it}rt.domain=[Q+Z,Q+Y-Z],rt.setScale();var lt=S._infolayer.selectAll("g."+e).data([0]);lt.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),lt.attr("transform","translate("+Math.round(E.l)+","+Math.round(E.t)+")");var ut=lt.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(E.l)+",-"+Math.round(E.t)+")");rt._axislayer=lt.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(M.titleside)){var ht,ft=E.l+(M.x+X)*E.w,dt=rt.titlefont.size;ht="top"===M.titleside?(1-(Q+Y-Z))*E.h+E.t+3+.75*dt:(1-(Q+Z))*E.h+E.t-3-.25*dt,A(rt._id+"title",{attributes:{x:ft,y:ht,"text-anchor":"start"}})}var pt=c.syncOrAsync([o.previousPromises,k,o.previousPromises,T],t);if(pt&&pt.then&&(t._promises||[]).push(pt),t._context.edits.colorbarPosition){var mt,vt,gt;u.init({element:lt.node(),gd:t,prepFn:function(){mt=lt.attr("transform"),f(lt)},moveFn:function(t,e){lt.attr("transform",mt+" translate("+t+","+e+")"),vt=u.align(K+t/E.w,q,0,1,M.xanchor),gt=u.align(Q-e/E.h,Y,0,1,M.yanchor);var r=u.getCursor(vt,gt,M.xanchor,M.yanchor);f(lt,r)},doneFn:function(e){f(lt),e&&void 0!==vt&&void 0!==gt&&a.restyle(t,{"colorbar.x":vt,"colorbar.y":gt},w().index)}})}return pt}function w(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":724,"./flip_scale":613,"./scales":620}],609:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":715,"./attributes":607,"./scales.js":620}],610:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":620}],611:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var h=c.prefix,f=c.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,v=p[f+"min"],g=p[f+"max"],y=p.colorscale;u(h+f+"auto",!(n(v)&&n(g)&&v=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],614:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":610,"./is_valid_scale_array":618,"./scales":620}],615:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],622:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":724}],623:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&l.plot(t)}function a(t){return o(t.changedTouches?t.changedTouches[0]:t,document.body)}var o=t("mouse-event-offset"),s=t("has-hover"),l=t("../../plotly"),u=t("../../lib"),c=t("../../plots/cartesian/constants"),h=t("../../constants/interactions"),f=e.exports={};f.align=t("./align"),f.getCursor=t("./cursor");var d=t("./unhover");f.unhover=d.wrapped,f.unhoverRaw=d.raw,f.init=function(t){function e(e){y._dragged=!1,y._dragging=!0;var i=a(e);return l=i[0],d=i[1],g=e.target,p=(new Date).getTime(),p-y._mouseDownTimex&&(b=Math.max(b-1,1)),t.doneFn&&t.doneFn(y._dragged,b,e),!y._dragged){var n;try{n=new MouseEvent("click",e)}catch(t){var l=a(e);n=document.createEvent("MouseEvents"),n.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,l[0],l[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}g.dispatchEvent(n)}return i(y),y._dragged=!1,u.pauseEvent(e)}var l,d,p,m,v,g,y=t.gd,b=1,x=h.DBLCLICKDELAY;y._mouseDownTime||(y._mouseDownTime=0),t.element.style.pointerEvents="all",t.element.onmousedown=e,t.element.ontouchstart=e},f.coverSlip=n},{"../../constants/interactions":703,"../../lib":724,"../../plotly":759,"../../plots/cartesian/constants":769,"./align":621,"./cursor":622,"./unhover":624,"has-hover":286,"mouse-event-offset":451}],624:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/events":714}],625:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},{}],626:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){if(u.traceIs(r,"symbols")){var l=y(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:g.isBubble(r)?l(t.ms):(a.size||6)/2,t.mrc=e;var n=b.symbolNumber(t.mx||a.symbol)||0,i=n%100;return t.om=n%200>=100,b.symbolFuncs[i](e)+(n>=200?w:"")}).style("opacity",function(t){return(t.mo+1||a.opacity+1)-1})}var h,f,d,p=!1;if(t.so?(d=o.outlierwidth,f=o.outliercolor,h=a.outliercolor):(d=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,f="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(o.color)?c.defaultLine:o.color,Array.isArray(a.color)&&(h=c.defaultLine,p=!0),h="mc"in t?t.mcc=n(t.mc):a.color||"rgba(0,0,0,0)"),t.om)e.call(c.stroke,h).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",d+"px");var m=a.gradient,v=t.mgt;if(v?p=!0:v=m&&m.type,v&&"none"!==v){var x=t.mgc;x?p=!0:x=m.color;var _="g"+s._fullLayout._uid+"-"+r.uid;p&&(_+="-"+t.i),e.call(b.gradient,s,_,v,h,x)}else e.call(c.fill,h);d&&e.call(c.stroke,f)}}function i(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+a*a,T/2),c=Math.pow(s*s+l*l,T/2),h=(c*c*i-u*u*s)*n,f=(c*c*a-u*u*l)*n,d=3*c*(u+c),p=3*u*(u+c);return[[o.round(e[0]+(d&&h/d),2),o.round(e[1]+(d&&f/d),2)],[o.round(e[0]-(p&&h/p),2),o.round(e[1]-(p&&f/p),2)]]}function a(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var o=t("d3"),s=t("fast-isnumeric"),l=t("tinycolor2"),u=t("../../registry"),c=t("../color"),h=t("../colorscale"),f=t("../../lib"),d=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),m=t("../../constants/alignment"),v=m.LINE_SPACING,g=t("../../traces/scatter/subtypes"),y=t("../../traces/scatter/make_bubble_size_func"),b=e.exports={};b.font=function(t,e,r,n){f.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(c.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(s(i)&&s(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},b.translatePoints=function(t,e,r){t.each(function(t){var n=o.select(this);b.translatePoint(t,n,e,r)})},b.hideOutsideRangePoint=function(t,e,r,n){e.attr("display",r.isPtWithinRange(t)&&n.isPtWithinRange(t)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(t){b.hideOutsideRangePoint(t,o.select(this),r,n)})}},b.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},b.crispRound=function(t,e,r){return e&&s(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,s=n||i.dash||"";o.select(this).call(c.stroke,r||i.color).call(b.dashLine,s,a)})},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},b.singleFillStyle=function(t){var e=o.select(t.node()),r=e.data(),n=(((r[0]||[])[0]||{}).trace||{}).fillcolor;n&&t.call(c.fill,n)},b.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=o.select(this);try{r.call(c.fill,e[0].trace.fillcolor)}catch(e){f.error(e,t),r.remove()}})};var x=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolList=[],Object.keys(x).forEach(function(t){var e=x[t];b.symbolList=b.symbolList.concat([e.n,t,e.n+100,t+"-open"]),b.symbolNames[e.n]=t,b.symbolFuncs[e.n]=e.f,e.needLine&&(b.symbolNeedLines[e.n]=!0),e.noDot?b.symbolNoDot[e.n]=!0:b.symbolList=b.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var _=b.symbolNames.length,w="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";b.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=b.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var M={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0};b.gradient=function(t,e,r,n,i,a){var s=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],f.identity);s.exit().remove(),s.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=o.select(this);"horizontal"===n?t.attr(M):"vertical"===n&&t.attr(k),t.attr("id",r);var e=l(i),s=l(a);t.append("stop").attr({offset:"0%","stop-color":c.tinyRGB(s),"stop-opacity":s.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":c.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},b.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},b.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;n(t,e,r,i,a,s,s.line,o)},b.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=b.tryColorscale(n,""),a=b.tryColorscale(n,"line");t.each(function(t){b.singlePointStyle(t,o.select(this),e,i,a,r)})}},b.tryColorscale=function(t,e){var r=e?f.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?h.makeColorScaleFunc(h.extractScale(n,r.cmin,r.cmax)):f.identity};var A={start:1,end:-1,middle:0,bottom:1,top:-1};b.textPointStyle=function(t,e,r){t.each(function(t){var n=o.select(this),i=t.tx||e.text;if(!i||Array.isArray(i))return void n.remove();var a=t.tp||e.textposition,l=-1!==a.indexOf("top")?"top":-1!==a.indexOf("bottom")?"bottom":"middle",u=-1!==a.indexOf("left")?"end":-1!==a.indexOf("right")?"start":"middle",c=t.ts||e.textfont.size,h=t.mrc?t.mrc/.8+1:0;c=s(c)&&c>0?c:0,n.call(b.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",u).text(i).call(d.convertToTspans,r);var f=o.select(this.parentNode),p=(d.lineCount(n)-1)*v+1,m=A[u]*h,g=.75*c+A[l]*h+(A[l]-1)*p*c/2;f.attr("transform","translate("+m+","+g+")")})};var T=.5;b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},L=0),r&&(b.savedBBoxes[r]=g),L++,f.extendFlat({},g)},b.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},b.getTranslate=function(t){var e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||0,y:+i[1]||0}},b.setTranslate=function(t,e,r){var n=/(\btranslate\(.*?\);?)/,i=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||0,r=r||0,o=o.replace(n,"").trim(),o+=" translate("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},b.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||1,y:+i[1]||1}},b.setScale=function(t,e,r){var n=/(\bscale\(.*?\);?)/,i=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||1,r=r||1,o=o.replace(n,"").trim(),o+=" scale("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},b.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n+=i,n=n.trim(),this.setAttribute("transform",n)}),i};var C=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=o.select(this),i=n.select("text"),a=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(n.attr("transform")||"").match(C);t=1===e&&1===r?[]:["translate("+a+","+s+")","scale("+e+","+r+")","translate("+-a+","+-s+")"],l&&t.push(l),n.attr("transform",t.join(" "))})}},{"../../constants/alignment":698,"../../constants/xmlns_namespaces":706,"../../lib":724,"../../lib/svg_text_utils":743,"../../registry":842,"../../traces/scatter/make_bubble_size_func":1040,"../../traces/scatter/subtypes":1045,"../color":602,"../colorscale":616,"./symbol_defs":627,d3:120,"fast-isnumeric":129,tinycolor2:532}],627:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:120}],628:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],629:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&-1!==["linear","log"].indexOf(r.type),u=[];if(l){for(var c=s(a),h=0;h0;t.each(function(t){var f,d=t[0].trace,p=d.error_x||{},m=d.error_y||{};d.ids&&(f=function(t){return t.id});var v=s.hasMarkers(d)&&d.marker.maxdisplayed>0;if(m.visible||p.visible){var g=i.select(this).selectAll("g.errorbar").data(t,f);g.exit().remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);h&&y.style("opacity",0).transition().duration(r.duration).style("opacity",1),o.setClipUrl(g,e.layerClipId),g.each(function(t){var e=i.select(this),o=n(t,u,c);if(!v||t.vis){var s;if(m.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var f=m.width;s="M"+(o.x-f)+","+o.yh+"h"+2*f+"m-"+f+",0V"+o.ys,o.noYS||(s+="m-"+f+",0h"+2*f);var d=e.select("path.yerror");l=!d.size(),l?d=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):h&&(d=d.transition().duration(r.duration).ease(r.easing)),d.attr("d",s)}if(p.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var g=(p.copy_ystyle?m:p).width;s="M"+o.xh+","+(o.y-g)+"v"+2*g+"m0,-"+g+"H"+o.xs,o.noXS||(s+="m0,-"+g+"v"+2*g);var y=e.select("path.xerror");l=!y.size(),l?y=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):h&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",s)}}})}})}},{"../../traces/scatter/subtypes":1045,"../drawing":626,d3:120,"fast-isnumeric":129}],634:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":602,d3:120}],635:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0},bordercolor:{valType:"color",arrayOk:!0},font:{family:n({},i.family,{arrayOk:!0}),size:n({},i.size,{arrayOk:!0}),color:n({},i.color,{arrayOk:!0})},namelength:{valType:"integer",min:-1,arrayOk:!0}}}},{"../../lib/extend":715,"../../plots/font_attributes":788}],636:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||i.identity,Array.isArray(t)&&(e[0][r]=n(t))}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=t._fullLayout,o=0;o=0&&r.indexQ.width||J<0||J>Q.height)return b.unhoverRaw(t,e)}if(P="xval"in e?w.flat(f,e.xval):w.p2c(S,Z),O="yval"in e?w.flat(f,e.yval):w.p2c(E,J),!h(P[0])||!h(O[0]))return d.warn("Fx.hover failed",e,t),b.unhoverRaw(t,e)}var $=1/0;for(F=0;FY&&(X.splice(0,Y),$=X[0].distance)}if(0===X.length)return b.unhoverRaw(t,e);X.sort(function(t,e){return t.distance-e.distance});var it=t._hoverdata,at=[];for(R=0;R1,ut=y.combine(m.plot_bgcolor||y.background,m.paper_bgcolor),ct={hovermode:D,rotateLabels:lt,bgColor:ut,container:m._hoverlayer,outerContainer:m._paperdiv,commonLabelOpts:m.hoverlabel},ht=i(X,ct,t);if(a(X,lt?"xa":"ya"),o(ht,lt),e.target&&e.target.tagName){ -var ft=_.getComponentMethod("annotations","hasClickToShow")(t,at);v(c.select(e.target),ft?"pointer":"")}e.target&&!n&&u(t,e,it)&&(it&&t.emit("plotly_unhover",{event:e,points:it}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,l=e.container,u=e.outerContainer,h=e.commonLabelOpts||{},f=e.fontFamily||M.HOVERFONT,d=e.fontSize||M.HOVERFONTSIZE,p=t[0],v=p.xa,b=p.ya,x="y"===a?"yLabel":"xLabel",_=p[x],w=(String(_)||"").split(" ")[0],A=u.node().getBoundingClientRect(),T=A.top,S=A.width,E=A.height,z=p.distance<=M.MAXDIST&&("x"===a||"y"===a);for(n=0;n-1&&n.length>p&&(n=p>3?n.substr(0,p-3)+"...":n.substr(0,p))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):z&&t[a+"Label"]===_?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var v=e.select("text.nums").call(g.font,t.fontFamily||f,t.fontSize||d,t.fontColor||h).text(i).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,r),b=e.select("text.name"),x=0;n&&n!==i?(b.call(g.font,t.fontFamily||f,t.fontSize||d,u).text(n).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,r),x=b.node().getBoundingClientRect().width+2*C):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:h});var w,M,A=v.node().getBoundingClientRect(),I=t.xa._offset+(t.x0+t.x1)/2,D=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),R=A.width+L+C+x;t.ty0=T-A.top,t.bx=A.width+2*C,t.by=A.height+2*C,t.anchor="start",t.txwidth=A.width,t.tx2width=x,t.offset=0,o?(t.pos=I,w=D+O/2+R<=E,M=D-O/2-R>=0,"top"!==t.idealAlign&&w||!M?w?(D+=O/2,t.anchor="start"):t.anchor="middle":(D-=O/2,t.anchor="end")):(t.pos=D,w=I+P/2+R<=S,M=I-P/2-R>=0,"left"!==t.idealAlign&&w||!M?w?(I+=P/2,t.anchor="start"):t.anchor="middle":(I-=P/2,t.anchor="end")),v.attr("text-anchor",t.anchor),x&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+I+","+D+")"+(o?"rotate("+k+")":""))}),P}function a(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(f.push.apply(f,d),h.splice(o+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(a=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=a;n=!1}else o++}h.forEach(r)}for(o=h.length-1;o>=0;o--){var v=h[o];for(s=v.length-1;s>=0;s--){var g=v[s],y=t[g.i];y.offset=g.dp,y.del=g.del}}}function o(t,e){t.each(function(t){var r=c.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(L+C),s=o+a*(t.txwidth+C),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-E,l=t.offset*S),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*L+l)+","+(L+u)+"v"+(t.by/2-L)+"h"+n*t.bx+"v-"+t.by+"H"+(n*L+l)+"V"+(u-L)+"Z"),i.call(m.positionText,o+l,u+t.ty0-t.by/2+C),t.tx2width&&(r.select("text.name").call(m.positionText,s+a*C+l,u+t.ty0-t.by/2+C),r.select("rect").call(g.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function s(t,e){function r(e,r,o){var s;if(a[r])s=a[r];else if(i[r]){var l=i[r];Array.isArray(l)&&Array.isArray(l[t.index[0]])&&(s=l[t.index[0]][t.index[1]])}else s=d.nestedProperty(n,o).get();s&&(t[e]=s)}var n=t.trace||{},i=t.cd[0],a=t.cd[t.index]||{};r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=d.constrain(t.x0,0,t.xa._length),t.x1=d.constrain(t.x1,0,t.xa._length),t.y0=d.constrain(t.y0,0,t.ya._length),t.y1=d.constrain(t.y1,0,t.ya._length);var o;if(void 0!==t.xLabelVal){o="log"===t.xa.type&&t.xLabelVal<=0;var s=x.tickText(t.xa,t.xa.c2l(o?-t.xLabelVal:t.xLabelVal),"hover");o?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+s.text:t.xLabel=s.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){o="log"===t.ya.type&&t.yLabelVal<=0;var l=x.tickText(t.ya,t.ya.c2l(o?-t.yLabelVal:t.yLabelVal),"hover");o?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+l.text:t.yLabel=l.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var u=x.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+u+" / -"+x.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+u,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var c=x.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+c+" / -"+x.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+c,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),-1===h.indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function l(t,e){var r=e.hovermode,n=e.container,i=t[0],a=i.xa,o=i.ya,s=a.showspikes,l=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(s||l)){var u=e.fullLayout,c=a._offset+(i.x0+i.x1)/2,h=o._offset+(i.y0+i.y1)/2,d=y.combine(u.plot_bgcolor,u.paper_bgcolor),p=f.readability(i.color,d)<1.5?y.contrast(d):i.color;if(l){var m=o.spikemode,v=o.spikethickness,b=o.spikecolor||p,x=o._boundingBox,_=(x.left+x.right)/2=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var c=t("d3"),h=t("fast-isnumeric"),f=t("tinycolor2"),d=t("../../lib"),p=t("../../lib/events"),m=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),g=t("../drawing"),y=t("../color"),b=t("../dragelement"),x=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),M=t("./constants"),k=M.YANGLE,A=Math.PI*k/180,T=1/Math.sin(A),S=Math.cos(A),E=Math.sin(A),L=M.HOVERARROWSIZE,C=M.HOVERTEXTPAD;r.hover=function(t,e,r,i){if("string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+M.HOVERMINTIME)return n(t,e,r,i),void(t._lastHoverTime=Date.now());t._hoverTimer=setTimeout(function(){n(t,e,r,i),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},M.HOVERMINTIME)},r.loneHover=function(t,e){var r={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=c.select(e.container),a=e.outerContainer?c.select(e.outerContainer):n,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:a},l=i([r],s,e.gd);return o(l,s.rotateLabels),l.node()}},{"../../lib":724,"../../lib/events":714,"../../lib/override_cursor":733,"../../lib/svg_text_utils":743,"../../plots/cartesian/axes":764,"../../registry":842,"../color":602,"../dragelement":623,"../drawing":626,"./constants":638,"./helpers":640,d3:120,"fast-isnumeric":129,tinycolor2:532}],642:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i=i||{},r("hoverlabel.bgcolor",i.bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":724}],643:[function(t,e,r){"use strict";function n(t){var e=s.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function i(t,e,r){return s.castOption(t,e,"hoverlabel."+r)}function a(t,e,r){function n(r){return s.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return s.castOption(t,r,"hoverinfo",n)}var o=t("d3"),s=t("../../lib"),l=t("../dragelement"),u=t("./helpers"),c=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:c},attributes:t("./attributes"),layoutAttributes:c,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:u.getDistanceFunction,getClosest:u.getClosest,inbox:u.inbox,appendArrayPointValue:u.appendArrayPointValue,castHoverOption:i,castHoverinfo:a,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":724,"../dragelement":623,"./attributes":635,"./calc":636,"./click":637,"./constants":638,"./defaults":639,"./helpers":640,"./hover":641,"./layout_attributes":644,"./layout_defaults":645,"./layout_global_defaults":646,d3:120}],644:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("../../plots/font_attributes"),a=t("./constants");e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:{family:n({},i.family,{dflt:a.HOVERFONT}),size:n({},i.size,{dflt:a.HOVERFONTSIZE}),color:n({},i.color)},namelength:{valType:"integer",min:-1,dflt:15}}}},{"../../lib/extend":715,"../../plots/font_attributes":788,"./constants":638}],645:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],653:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":715,"../../plots/font_attributes":788,"../color/attributes":601}],654:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],655:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,h,f,d=t.legend||{},p=e.legend={},m=0,v="normal",g=0;g1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(u=0,h="left",c=1.1,f="bottom"):(u=0,h="left",c=-.1,f="top")}l("traceorder",v),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",h),l("y",c),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":724,"../../plots/layout_attributes":818,"../../registry":842,"./attributes":653,"./helpers":658}],656:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,e,function(){o(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,s=p.traceIs(a,"pie"),l=a.index,u=s?n.label:a.name,c=t.selectAll("text.legendtext").data([0]);c.enter().append("text").classed("legendtext",!0),c.attr("text-anchor","start").classed("user-select-none",!0).call(v.font,i.legend.font).text(u),e._context.edits.legendText&&!s?c.call(y.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r),this.text()||(t=" ");var i,a=n.trace._fullInput||{};if(-1!==["ohlc","candlestick"].indexOf(a.type)){var o=n.trace.transforms;i=o[o.length-1].direction+".name"}else i="name";h.restyle(e,i,t,l)}):c.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeS&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){a(t,e,n)},S):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,a(t,e,n))}})}function a(t,e,r){if(!e._dragged&&!e._editing){var n,i,a=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],o=t.data()[0][0],s=e._fullData,l=o.trace,u=l.legendgroup,c=[];if(1===r&&T&&e.data&&e._context.showTips?(f.notifier("Double click on legend to isolate individual trace","long"),T=!1):T=!1,p.traceIs(l,"pie")){var d=o.label,m=a.indexOf(d);1===r?-1===m?a.push(d):a.splice(m,1):2===r&&(a=[],e.calcdata[0].forEach(function(t){d!==t.label&&a.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===a.length&&-1===m&&(a=[])),h.relayout(e,"hiddenlabels",a)}else{var v,g=[],y=[];for(v=0;vn.width-(n.margin.r+n.margin.l)&&(b=0,m+=g,i.height=i.height+g,g=0),v.setTranslate(this,a+b,5+a+e.height/2+m),i.width+=o+r,i.height=Math.max(i.height,e.height),b+=o+r,g=Math.max(e.height,g)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+s,r.height)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center");var i="top";A.isBottomAnchor(r)?i="bottom":A.isMiddleAnchor(r)&&(i="middle"),d.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function u(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center"),d.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var c=t("d3"),h=t("../../plotly"),f=t("../../lib"),d=t("../../plots/plots"),p=t("../../registry"),m=t("../dragelement"),v=t("../drawing"),g=t("../color"),y=t("../../lib/svg_text_utils"),b=t("./constants"),x=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),M=t("./style"),k=t("./helpers"),A=t("./anchor_utils"),T=!0,S=x.DBLCLICKDELAY;e.exports=function(t){function e(t,e){L.attr("data-scroll",e).call(v.setTranslate,0,e),C.call(v.setRect,N,t,b.scrollBarWidth,b.scrollBarHeight),T.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,o="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&w(t.calcdata,y),_=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+o).remove(),void d.autoMargin(t,"legend");var k=r._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=r._topdefs.selectAll("#"+o).data([0]);T.enter().append("clipPath").attr("id",o).append("rect");var E=k.selectAll("rect.bg").data([0]);E.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),E.call(g.stroke,y.bordercolor),E.call(g.fill,y.bgcolor),E.style("stroke-width",y.borderwidth+"px");var L=k.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var C=k.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var z=L.selectAll("g.groups").data(x);z.enter().append("g").attr("class","groups"),z.exit().remove();var I=z.selectAll("g.traces").data(f.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.call(M,t).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(i,t)});var D=0!==k.enter().size();D&&(s(t,z,I),l(t));var P=r.width,O=r.height;s(t,z,I),y.height>O?u(t):l(t);var R=r._size,F=R.l+R.w*y.x,j=R.t+R.h*(1-y.y);A.isRightAnchor(y)?F-=y.width:A.isCenterAnchor(y)&&(F-=y.width/2),A.isBottomAnchor(y)?j-=y.height:A.isMiddleAnchor(y)&&(j-=y.height/2);var N=y.width,B=R.w;N>B?(F=R.l,N=B):(F+N>P&&(F=P-N),F<0&&(F=0),N=Math.min(P-F,y.width));var U=y.height,V=R.h;U>V?(j=R.t,U=V):(j+U>O&&(j=O-U),j<0&&(j=0),U=Math.min(O-j,y.height)),v.setTranslate(k,F,j);var H,q,G=U-b.scrollBarHeight-2*b.scrollBarMargin,Y=y.height-U;if(y.height<=U||t._context.staticPlot)E.attr({width:N-y.borderwidth,height:U-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),v.setTranslate(L,0,0),T.select("rect").attr({width:N-2*y.borderwidth,height:U-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),L.call(v.setClipUrl,o);else{H=b.scrollBarMargin,q=L.attr("data-scroll")||0,E.attr({width:N-2*y.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),T.select("rect").attr({width:N-2*y.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-q}),L.call(v.setClipUrl,o),D&&e(H,q),k.on("wheel",null),k.on("wheel",function(){q=f.constrain(L.attr("data-scroll")-c.event.deltaY/G*Y,-Y,0),H=b.scrollBarMargin-q/Y*G,e(H,q),0!==q&&q!==-Y&&c.event.preventDefault()}),C.on(".drag",null),L.on(".drag",null);var X=c.behavior.drag().on("drag",function(){H=f.constrain(c.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+G),q=-(H-b.scrollBarMargin)/G*Y,e(H,q)});C.call(X),L.call(X)}if(t._context.edits.legendPosition){var W,Z,J,K;k.classed("cursor-move",!0),m.init({element:k.node(),gd:t,prepFn:function(){var t=v.getTranslate(k);J=t.x,K=t.y},moveFn:function(t,e){var r=J+t,n=K+e;v.setTranslate(k,r,n),W=m.align(r,0,R.l,R.l+R.w,y.xanchor),Z=m.align(n,0,R.t+R.h,R.t,y.yanchor)},doneFn:function(e,n,i){if(e&&void 0!==W&&void 0!==Z)h.relayout(t,{"legend.x":W,"legend.y":Z});else{var o=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});o.size()>0&&(1===n?k._clickTimeout=setTimeout(function(){a(o,t,n)},S):2===n&&(k._clickTimeout&&clearTimeout(k._clickTimeout),a(o,t,n)))}}})}}}},{"../../constants/alignment":698,"../../constants/interactions":703,"../../lib":724,"../../lib/svg_text_utils":743,"../../plotly":759,"../../plots/plots":827,"../../registry":842,"../color":602,"../dragelement":623,"../drawing":626,"./anchor_utils":652,"./constants":654,"./get_legend_data":657,"./helpers":658,"./style":660,d3:120}],657:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{ -var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],u=!1,c={},h=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,u,c=t[0],h=c.trace,f=l.hasMarkers(h),d=l.hasText(h),p=l.hasLines(h);if(f||d||p){var m={},v={};f&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(v.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(c,m)],u=a.minExtend(h,v)}var g=n.select(this).select("g.legendpoints"),y=g.selectAll("path.scatterpts").data(f?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,u,e),f&&(s[0].mrc=3);var b=g.selectAll("g.pointtext").data(d?s:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,u,e)}function h(t){var e=t[0].trace,r=e.marker||{},a=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(i.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),i=t[0],o=(i.mlw+1||a.width+1)-1;e.style("stroke-width",o+"px").call(s.fill,i.mc||r.color),o&&e.call(s.stroke,i.mlc||a.color)})}function f(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(s.fill,e.fillcolor),t&&r.call(s.stroke,e.line.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(i.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(u,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var i=r.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(h).each(f).each(d).each(r).each(c)}},{"../../lib":724,"../../registry":842,"../../traces/pie/style_one":1011,"../../traces/scatter/subtypes":1045,"../color":602,"../drawing":626,d3:120}],661:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},u=f.list(t,null,!0),h="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,v=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(g,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),h&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var y=i(s),b=[];return((u||p)&&!y||m)&&(b=["zoom2d","pan2d"]),v&&(b=["pan2d"]),a(l)&&(b.push("select2d"),b.push("lasso2d")),b.length&&n(b),!u&&!p||y||m||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d?n(["hoverClosestPie"]):v&&n(["resetViewMapbox","toggleHover"]),o(g,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var p=i(e,r,l);h("x",p[0]),h("y",p[1]),a.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),a.coerceFont(h,"font",r.font);var m=h("bgcolor");h("activecolor",o.contrast(m,u.lightAmount,u.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":724,"../color":602,"./attributes":665,"./button_attributes":666,"./constants":667}],669:[function(t,e,r){"use strict";function n(t){for(var e=g.list(t,"x",!0),r=[],n=0;np&&(p=f)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sY&&n>X&&!t.shiftKey?p.getCursor(i/r,1-a/n):"move";m(e,o),G=o.split("-")[0]}function a(e){N=h.getFromId(t,r.xref),B=h.getFromId(t,r.yref),U=g.getDataToPixel(t,N),V=g.getDataToPixel(t,B,!0),H=g.getPixelToData(t,N),q=g.getPixelToData(t,B,!0);var a="shapes["+n+"]";"path"===r.type?(F=r.path,j=a+".path"):(v=U(r.x0),y=V(r.y0),b=U(r.x1),x=V(r.y1),_=a+".x0",w=a+".y0",M=a+".x1",k=a+".y1"),vX&&(d[L]=r[D]=q(u),d[C]=r[P]=q(c)),f-h>Y&&(d[z]=r[O]=H(h),d[I]=r[R]=H(f))}e.attr("d",o(t,r))}var d,v,y,b,x,_,w,M,k,A,T,S,E,L,C,z,I,D,P,O,R,F,j,N,B,U,V,H,q,G,Y=10,X=10,W={element:e.node(),gd:t,prepFn:a,doneFn:s},Z=W.element.getBoundingClientRect();p.init(W),e.node().onmousemove=i}function o(t,e){var r,n,i,a,o=e.type,l=h.getFromId(t,e.xref),u=h.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=g.shapePositionToRange(l),n=function(t){return l._offset+l.r2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(i=g.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===o)return l&&"date"===l.type&&(n=g.decodeDate(n)),u&&"date"===u.type&&(a=g.decodeDate(a)),s(e.path,n,a);var f=n(e.x0),d=n(e.x1),p=a(e.y0),m=a(e.y1);if("line"===o)return"M"+f+","+p+"L"+d+","+m;if("rect"===o)return"M"+f+","+p+"H"+d+"V"+m+"H"+f+"Z";var v=(f+d)/2,y=(p+m)/2,b=Math.abs(v-f),x=Math.abs(y-p),_="A"+b+","+x,w=v+b+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-x)+_+" 0 0,1 "+w+"Z"}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i],l=t.substr(1).replace(v.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+t)),i+l})}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i];return i+t.substr(1).replace(v.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var u=t("../../plotly"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),p=t("../dragelement"),m=t("../../lib/setcursor"),v=t("./constants"),g=t("./helpers");e.exports={draw:n,drawOne:i}},{"../../lib":724,"../../lib/setcursor":739,"../../plotly":759,"../../plots/cartesian/axes":764,"../color":602,"../dragelement":623,"../drawing":626,"./constants":680,"./helpers":683}],683:[function(t,e,r){"use strict";r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.getDataToPixel=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},r.getPixelToData=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],684:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":678,"./calc_autorange":679,"./defaults":681,"./draw":682}],685:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,a,r,i)}if(s=s||{},l=l||{},!u("visible",!l.itemIsNotPlainObject))return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var c=t.path?"path":"rect",h=u("type",c),f=["x","y"],d=0;d<2;d++){var p=f[d],m={_fullLayout:r},v=i.coerceRef(t,e,m,p,"","paper");if("path"!==h){var g,y,b;"paper"!==v?(g=i.getFromId(m,v),b=o.rangeToShapePosition(g),y=o.shapePositionToRange(g)):y=b=n.identity;var x=p+"0",_=p+"1",w=t[x],M=t[_];t[x]=y(t[x],!0),t[_]=y(t[_],!0),i.coercePosition(e,m,u,v,x,.25),i.coercePosition(e,m,u,v,_,.75),e[x]=b(e[x]),e[_]=b(e[_]),t[x]=w,t[_]=M}}return"path"===h?u("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":724,"../../plots/cartesian/axes":764,"./attributes":678,"./helpers":683}],686:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../lib/extend").extendDeep,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:o({},i,{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:a({},n,{})},font:a({},n,{}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}},{"../../lib/extend":715,"../../plots/animation_attributes":760,"../../plots/font_attributes":788,"../../plots/pad_attributes":826,"./constants":687}],687:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],688:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),a.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(c,r).call(p,r).call(b,t,r).call(l,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-E.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=E.currentValueInset,i="left"}a.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var s=T.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*L;return T.positionText(a,n,l),a}}function l(t,e,r){var n=t.selectAll("rect."+E.gripRectClass).data([0]);n.enter().append("rect").classed(E.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:E.gripWidth,height:E.gripHeight,rx:E.gripRadius,ry:E.gripRadius}).call(k.stroke,r.bordercolor).call(k.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function u(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function c(t,e){var r=t.selectAll("g."+E.labelsClass).data([0]);r.enter().append("g").classed(E.labelsClass,!0);var n=r.selectAll("g."+E.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(E.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),A.setTranslate(r,g(e,t.fraction),E.tickOffset+e.ticklen+e.font.size*L+E.labelOffset+e.currentValueTotalHeight)})}function h(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&f(t,e,r,a,!0,i)}function f(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+E.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(k.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);h(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=y(t,w.mouse(i)[0]);h(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(k.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+E.tickRectClass).data(e.steps);r.enter().append("rect").classed(E.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),A.setTranslate(i,g(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?E.tickOffset:E.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*E.gripWidth)+","+e.currentValueTotalHeight+")")}}function g(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+E.railTouchRectClass).data([0]);n.enter().append("rect").classed(E.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,E.tickOffset+r.ticklen+r.labelHeight)}).call(k.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+E.railRectClass).data([0]);r.enter().append("rect").classed(E.railRectClass,!0);var n=e.inputAreaLength-2*E.railInset;r.attr({width:n,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n0?[0]:[]);if(s.enter().append("g").classed(E.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+E.groupClassName).data(r,i);l.enter().append("g").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var v,g=r.propContainer,y=r.propName,b=r.traceIndex,x=r.dfltName,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=g.titlefont.family,S=g.titlefont.size,E=g.titlefont.color,L=1,C=!1,z=g.title.trim();"title"===y?v="titleText":-1!==y.indexOf("axis")?v="axisTitleText":y.indexOf(!0)&&(v="colorbarTitleText");var I=t._context.edits[v];""===z&&(L=0),z.match(f)&&(L=.2,C=!0,I||(z=""));var D=z||I;k||(k=A._infolayer.selectAll(".g-"+e).data([0]),k.enter().append("g").classed("g-"+e,!0));var P=k.selectAll("text").data(D?[0]:[]);if(P.enter().append("text"),P.text(z).attr("class",e),P.exit().remove(),D){P.call(d);var O="Click to enter "+x+" title";I&&(z?P.on(".opacity",null):function(){L=0,C=!0,z=O,P.text(z).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),P.classed("js-placeholder",C)}}},{"../../constants/interactions":703,"../../lib":724,"../../lib/svg_text_utils":743,"../../plotly":759,"../../plots/plots":827,"../color":602,"../drawing":626,d3:120,"fast-isnumeric":129}],692:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports={_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},o,{}),font:a({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":715,"../../plots/font_attributes":788,"../../plots/pad_attributes":826,"../color/attributes":601}],693:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],694:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(a.enter().append("g").classed(L.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var c=a.selectAll("g."+L.headerGroupClassName).data(r,i);c.enter().append("g").classed(L.headerGroupClassName,!0);var h=a.selectAll("g."+L.dropdownButtonGroupClassName).data([0]);h.enter().append("g").classed(L.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var f=0;fM,T=n.barLength+2*n.barPad,S=n.barWidth+2*n.barPad,E=p,L=v+g;L+S>u&&(L=u-S);var C=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),A?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:L,width:T,height:S}),this._hbarXMin=E+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=g>k,I=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,P=p+m,O=v;P+I>l&&(P=l-I);var R=this.container.selectAll("rect.scrollbar-vertical").data(z?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),z?(this.vbar=R.attr({rx:n.barRadius,ry:n.barRadius,x:P,y:O,width:I,height:D}),this._vbarYMin=O+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,j=c-.5,N=z?h+I+.5:h+.5,B=f-.5,U=A?d+S+.5:d+.5,V=s._topdefs.selectAll("#"+F).data(A||z?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",F).append("rect"),A||z?(this._clipRect=V.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(N)-Math.floor(j),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:v,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||z){var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(q),z&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":724,"../color":602,"../drawing":626,d3:120}],698:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],699:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],700:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,i={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},a={},o=Object.keys(i),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],706:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],707:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.29.2",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":593,"./components/annotations3d":598,"./components/fx":643,"./components/images":651,"./components/legend":659,"./components/rangeselector":671,"./components/rangeslider":677,"./components/shapes":684,"./components/sliders":690,"./components/updatemenus":696,"./fonts/mathjax_config":708,"./lib/queue":736,"./plot_api/plot_schema":753,"./plot_api/register":754,"./plot_api/set_plot_config":755,"./plot_api/to_image":757,"./plot_api/validate":758,"./plotly":759,"./snapshot":847,"./snapshot/download":844,"./traces/scatter":1035,d3:120,"es6-promise":126}],708:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],709:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],710:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":704,"fast-isnumeric":129}],711:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;if("string"==typeof t&&t.substr(0,n)===r&&l.test(t.substr(n)))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!l.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function h(t){return t.formatDate("M d, yyyy")}var f=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),v=t("../constants/numerical"),g=v.BADNUM,y=v.ONEDAY,b=v.ONEHOUR,x=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),k=f.time.format.utc,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,S=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var E,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=E&&t<=L?t:g;if("string"!=typeof t&&"number"!=typeof t)return g;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?T:A);if(!s)return g;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return g;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,v),c)}else p=m.newDate(l,Number(u),c)}catch(t){return g}return p?(p.toJD()-w)*y+h*b+f*x+d*_:g}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var k=new Date(Date.UTC(2e3,u,c,h,f));return k.setUTCFullYear(l),k.getUTCMonth()!==u?g:k.getUTCDate()!==c?g:k.getTime()+d*_},E=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==g};var C=90*y,z=3*b,I=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=E&&t<=L))return g;e||(e=0);var i,o,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(n(r)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=k("G%Y-%m-%d")(new Date(f))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=E+y&&t<=L-y))return g;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10));return a(f.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var D=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=k("%Y"),R=k("%b %Y"),F=k("%b %-d"),j=k("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,f;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?f=l(p):"m"===r?f=u(p):"d"===r?(a=l(p),f=c(p)):(a=h(p),f=s(t,r))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===r?f=O(m):"m"===r?f=R(m):"d"===r?(a=O(m),f=F(m)):(a=j(m),f=s(t,r))}return f+(a?"\n"+a:"")};var N=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},r.makeLine=function(t,e){var r={};return r=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t},e&&(r.trace=e),r},r.makePolygon=function(t,e){var r={};if(1===t.length)r={type:"Polygon",coordinates:t};else{for(var n=new Array(t.length),i=0;i1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function i(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,u){if(n(t,e,r,a,o,s,l,u))return 0;var c=r-t,h=a-e,f=l-o,d=u-s,p=c*c+h*h,m=f*f+d*d,v=Math.min(i(c,h,p,o-t,s-e),i(c,h,p,l-t,u-e),i(f,d,m,t-o,e-s),i(f,d,m,r-o,a-s));return Math.sqrt(v)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),u=t.getPointAtLength(a(r+n/2,e)),c=Math.atan((u.y-i.y)/(u.x-i.x)),h=t.getPointAtLength(a(r,e)),f=(4*h.x+i.x+u.x)/6,d=(4*h.y+i.y+u.y)/6,p={x:f,y:d,theta:c};return o[r]=p,p},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===h&&(a=r);var n=r.xs?r.x-s:0,c=r.yu?r.y-u:0;return Math.sqrt(n*n+c*c)}for(var i,a,o=e.left,s=e.right,l=e.top,u=e.bottom,c=0,h=t.getTotalLength(),f=h,d=n(c);d;){if((c+=d+r)>f)return;d=n(c)}for(d=n(f);d;){if(f-=d+r,c>f)return;d=n(f)}return{min:c,max:f,len:f-c,total:h,isClosed:0===c&&f===h&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}}},{"./mod":729}],721:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(s(t))return h;var e=l(t);return e.length?e:h}function a(t){return s(t)?t:f}function o(t,e,r){var o,s,c,d,p,m=t.color,v=Array.isArray(m),g=Array.isArray(e),y=[] -;if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=v?function(t,e){return void 0===t[e]?h:l(o(t[e]))}:i,c=g?function(t,e){return void 0===t[e]?f:a(t[e])}:a,v||g)for(var b=0;b",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(no?s:i(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):l},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l}},{"../constants/numerical":704,"./clean_number":710,"./coerce":711,"./dates":712,"./ensure_array":713,"./extend":715,"./filter_unique":716,"./filter_visible":717,"./geometry2d":720,"./identity":723,"./is_array":725,"./is_plain_object":726,"./loggers":727,"./matrix":728,"./mod":729,"./nested_property":730,"./noop":731,"./notifier":732,"./push_unique":735,"./relink_private":737,"./search":738,"./stats":741,"./to_log_range":744,d3:120,"fast-isnumeric":129}],725:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],726:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],727:[function(t,e,r){"use strict";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function h(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),m=t("../plot_api/container_array_match");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,l=e.split(".");s/g),s=0;so||n===i||nl)&&(!e||!c(t))}function r(t,e){var r=t[0],u=t[1];if(r===i||ro||u===i||ul)return!1;var c,h,f,d,p,m=n.length,v=n[0][0],g=n[0][1],y=0;for(c=1;cMath.max(h,v)||u>Math.max(f,g)))if(uc||Math.abs(n(o,f))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var u=l+1;u1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":704,"./matrix":728}],735:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ra.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;h90&&l.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":129}],742:[function(t,e,r){"use strict";function n(t){var e=i(t);return e.length?e:[0,0,0,1]}var i=t("color-rgba");e.exports=n},{"color-rgba":93}],743:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(g,"\\lt ").replace(y,"\\gt ")}function a(t,e,r){var n="math-output-"+f.randstr([],64),a=h.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=h.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())f.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function s(t,e){if(!t)return"";for(var r=0;r1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),a=u[u.length-1].node}(k);else{var O=y[4],R={type:k},F=o(O,C);if(F?(F=F.replace(P,"$1 fill:"),A&&(F+=";"+A)):A&&(F=A),F&&(R.style=F),"a"===k){s=!0;var j=o(O,z);if(j){var N=document.createElement("a");N.href=j,-1!==M.indexOf(N.protocol)&&(R.href=encodeURI(j),R.target=o(O,I)||"_blank",R.popup=o(O,D))}}n(R)}}return s}function c(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var h=t("d3"),f=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),m=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,i){function o(){c.empty()||(f=t.attr("class")+"-math",c.select("svg."+f).remove()),t.text("").style("white-space","pre"),u(t.node(),s)&&t.style("pointer-events","all"),r.positionText(t),i&&i.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(v),c=h.select(t.node().parentNode);if(!c.empty()){var f=t.attr("class")?t.attr("class").split(" ")[0]:"text";return f+="-math",c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r={fontSize:parseInt(t.style("font-size"),10)};a(l[2],r,function(r,a,l){c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove();var u=r&&r.select("svg");if(!u||!u.node())return o(),void e();var h=c.append("g").classed(f+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});h.node().appendChild(u.node()),a&&a.node()&&u.node().insertBefore(a.node().cloneNode(!0),u.node().firstChild),u.attr({class:f,height:l.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var d=t.style("fill")||"black";u.select("g").attr({fill:d,stroke:d});var p=n(u,"width"),m=n(u,"height"),v=+t.attr("x")-p*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],g=parseInt(t.style("font-size"),10)||n(t,"height"),y=-g/4;"y"===f[0]?(h.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-p/2,y-m/2]+")"}),u.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===f[0]?u.attr({x:t.attr("x"),y:y-m/2}):"a"===f[0]?u.attr({x:0,y:y}):u.attr({x:v,y:+t.attr("y")+y-m/2}),i&&i.call(t,h),e(h)})})):o(),t}};var g=/(<|<|<)/g,y=/(>|>|>)/g,b={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},x={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",M=["http:","https:","mailto:","",void 0,":"],k=new RegExp("]*)?/?>","g"),A=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,S=/(<[^<>]*>)/,E=/<(\/?)([^ >]*)(\s+(.*))?>/i,L=//i,C=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,z=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,I=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,D=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,P=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(k," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=h.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){i(),t.style({opacity:0});var e,r=l.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&h.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function i(){var r=h.select(a),i=r.select(".svg-container"),o=i.append("div");o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":t.style("font-family")||"Arial","font-size":t.style("font-size")||12,color:e.fill||t.style("fill")||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(t.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(c(t,i,e)).on("blur",function(){a._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=h.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&h.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on("mouseup",null),s.edit.call(t,n)}).on("focus",function(){var t=this;a._editing=!0,h.select(document).on("mouseup",function(){if(h.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===h.event.which?(a._editing=!1,t.style({opacity:1}),h.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(t,this.textContent)):(s.input.call(t,this.textContent),h.select(this).call(c(t,i,e)))}).on("keydown",function(){13===h.event.which&&this.blur()}).call(n)}var a=e.gd,o=e.delegate,s=h.dispatch("edit","input","cancel"),l=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():l.on("click",r),h.rebind(t,s,"on")}},{"../constants/alignment":698,"../constants/string_mappings":705,"../constants/xmlns_namespaces":706,"../lib":724,d3:120}],744:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":129}],745:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":790,"topojson-client":534}],746:[function(t,e,r){"use strict";function n(t,e){for(var r=new Float32Array(e),n=0;n0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),u=t("../registry"),c=t("../lib"),h=t("../plots/plots"),f=t("../plots/cartesian/axes"),d=t("../components/color");r.getGraphDiv=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&c.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=f.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var g=h.getSubplotIds(t,"gl3d");for(e=0;e1&&o.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!m&&(f(v,g),d(t),!0)}var b,x,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(g,h).get(),C=[],z=-1,I=E.length;for(b=0;bE.length-(A?0:1))o.warn("index out of range",h,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",h,_,k),-1===z&&(z=_);else for(x=0;x=0;b--)E.splice(C[b],1),L&&L.splice(C[b],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(f(v,g),p!==a){var D;if(-1===z)D=T;else{for(I=Math.max(E.length,I),D=[],b=0;b=z);b++)D.push(_);for(b=z;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function l(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&s(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&lH.range[0]?[1,2]:[2,1]);else{var Y=H.range[0],X=H.range[1];q?(Y<=0&&X<=0&&r(F+".autorange",!0),Y<=0?Y=X/1e6:X<=0&&(X=Y/1e6),r(F+".range[0]",Math.log(Y)/Math.LN10),r(F+".range[1]",Math.log(X)/Math.LN10)):(r(F+".range[0]",Math.pow(10,Y)),r(F+".range[1]",Math.pow(10,X)))}else r(F+".autorange",!0);M.getComponentMethod("annotations","convertCoords")(t,B,S,r),M.getComponentMethod("images","convertCoords")(t,B,S,r)}else r(F+".autorange",!0);x.nestedProperty(u,F+"._inputRange").set(null)}else if(D.match(O.AX_NAME_PATTERN)){var W=x.nestedProperty(u,A).get(),Z=(S||{}).type;Z&&"-"!==Z||(Z="linear"),M.getComponentMethod("annotations","convertCoords")(t,W,Z,r),M.getComponentMethod("images","convertCoords")(t,W,Z,r)}var J=z.containerArrayMatch(A);if(J){a=J.array,o=J.index;var K=J.property,Q=x.nestedProperty(l,a),$=(Q||[])[o]||{};if(""===o)-1===A.indexOf("updatemenus")&&(g.docalc=!0);else if(""===K){var tt=S;z.isAddVal(S)?_[A]=null:z.isRemoveVal(S)?(_[A]=$,tt=$):x.warn("unrecognized full object value",e),(n(tt,"x")||n(tt,"y")&&-1===A.indexOf("updatemenus"))&&(g.docalc=!0)}else!n($,"x")&&!n($,"y")||x.containsAny(A,["color","opacity","align","dash","updatemenus"])||(g.docalc=!0);f[a]||(f[a]={});var et=f[a][o];et||(et=f[a][o]={}),et[K]=S,delete e[A]}else if("reverse"===D)j.range?j.range.reverse():(r(F+".autorange",!0),j.range=[1,0]),B.autorange?g.docalc=!0:g.doplot=!0;else{var rt=String(T.parts[1]||"");0===C.indexOf("scene")?"camera"===T.parts[1]?g.docamera=!0:g.doplot=!0:0===C.indexOf("geo")?g.doplot=!0:0===C.indexOf("ternary")?g.doplot=!0:"paper_bgcolor"===A?g.doplot=!0:"margin"===C||"autorange"===rt||"rangemode"===rt||"type"===rt||"domain"===rt||"fixedrange"===rt||"scaleanchor"===rt||"scaleratio"===rt||-1!==A.indexOf("calendar")||A.match(/^(bar|box|font)/)?g.docalc=!0:!u._has("gl2d")||-1===A.indexOf("axis")&&"plot_bgcolor"!==A?!u._has("gl2d")||"dragmode"!==A||"lasso"!==S&&"select"!==S||"lasso"===U||"select"===U?"hiddenlabels"===A?g.docalc=!0:-1!==C.indexOf("legend")?g.dolegend=!0:-1!==A.indexOf("title")?g.doticks=!0:-1!==C.indexOf("bgcolor")?g.dolayoutstyle=!0:E>1&&x.containsAny(rt,["tick","exponent","grid","zeroline"])?g.doticks=!0:-1!==A.indexOf(".linewidth")&&-1!==A.indexOf("axis")?g.doticks=g.dolayoutstyle=!0:E>1&&-1!==rt.indexOf("line")?g.dolayoutstyle=!0:E>1&&"mirror"===rt?g.doticks=g.dolayoutstyle=!0:"margin.pad"===A?g.doticks=g.dolayoutstyle=!0:-1!==["hovermode","dragmode"].indexOf(A)||-1!==A.indexOf("spike")?g.domodebar=!0:-1===["height","width","autosize"].indexOf(A)&&(g.doplot=!0):g.docalc=!0:g.doplot=!0,T.set(S)}}}for(a in f){z.applyContainerArrayChanges(t,x.nestedProperty(l,a),f[a],g)||(g.doplot=!0)}var nt=u._axisConstraintGroups;for(v in w)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=I.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=k.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function h(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,k.transition(t,e.frame.data,e.frame.layout,I.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else c()}function f(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&h()};e()}function d(t){return Array.isArray(s)?v>=s.length?t.transitionOpts=s[v]:t.transitionOpts=s[0]:t.transitionOpts=s,v++,t}var p,m,v=0,g=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!x.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&A.push(m);g=A}}g.length>0?function(e){if(0!==e.length){for(var s=0;s=0;i--)if(x.isPlainObject(e[i])){var f=(u[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&u[f]&&(n++,x.warn('addFrames: overwriting frame "'+u[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&x.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:k.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:c+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if(a=h[i].frame,"number"==typeof a.name&&x.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=k.modifyFrames,l=k.modifyFrames,u=[t,o],c=[t,a];return w&&w.add(t,s,u,l,c),k.modifyFrames(t,a)},b.purge=function(t){t=I.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return k.cleanPlot([],{},r,e),k.purge(t),_.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":626,"../components/errorbars":632,"../constants/xmlns_namespaces":706,"../lib":724,"../lib/events":714,"../lib/queue":736,"../lib/svg_text_utils":743,"../plotly":759,"../plots/cartesian/axis_ids":767,"../plots/cartesian/constants":769,"../plots/cartesian/constraints":771,"../plots/cartesian/graph_interact":773,"../plots/plots":827,"../plots/polar":830,"../registry":842,"./edit_types":748,"./helpers":749,"./manage_arrays":750,"./subroutines":756,d3:120,"fast-isnumeric":129,"has-hover":286}],752:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],753:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:b},r={}):(e=d.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,M(n,m),M(n,e.attributes),r.attributes&&M(n,r.attributes),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){f(n,r.schema.traces[t][e],e)})}),n.type=t;var i={meta:e.meta||{},attributes:s(n)};if(e.layoutAttributes){var a={};M(a,e.layoutAttributes),i.layoutAttributes=s(a)}return i}function i(){var t={};return M(t,v),Object.keys(d.subplotsRegistry).forEach(function(e){var r=d.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)h(t,r,"xaxis"),h(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;h(t,r,n)}}),t=c(t),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){f(t,r.schema.layout[e],e)}):f(t,r.layoutAttributes,r.name))}),{layoutAttributes:s(t)}}function a(t){var e=d.transformsRegistry[t],r=M({},e.attributes);return Object.keys(d.componentsRegistry).forEach(function(e){var n=d.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){f(r,n.schema.transforms[t][e],e)})}),{attributes:s(r)}}function o(){var t={frames:p.extendDeep({},g)};return s(t),t.frames}function s(t){return l(t),u(t),t}function l(t){function e(t){return{valType:"string"}}function n(t,n,i){r.isValObject(t)?"data_array"===t.valType?(t.role="data",i[n+"src"]=e(n)):!0===t.arrayOk&&(i[n+"src"]=e(n)):p.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function u(t){function e(t,e,r){if(t){var n=t[A];n&&(delete t[A],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function c(t){return w(t,{radialaxis:x.radialaxis,angularaxis:x.angularaxis}),w(t,x.layout),t}function h(t,e,r){var n=p.nestedProperty(t,r),i=M({},e.layoutAttributes);i[k]=!0,n.set(i)}function f(t,e,r){var n=p.nestedProperty(t,r);n.set(M(n.get()||{},e))}var d=t("../registry"),p=t("../lib"),m=t("../plots/attributes"),v=t("../plots/layout_attributes"),g=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),b=t("../plots/polar/area_attributes"),x=t("../plots/polar/axis_attributes"),_=t("./edit_types"),w=p.extendFlat,M=p.extendDeep,k="_isSubplotObj",A="_isLinkedToArray",T=[k,A,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=k,r.IS_LINKED_TO_ARRAY=A,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=T,r.get=function(){var t={};d.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(d.transformsRegistry).forEach(function(t){e[t]=a(t)}),{defs:{valObjects:p.valObjects,metaKeys:T.concat(["description","role"]),editTypes:{traces:_.traces(),layout:_.layout()}},traces:t,layout:i(),transforms:e,frames:o(),animation:s(y)}},r.crawl=function(t,e,n){var i=n||0;Object.keys(t).forEach(function(n){var a=t[n];-1===T.indexOf(n)&&(e(a,n,t,i),r.isValObject(a)||p.isPlainObject(a)&&r.crawl(a,e,i+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){if(a=a.slice(0,s).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===a[s-1]&&("ticktext"===r||"tickvals"===r))){var l=n(a),u=p.nestedProperty(t,l).get();Array.isArray(u)&&i.push(l)}}function n(t){return t.join(".")}var i=[],a=[];if(r.crawl(m,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function i(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function a(t,e,r){var n=[],i=e._anchorAxis;if(i){var a=i._mainAxis;if(-1===n.indexOf(a)){n.push(a);for(var o=0;o1)};f(e.width)&&f(e.height)||n(new Error("Height and width should be pixel values."));var d=l(t,{format:"png",height:e.height,width:e.width}),p=d.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var m=s.getRedrawFunc(p);a.plot(p,d.data,d.layout,d.config).then(m).then(h).then(function(t){r(t)}).catch(function(t){n(t)})})}var i=t("fast-isnumeric"),a=t("../plotly"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/cloneplot"),u=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg");e.exports=n},{"../lib":724,"../plotly":759,"../snapshot/cloneplot":843,"../snapshot/helpers":846,"../snapshot/svgtoimg":848,"../snapshot/tosvg":850,"fast-isnumeric":129}],758:[function(t,e,r){"use strict";function n(t,e,r,i,a,u){u=u||[];for(var c=Object.keys(t),f=0;f1&&l.push(o("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,v=r.length,g=0;g.3*h||a(n)||a(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=O.tickIncrement(t,"M6","reverse")+1.5*C:a.exactMonths>.8?t=O.tickIncrement(t,"M1","reverse")+15.5*C:t-=C/2;var s=O.tickIncrement(t,r);if(s<=n)return s}return t}function a(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=_.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],u=1.0001*o[1]-1e-4*o[0],c=Math.min(s,u),h=Math.max(s,u),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;rc&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=C&&i<=10||e>=15*C)t._tickround="d";else if(e>=I&&i<=16||e>=z)t._tickround="M";else if(e>=D&&i<=19||e>=I)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(b(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);b(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function l(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function u(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||t.tickformat;n&&(i=b(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=_.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");-1!==l&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="
"+o,t._prevDateHead=o)),e.text=s}function c(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=d(Math.pow(10,o),t,i,n);else if(b(a)||"D"===a.charAt(0)&&_.mod(o+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(o);e.text=0===s?1:1===s?"10":s>1?"10"+s+"":"10\u2212"+-s+"",e.fontSize*=1.25}else e.text=d(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,_.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}function h(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=d(e.x,t,i,n)}function d(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat,c=e.separatethousands;if(n){var h={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:b(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};s(h),a=(Number(h._tickround)||0)+4,l=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-a)/2;if("none"===o&&(l=0),(t=Math.abs(t))12||l<-15)?t+="e"+m:"E"===o?t+="E"+m:"power"===o?t+="\xd710"+m+"":"B"===o&&9===l?t+="B":"SI"!==o&&"B"!==o||(t+=q[l/3+5])}return i?"\u2212"+t:t}function p(t,e){var r,n,i=[];for(r=0;r1)for(n=1;n2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},O.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&h/c>f&&(l=o,u=s,f=h/c);if(n===i){var m=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,v)]:[m,v]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),_.simpleMap(r,t.l2r||Number)},O.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=O.getAutoRange(t),t._r=t.range.slice(),t._rl=_.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},O.saveRangeInitial=function(t,e){for(var r=O.list(t,"",!0),n=!1,i=0;i=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(d=!0,o=0;o=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||!!_.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,h,f,d,p,m,v=e.length,g=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type);g&&"domain"===t.constrain&&t._inputDomain&&(g*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),M=n(r.vpadplus||r.vpad),k=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=v-1;a>5;a--)i(a)}},O.autoBin=function(t,e,r,a,o){var s=_.aggNums(Math.min,null,t),l=_.aggNums(Math.max,null,t);if(o||(o=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1};var u;if(r)u=(l-s)/r;else{var c=_.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*_.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);u=Math.max(f,2*_.stdev(t)/Math.pow(t.length,a?.25:.4)),b(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:_.simpleMap([s,l],e.c2r,0,o),calendar:o},O.setConvert(d),O.autoTicks(d,u);var p,m=O.tickIncrement(O.tickFirst(d),d.dtick,"reverse",o);if("number"==typeof d.dtick){m=n(m,t,d,s,l);p=m+(1+Math.floor((l-m)/d.dtick))*d.dtick}else for("M"===d.dtick.charAt(0)&&(m=i(m,t,d.dtick,s,o)),p=m;p<=l;)p=O.tickIncrement(p,d.dtick,!1,o);return{start:e.c2r(m,0,o),end:e.c2r(p,0,o),size:d.dtick}},O.calcTicks=function(t){var e=_.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=_.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),O.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),s(t),"array"===t.tickmode)return a(t);t._tmin=O.tickFirst(t);var i=e[1]=l:h<=l)&&!(o.length>c||h===u);h=O.tickIncrement(h,t.dtick,i,t.calendar))u=h,o.push(h);t._tmax=o[o.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(o.length),d=0;dE?(e/=E,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*o(e,r,j)):n>L?(e/=L,t.dtick="M"+o(e,1,N)):n>C?(t.dtick=o(e,C,U),t.tick0=_.dateTick0(t.calendar,!0)):n>z?t.dtick=o(e,z,N):n>I?t.dtick=o(e,I,B):n>D?t.dtick=o(e,D,B):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,j))}else if("log"===t.type){t.tick0=0;var i=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+o(e,r,j)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,j));if(0===t.dtick&&(t.dtick=1),!b(t.dtick)&&"string"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(s)}},O.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(b(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return _.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?H:V,l=t+.01*i,u=_.roundUp(_.mod(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},O.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]1&&e2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":704,"../../lib":724,"fast-isnumeric":129}],766:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../registry"),a=t("../../lib"),o=t("../../components/color/attributes").lightFraction,s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),h=t("./category_order_defaults"),f=t("./set_convert"),d=t("./ordered_categories");e.exports=function(t,e,r,p,m){function v(r,n){return a.coerce2(t,e,s,r,n)}var g=p.letter,y=p.font||{},b="Click to enter "+(p.title||g.toUpperCase()+" axis")+" title",x=r("visible",!p.cheateronly),_=e.type;if("date"===_){i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(f(e,m),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),h(t,e,r),e._initialCategories="category"===_?d(g,e.categoryorder,e.categoryarray,p.data):[],!x)return e;var w=r("color"),M=w===t.color?w:y.color;r("title",b),a.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:M}),l(t,e,r,_),c(t,e,r,_,p),u(t,e,r,p);var k=v("linecolor",w),A=v("linewidth"),T=r("showline",!!k||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var S=v("gridcolor",n(w,p.bgColor,o).toRgbString()),E=v("gridwidth");r("showgrid",p.showGrid||!!S||!!E)||(delete e.gridcolor,delete e.gridwidth);var L=v("zerolinecolor",w),C=v("zerolinewidth");return r("zeroline",p.showGrid||!!L||!!C)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":601,"../../lib":724,"../../registry":842,"./category_order_defaults":768,"./layout_attributes":775,"./ordered_categories":777,"./set_convert":781,"./tick_label_defaults":782,"./tick_mark_defaults":783,"./tick_value_defaults":784,tinycolor2:532}],767:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],769:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{}],770:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a,s,l,u=n[o(e)].type,c=[];for(a=0;ao*g)||_)for(r=0;rz&&DL&&(L=D);var R=(L-E)/(2*C);h/=R,E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=A=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function c(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function h(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function f(t){t.selectAll(".select-outline").remove()}function d(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),i||(t.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){x.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function m(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function g(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function b(t,e,r){var n,i,a,o,s,l,u=!1,c={},h={};for(n=0;nj||s>j?(kt="xy",o/at>s/ot?(s=o*ot/at,bt>a?xt.t=bt-s:xt.b=bt+s):(o=s*at/ot,yt>i?xt.l=yt-o:xt.r=yt+o),Tt.attr("d",y(xt))):n():!lt||szoom back out","long"),N=!1)}function X(e,r){var n=1===(U+V).length;if(e)Q();else if(2!==r||n){if(1===r&&n){var i=U?rt[0]:et[0],o="s"===U||"w"===V?0:1,s=i._name+".range["+o+"]",l=a(i,o),u="left",c="middle";if(i.fixedrange)return;U?(c="n"===U?"top":"bottom","right"===i.side&&(u="right")):"e"===V&&(u="right"),t._context.showAxisRangeEntryBoxes&&x.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:dt.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:u,verticalAlign:c}).on("edit",function(e){var r=i.d2r(e);void 0!==r&&w.relayout(t,s,r)})}}else K()}function W(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=k.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||dt._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var n=t.querySelector(".plotly");if(H(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Lt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void k.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=zt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(V||ct){for(V||(l=.5),a=0;a rect").call(S.setTranslate,s,l).call(S.setScale,a,o);var w=m.plot.selectAll(".scatterlayer .points, .boxlayer .points");m.plot.call(S.setTranslate,x,_).call(S.setScale,1/a,1/o),w.selectAll(".point").call(S.setPointGroupScale,a,o).call(S.hideOutsideRangePoints,m),w.selectAll(".textpoint").call(S.setTextPointsScale,a,o).call(S.hideOutsideRangePoints,m)}}}var tt,et,rt,nt,it,at,ot,st,lt,ut,ct,ht,ft,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,mt=U+V==="nsew";H();var vt=n(e,U+V+"drag",ut,r,T,E,B);if(!lt&&!st&&!m(dt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=mt?"all":"none",vt;var gt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;mt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",gt.minDrag="lasso"===i?1:void 0,"zoom"===i?(gt.moveFn=G,gt.doneFn=Y,gt.minDrag=1,q(e,r,n)):"pan"===i?(gt.moveFn=Z,gt.doneFn=X,f(pt)):m(i)&&(gt.xaxes=et,gt.yaxes=rt,P(e,r,n,gt,i))}};L.init(gt);var yt,bt,xt,_t,wt,Mt,kt,At,Tt,St={},Et=[0,0,at,ot],Lt=null,Ct=R.REDRAWDELAY,zt=e.mainplot?dt._plots[e.mainplot]:e;return U.length*V.length!=1&&(void 0!==vt.onwheel?vt.onwheel=W:void 0!==vt.onmousewheel&&(vt.onmousewheel=W)),vt}},{"../../components/color":602,"../../components/dragelement":623,"../../components/drawing":626,"../../constants/alignment":698,"../../lib":724,"../../lib/setcursor":739,"../../lib/svg_text_utils":743,"../../plotly":759,"../../registry":842,"../plots":827,"./axes":764,"./axis_ids":767,"./constants":769,"./scale_zoom":779,"./select":780,d3:120,tinycolor2:532}],773:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var l=e._plots[r],u=l.xaxis,c=l.yaxis,h=(u._linepositions[r]||[])[3],f=(c._linepositions[r]||[])[3],d=o.DRAGGERSIZE;if(n(h)&&"top"===u.side&&(h-=d),n(f)&&"right"!==c.side&&(f-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e,r)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(n(h)&&("free"===u.anchor&&(h-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,h,.8*u._length,d,"","ew"),s(t,l,0,h,.1*u._length,d,"","w"),s(t,l,.9*u._length,h,.1*u._length,d,"","e")),n(f)&&("free"===c.anchor&&(f-=e._size.w*u.domain[0]),s(t,l,f,.1*c._length,d,.8*c._length,"ns",""),s(t,l,f,.9*c._length,d,.1*c._length,"s",""),s(t,l,f,0,d,.1*c._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,i.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,i.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":623,"../../components/fx":643,"./constants":769,"./dragbox":772,"fast-isnumeric":129}],774:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;sc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":724,"fast-isnumeric":129}],779:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":698}],780:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function h(e,r,n){var i=u(e,n||t.calendar);if(i===d){if(!a(e))return d;i=u(new Date(+e))}return i}function v(e,r,n){return l(e,r,n||t.calendar)}function g(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:c,t.l2c="log"===t.type?n:c,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(h(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=g,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return g(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),u=t.r2l(t[a][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":704,"../../lib":724,"./axis_ids":767,"./constants":769,d3:120,"fast-isnumeric":129}],782:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==a&&(r("tickformat")||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":724}],783:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":724,"./layout_attributes":775}],784:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);f=n(f)?Number(f):0,(f<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=r("tickvals");void 0===m?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":704,"../../lib":724,"fast-isnumeric":129}],785:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,u){function c(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function f(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],f=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*f/h)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,g=e.yaxis,b=!!s,x=!!l,_=b?m._length/u[2]:1,w=x?g._length/u[3]:1,M=b?u[0]:0,k=x?u[1]:0,A=b?u[0]/u[2]*m._length:0,T=x?u[1]/u[3]*g._length:0,S=m._offset-A,E=g._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,M,k).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;rr.duration?(d(),k=window.cancelAnimationFrame(m)):k=window.requestAnimationFrame(m)}var v=t._fullLayout,g=[],y=function(t){var e,r,n,i,a,o={};for(e in t)if(r=e.split("."),n=r[0].match(l)){var s=n[1],u=s+"axis";if(i=v[u],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=u,a.length=i._length,g.push(s),o[s]=a}return o}(e),b=Object.keys(y),x=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(v,b,y);if(!x.length)return function(){function e(e,r,n){for(var i=0;i0?".":"")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;he*Math.PI/180},w.render=function(){function t(t){var e=r.projection(t.lonlat);return e?"translate("+e[0]+","+e[1]+")":null}function e(t){return r.isLonLatOverEdges(t.lonlat)?"0":"1.0"}var r=this,n=r.framework,i=n.select("g.choroplethlayer"),a=n.select("g.scattergeolayer"),o=r.path;n.selectAll("path.basepath").attr("d",o),n.selectAll("path.graticulepath").attr("d",o),i.selectAll("path.choroplethlocation").attr("d",o),i.selectAll("path.basepath").attr("d",o),a.selectAll("path.js-line").attr("d",o),null!==r.clipAngle?(a.selectAll("path.point").style("opacity",e).attr("transform",t),a.selectAll("text").style("opacity",e).attr("transform",t)):(a.selectAll("path.point").attr("transform",t),a.selectAll("text").attr("transform",t))}},{"../../components/color":602,"../../components/drawing":626,"../../components/fx":643,"../../lib/topojson_utils":745,"../cartesian/axes":764,"../plots":827,"./constants":790,"./projections":798,"./set_scale":799,"./zoom":800,"./zoom_reset":801,d3:120,"topojson-client":534}],792:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;on^d>n&&r<(f-u)*(n-c)/(d-c)+u&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?z:t<-1?-z:Math.asin(t)}function l(t){return t>1?0:t<-1?C:Math.acos(t)}function u(t,e){var r=(2+z)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>E;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(C*(4+C))*t*(1+Math.cos(e)),2*Math.sqrt(C/(4+C))*Math.sin(e)]}function c(t,e){function r(r,n){var i=R(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?R:e===1/0?f:(r.invert=function(r,n){var i=R.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=O(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*C)*Math.sqrt(C*C/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(C/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>E&&--i>0);return e/2}}function v(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function g(t,e){var r,n=Math.min(18,36*Math.abs(e)/C),i=Math.floor(n),a=n-i,o=(r=j[i])[0],s=r[1],l=(r=j[++i])[0],u=r[1],c=(r=j[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?z:-z)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function y(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function x(t,e){var r=b(t,e);return[(r[0]+t/z)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&_.hasOwnProperty(t.type)?_[t.type]:r)(t,n)};var _={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},w=[],M=[],k={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w}:null;return w=[],t}},A={lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}:null;return M=[],t}},T={polygonStart:n,lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:n,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:A,MultiLineString:A,Polygon:T,MultiPolygon:T,Sphere:T},E=1e-6,L=E*E,C=Math.PI,z=C/2,I=(Math.sqrt(C),C/180),D=180/C,P=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;ai[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n=0;--n){var o=l[1][n],s=180*o[0][0]/C,u=180*o[0][1]/C,c=180*o[1][1]/C,h=180*o[2][0]/C,f=180*o[2][1]/C;r.push(a([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++aE&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return P(v)}).raw=v;var j=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];j.forEach(function(t){t[1]*=1.0144}),g.invert=function(t,e){var r=e/z,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],n-=(p=(e>=0?z:-z)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*D}while(Math.abs(p)>L&&--m>0);break}}while(--a>=0);var v=j[a][0],g=j[a+1][0],y=j[Math.min(19,a+2)][0];return[t/(g+d*(y-v)/2+d*d*(y-2*g+v)/2),n*I]},(t.geo.robinson=function(){return P(g)}).raw=g,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return P(y)}).raw=y,b.invert=function(t,e){if(!(t*t+4*e*e>C*C+E)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=c*c,p=h*h,m=s*s,v=1-p*u*u,g=v?l(h*u)*Math.sqrt(a=1/v):a=0,y=2*g*h*s-t,b=g*c-e,x=a*(p*m+g*h*u*d),_=a*(.5*o*f-2*g*c*s),w=.25*a*(f*s-g*c*p*o),M=a*(d*u+g*m*h),k=_*w-M*x;if(!k)break;var A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return P(b)}).raw=b,x.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=o*o,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,v=1-h*d*d,g=v?l(o*d)*Math.sqrt(a=1/v):a=0,y=.5*(2*g*o*p+r/z)-t,b=.5*(g*s+n)-e,x=.5*a*(h*m+g*o*d*c)+.5/z,_=a*(f*u/4-g*s*p),w=.125*a*(u*p-g*s*h*f),M=.5*a*(c*d+g*m*o)+.5,k=_*w-M*x,A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return P(x)}).raw=x}e.exports=n},{}],799:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,m=o.range[1]-s,v=n._fullRange[0]+s,g=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var x=d-f,_=m-p,w=[f+x/2,p+_/2],M=r._rotate;return r._center=[w[0]+M[0],w[1]+M[1]],function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,M=i(f,p,d,m),k=i(v,y,g,b);l=a(e,M),o=n(l),x=a(e,k),r._fullScale=n(x),e.scale(o),l=a(e,M),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,M),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2}}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("./constants").clipPad;e.exports=n},{"./constants":790,d3:120}],800:[function(t,e,r){"use strict";function n(t,e){return(e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(k)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(A)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return v.invert(t)}function n(t){var e=v(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(k),l=_.mouse(this),u=v.rotate(),c=v.translate(),h=u,f=r(l)}function o(){if(d=_.mouse(this),n(l))return g.scale(v.scale()),void g.translate(v.translate());v.scale(_.event.scale),v.translate([c[0],_.event.translate[1]]),f?r(d)&&(m=r(d),p=[h[0]+(m[0]-f[0]),u[1],u[2]],v.rotate(p),h=p):(l=d,f=r(l)),t.render()}function s(){_.select(this).style(A)}var l,u,c,h,f,d,p,m,v=t.projection,g=i(v,e),y=2;return g.on("zoomstart",a).on("zoom",o).on("zoomend",s),g}function s(t,e){function r(t){g++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--g||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),m=x(p,"zoomstart","zoom","zoomend"),g=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(k);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),g=u(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),p=h(o,u),y=v(c(g,p)),b=d.r=f(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(m.of(this,arguments))}),r(m.of(this,arguments))}).on("zoomend",function(){_.select(this).style(A),y.call(p,"zoom",null),a(m.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,m,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&g(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function f(t,e,r){var n=m(e,2,t[0]);n=m(n,1,t[1]),n=m(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*M,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*M-f,i=Math.sqrt(p*p-c*c));var v=180-a-2*f,g=(Math.atan2(h,u)-Math.atan2(l,i))*M,y=(Math.atan2(h,u)-Math.atan2(l,-i))*M;return d(r[0],r[1],a,g)<=d(r[0],r[1],v,y)?[a,g,r[2]]:[v,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*M,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*M,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*M]}function g(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(h.boxEnd[1]=h.boxStart[1]+Math.abs(s)*w*(u>=0?1:-1),h.boxEnd[1]f[3]&&(h.boxEnd[1]=f[3],h.boxEnd[0]=h.boxStart[0]+(f[3]-h.boxStart[1])/Math.abs(w))):(h.boxEnd[0]=h.boxStart[0]+Math.abs(u)/w*(s>=0?1:-1),h.boxEnd[0]f[2]&&(h.boxEnd[0]=f[2],h.boxEnd[1]=h.boxStart[1]+(f[2]-h.boxStart[0])*Math.abs(w)))}}else h.boxEnabled?(s=h.boxStart[0]!==h.boxEnd[0],u=h.boxStart[1]!==h.boxEnd[1],s||u?(s&&(o(0,h.boxStart[0],h.boxEnd[0]),t.xaxis.autorange=!1),u&&(o(1,h.boxStart[1],h.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),h.boxEnabled=!1,h.boxInited=!1):h.boxInited&&(h.boxInited=!1);break;case"pan":h.boxEnabled=!1,h.boxInited=!1,n?(h.panning||(h.dragStart[0]=i,h.dragStart[1]=a),Math.abs(h.dragStart[0]-i)f[p+2]&&(f[p]=-1,f[p+2]=1),d=this[_[p]],d._length=o.viewBox[p+2]-o.viewBox[p],l.doAutoRange(d),d.setScale();b(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*n*e/window.innerHeight*(a-u.lastT())/100;u.pan(a,0,0,h*(Math.exp(o)-1))}}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":35,"mouse-change":450,"mouse-event-offset":451,"mouse-wheel":453,"right-now":500}],807:[function(t,e,r){"use strict";var n=t("./scene"),i=t("../plots"),a=t("../../lib"),o=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"gl3d"),s=0;s1;s(t,e,r,{type:"gl3d",attributes:u,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":602,"../../../lib":724,"../../../registry":842,"../../subplot_defaults":834,"./axis_defaults":810,"./layout_attributes":813}],813:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t},y:{valType:"number",dflt:e},z:{valType:"number",dflt:r}}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={_arrayAttrRegexps:[/^scene([2-9]|[1-9][0-9]+)?\.annotations/],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest"},_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":715,"./axis_attributes":809}],814:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=i},{"../../../lib/str2rgbarray":742}],815:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;af[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var A=m[1][a]-m[0][a];m[0][a]-=A/32,m[1][a]+=A/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){l=c[T[a]],u=l.type;var L=g[u];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===c.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===c.aspectmode)C=[1,1,1];else if("data"===c.aspectmode)C=E;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=c.aspectratio;C=[z.x,z.y,z.z]}c.aspectratio.x=h.aspectratio.x=C[0],c.aspectratio.y=h.aspectratio.y=C[1],c.aspectratio.z=h.aspectratio.z=C[2],this.glplot.aspect=C;var I=c.domain||null,D=e._size||null;if(I&&D){var P=this.container.style;P.position="absolute",P.left=D.l+I.x[0]*D.w+"px",P.top=D.t+(1-I.y[1])*D.h+"px",P.width=D.w*(I.x[1]-I.x[0])+"px",P.height=D.h*(I.y[1]-I.y[0])+"px"}this.glplot.redraw()}},A.destroy=function(){this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},A.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},A.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},A.saveCamera=function(t){var e=this.getCamera(),r=m.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;if(void 0===n)i=!0;else for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}(e,n,a,o)){i=!0;break}return i&&r.set(e),i},A.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},A.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}function a(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{ -"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=a?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":724,"./convert_text_opts":820}],823:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition;e.exports={_arrayAttrRegexps:[/^mapbox([2-9]|[1-9][0-9]+)?\.layers/],domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:n.extendDeep({},a,{family:{dflt:"Open Sans Regular, Arial Unicode MS Regular"}}),textposition:n.extendFlat({},o,{arrayOk:!1})}}}},{"../../components/color":602,"../../lib":724,"../../traces/scatter/attributes":1025,"../font_attributes":788}],824:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),s.text(o.text()&&u.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var u=r.width,h=r.height;v.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=u),a.height||(n.height=h)}else{v.supplyLayoutGlobalDefaults(a,n);var f=!a.width||!a.height,d=n.autosize,p=t._context&&t._context.autosizable;f&&(d||p)?v.plotAutoSize(t,a,n):f&&v.sanitizeMargins(t),!d&&f&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(l,s,a,n),n._has=v._hasPlotType.bind(n);var m=n._modules;for(e=0;e0){var c=o(t._boundingBoxMargins),h=c.left+c.right,f=c.bottom+c.top,p=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(m.width-h)),i=Math.round(p*(m.height-f))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var y=v.layoutAttributes.width.min,b=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;c.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(!1!==e.margin.autoexpand){l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var h=Object.keys(l),f=0;fv){var k=(g*w+(M-e.width)*v)/(w-v),A=(M*(1-v)+(g-e.width)*(1-w))/(w-v);k>=0&&A>=0&&k+A>i+a&&(i=k,a=A)}}if(u(b)&&l[_].t){var T=l[_].t.val,S=l[_].t.size;if(T>y){var E=(b*T+(S-e.height)*y)/(T-y),L=(S*(1-y)+(b-e.height)*(1-T))/(T-y);E>=0&&L>=0&&E+L>s+o&&(s=E,o=L)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return c.plot(t)},v.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===n?u:JSON.stringify(u)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){x=!0}), -i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,u=0,f=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s=0,L=E?f.angularAxis.domain:n.extent(k),C=Math.abs(k[1]-k[0]);T&&!A&&(C=0);var z=L.slice();S&&A&&(z[1]+=C);var I=f.angularAxis.ticksCount||4;I>8&&(I=I/(I/8)+I%8),f.angularAxis.ticksStep&&(I=(z[1]-z[0])/I);var D=f.angularAxis.ticksStep||(z[1]-z[0])/(I*(f.minorTicks+1));M&&(D=Math.max(Math.round(D),1)),z[2]||(z[2]=D);var P=n.range.apply(this,z);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(z.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),h.layout.angularAxis.domain=l.domain(),h.layout.angularAxis.endPadding=S?C:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var O=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=n.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,j=e.select(".chart-group"),N={fill:"none",stroke:f.tickColor},B={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var U=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:F,elements:U,reverseOrder:f.legend.reverseOrder})})();var V=F.node().getBBox();x=Math.min(f.width-V.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),w=[f.margin.left+x,f.margin.top+x],i.range([0,x]),h.layout.radialAxis.domain=i.domain(),F.attr("transform","translate("+[w[0]+x,w[1]-x]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*x+(V?V.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),f.title){var q=e.select("g.title-group text").style(B).text(f.title),G=q.node().getBBox();q.attr({x:w[0]-G.width/2,y:w[1]-x-20})}var Y=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var X=Y.selectAll("circle.grid-circle").data(i.ticks(5));X.enter().append("circle").attr({class:"grid-circle"}).style(N),X.attr("r",i),X.exit().remove()}Y.select("circle.outside-circle").attr({r:x}).style(N);var W=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Z=n.svg.axis().scale(i).ticks(5).tickSize(5);Y.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),Y.selectAll(".domain").style(N),Y.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var J=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),K=J.enter().append("g").classed("angular-tick",!0);J.attr({transform:function(t,e){return"rotate("+u(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),J.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(N),K.selectAll(".minor").style({stroke:f.minorTickColor}),J.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var Q=J.select("text.axis-text").attr({x:x+f.labelOffset,dy:o+"em",transform:function(t,e){var r=u(t,e),n=x+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":M?M[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(B);f.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var $=n.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[x+$,f.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var rt=[];p.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=l,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),it=[];nt.forEach(function(t,e){"unstacked"===t.key?it=it.concat(t.values.map(function(t,e){return[t]})):it.push(t.values)}),it.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(s[r].defaultConfig(),t)});s[r]().config(n)()})}var at,ot,st=e.select(".guides-group"),lt=e.select(".tooltips-group"),ut=s.tooltipPanel().config({container:lt,fontSize:8})(),ct=s.tooltipPanel().config({container:lt,fontSize:8})(),ht=s.tooltipPanel().config({container:lt,hasTick:!0})();if(!A){var ft=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(W).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=l.invert(n);var i=s.util.convertToCartesian(x+12,r+180);ut.text(s.util.round(at)).move([i[0]+w[0],i[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var dt=st.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var r=s.util.getMousePos(W).radius;dt.attr({r:r}).style({opacity:.5}),ot=i.invert(s.util.getMousePos(W).radius);var n=s.util.convertToCartesian(r,f.radialAxis.orientation);ct.text(s.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ht.hide(),ut.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=i.style("fill"),o="black",l=i.style("opacity")||1;if(i.attr({"data-opacity":l}),"none"!=a){i.attr({"data-fill":a}),o=n.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var u={t:s.util.round(t[0]),r:s.util.round(t[1])};A&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-H[0]-f.left,h.top+h.height/2-H[1]-f.top];ht.config({color:o}).text(c),ht.move(d)}else a=i.style("stroke"),i.attr({"data-stroke":a}),o=n.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ht.show()}).on("mouseout.tooltip",function(t,e){ht.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,i,l,u={data:[],layout:{}},c={},h={},f=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return u;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){u.data[e]||(u.data[e]={}),a(u.data[e],s.Axis.defaultConfig().data[0]),a(u.data[e],t)}),a(u.layout,s.Axis.defaultConfig().layout),a(u.layout,e.layout),this},d.getLiveConfig=function(){return h},d.getinputConfig=function(){return c},d.radialScale=function(t){return i},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},s.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},s.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},s.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,i,a)},"stroke-width":function(t,e){return v["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,i,a)},opacity:function(t,e){return v.opacity(r,i,a)},display:function(t,e){return v.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return i[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(l);g.enter().append("g").attr({class:"layer"});var y=g.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(h[t.geometryType]),y.exit().remove(),g.exit().remove()})}var e=[s.PolyChart.defaultConfig()],r=n.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],s.PolyChart.defaultConfig()),a(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var m=n.range(o.length),v=n.scale[c?"linear":"ordinal"]().domain(m).range(l),g=n.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,g(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=n.svg.axis().scale(g).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=s.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=function(){t=i.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+10,dy:.3*+i.fontSize}),l};return l.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",c=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(c);var h=i.padding,f=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},p=f.width+2*h+10,m=f.height+2*h;return r.attr({d:"M"+[[10,-m/2],[10,-m/4],[i.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-m/2+2*h]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return a(i,t),l},l},s.tooltipPanel.uid=1,s.adapter={},s.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=a({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(o.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),o.margin=c}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":698,"../../lib":724,d3:120}],832:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(h),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,h,f=new s;return e.isPolar=!0,e.svg=function(){ -return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":602,"../../lib":724,"./micropolar":831,"./undo_manager":833,d3:120}],833:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":602,"../../subplot_defaults":834,"./axis_defaults":838,"./layout_attributes":840}],840:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":601,"./axis_attributes":837}],841:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),v=t("../../components/fx"),g=t("../../components/titles"),y=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},x.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;a_*b?(a=b,i=a*_):(i=y,a=i/_),o=v*i/y,s=g*a/b,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=x,l.xaxis={type:"linear",range:[w+2*k-x,x-w-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[w,x-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=f({},t.aaxis,{visible:!0,range:[w,x-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=f({},t.baxis,{visible:!0,range:[x-w-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=f({},t.caxis,{visible:!0,range:[x-w-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var z="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),l.clipDefRelative.select("path").attr("transform",null);var I="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",I),l.layers.bgrid.attr("transform",I);var D="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",D),l.layers.agrid.attr("transform",D);var P="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1);var O=l.layers.axlines;O.select(".aline").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),O.select(".bline").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),O.select(".cline").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),l.plotContainer.select(".frontplot").call(c.setClipUrl,l._hasClipOnAxisFalse?null:l.clipId)},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));g.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;g.draw(r,"b"+n,{propContainer:a,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}}),g.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}})}};var w=b.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",k="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T=!0;x.initInteractions=function(){function t(t,e,r){var n=F.getBoundingClientRect();w=e-n.left,S=r-n.top,E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E,L=R.aaxis.range[1]-E.a,z=o(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),I="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",D=!1,P=N.append("path").attr("class","zoombox").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:z>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",I),O=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),g()}function e(t,e){return 1-e/R.h}function r(t,e){return 1-(t+(R.h-e)/Math.sqrt(3))/R.w}function n(t,e){return(t-(R.h-e)/Math.sqrt(3))/R.w}function a(t,i){var a=w+t,o=S+i,s=Math.max(0,Math.min(1,e(w,S),e(a,o))),l=Math.max(0,Math.min(1,r(w,S),r(a,o))),u=Math.max(0,Math.min(1,n(w,S),n(a,o))),c=(s/2+u)*R.w,h=(1-s/2-l)*R.w,f=(c+h)/2,d=h-c,p=(1-s)*R.h,m=p-d/_;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),O.transition().style("opacity",1).duration(200),D=!0)}function h(t,e){if(C===E)return 2===e&&x(),i(j);i(j);var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r),T&&j.data&&j._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),T=!1)}function f(){E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E}function d(t,e){var r=t/R.xaxis._m,n=e/R.yaxis._m;C={a:E.a-n,b:E.b+(r+n)/2,c:E.c-(r-n)/2};var i=[C.a,C.b,C.c].sort(),a={a:i.indexOf(C.a),b:i.indexOf(C.b),c:i.indexOf(C.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),C={a:i[a.a],b:i[a.b],c:i[a.c]},e=(E.a-C.a)*R.yaxis._m,t=(E.c-C.c-E.b+C.b)*R.xaxis._m);var o="translate("+(R.x0+t)+","+(R.y0+e)+")";R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o);var s="translate("+-t+","+-e+")";if(R.clipDefRelative.select("path").attr("transform",s),R.aaxis.range=[C.a,R.sum-C.b-C.c],R.baxis.range=[R.sum-C.a-C.c,C.b],R.caxis.range=[R.sum-C.a-C.b,C.c],R.drawAxes(!1),R.plotContainer.selectAll(".crisp").classed("crisp",!1),R._hasClipOnAxisFalse){var l=R.plotContainer.select(".scatterlayer").selectAll(".points");l.selectAll(".point").call(c.hideOutsideRangePoints,R),l.selectAll(".textpoint").call(c.hideOutsideRangePoints,R)}}function p(t,e){if(t){var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r)}else 2===e&&x()}function g(){N.selectAll(".select-outline").remove()}function x(){var t={};t[R.id+".aaxis.min"]=0,t[R.id+".baxis.min"]=0,t[R.id+".caxis.min"]=0,j.emit("plotly_doubleclick",null),s.relayout(j,t)}var w,S,E,L,C,z,I,D,P,O,R=this,F=R.layers.plotbg.select("path").node(),j=R.graphDiv,N=j._fullLayout._zoomlayer,B={element:F,gd:j,plotinfo:{xaxis:R.xaxis,yaxis:R.yaxis},doubleclick:x,subplot:R.id,prepFn:function(e,r,n){B.xaxes=[R.xaxis],B.yaxes=[R.yaxis];var i=j._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),B.minDrag="lasso"===i?1:void 0,"zoom"===i?(B.moveFn=a,B.doneFn=h,t(e,r,n)):"pan"===i?(B.moveFn=d,B.doneFn=p,f(),g()):"select"!==i&&"lasso"!==i||y(e,r,n,B,i)}};F.onmousemove=function(t){v.hover(j,t,R.id),j._fullLayout._lasthover=F,j._fullLayout._hoversubplot=R.id},F.onmouseout=function(t){j._dragging||m.unhover(j,t)},F.onclick=function(t){v.click(j,t,R.id)},m.init(B)}},{"../../components/color":602,"../../components/dragelement":623,"../../components/drawing":626,"../../components/fx":643,"../../components/titles":691,"../../lib":724,"../../lib/extend":715,"../../plotly":759,"../cartesian/axes":764,"../cartesian/constants":769,"../cartesian/select":780,"../cartesian/set_convert":781,"../plots":827,d3:120,tinycolor2:532}],842:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var d=Object.keys(h);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}function i(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var a=t("d3"),o=t("../components/drawing"),s=t("../components/color"),l=t("../constants/xmlns_namespaces"),u=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e){var r,h=t._fullLayout,f=h._paper,d=h._toppaper;f.insert("rect",":first-child").call(o.setRect,0,0,h.width,h.height).call(s.fill,h.paper_bgcolor);var p=h._basePlotModules||[];for(r=0;r0&&A>0,N=M<=R&&A<=F,B=M<=F&&A<=R,U="h"===g?R>=M*(F/A):F>=A*(R/M);j&&(N||B||U)?b="inside":(b="outside",x.remove(),x=null)}else b="inside";if(!x&&(x=m(e,y,"outside"===b?E:S),_=k.bBox(x.node()),M=_.width,A=_.height,M<=0||A<=0))return void x.remove();var V;V="outside"===b?a(o,f,d,p,_,g):i(o,f,d,p,_,g),x.attr("transform",V)}}}function i(t,e,r,n,i,a){var s,l,u,c,h,f=i.width,d=i.height,p=(i.left+i.right)/2,m=(i.top+i.bottom)/2,v=Math.abs(e-t),g=Math.abs(n-r);v>2*I&&g>2*I?(h=I,v-=2*h,g-=2*h):h=0;var y,b;return f<=v&&d<=g?(y=!1,b=1):f<=g&&d<=v?(y=!0,b=1):fr?(u=(t+e)/2,c=n-h-l/2):(u=(t+e)/2,c=n+h+l/2),o(p,m,u,c,b,y)}function a(t,e,r,n,i,a){var s,l="h"===a?Math.abs(n-r):Math.abs(e-t);l>2*I&&(s=I,l-=2*s);var u,c,h,f,d="h"===a?Math.min(1,l/i.height):Math.min(1,l/i.width),p=(i.left+i.right)/2,m=(i.top+i.bottom)/2;return u=d*i.width,c=d*i.height,"h"===a?er?(h=(t+e)/2,f=n+s+c/2):(h=(t+e)/2,f=n-s-c/2),o(p,m,h,f,d,!1)}function o(t,e,r,n,i,a){var o,s;return i<1?o="scale("+i+") ":(i=1,o=""),s=a?"rotate("+a+" "+t+" "+e+") ":"","translate("+(r-i*t)+" "+(n-i*e)+")"+o+s}function s(t,e){var r=d(t.text,e);return p(S,r)}function l(t,e){var r=d(t.textposition,e);return m(E,r)}function u(t,e,r){return f(L,t.textfont,e,r)}function c(t,e,r){return f(C,t.insidetextfont,e,r)}function h(t,e,r){return f(z,t.outsidetextfont,e,r)}function f(t,e,r,n){e=e||{};var i=d(e.family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:v(t.size,a,n.size),color:g(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?ei))return e}return void 0!==r?r:t.dflt}function g(t,e,r){return x(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),b=t("fast-isnumeric"),x=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/color"),k=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),S=T.text,E=T.textposition,L=T.textfont,C=T.insidetextfont,z=T.outsidetextfont,I=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);s.enter().append("g").attr("class","trace bars"),s.append("g").attr("class","points").each(function(e){var r=e[0].t,s=e[0].trace,l=r.poffset,u=Array.isArray(l);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,c){function h(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-A,2):t}function f(t,e){return Math.abs(t-e)>=2?h(t):t>e?Math.ceil(t):Math.floor(t)}var d,p,m,v,g=r.p+(u?l[c]:l),x=g+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(m=a.c2p(g,!0),v=a.c2p(x,!0),d=i.c2p(_,!0),p=i.c2p(w,!0)):(d=i.c2p(g,!0),p=i.c2p(x,!0),m=a.c2p(_,!0),v=a.c2p(w,!0)),!(b(d)&&b(p)&&b(m)&&b(v)&&d!==p&&m!==v))return void y.select(this).remove();var k=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(k/2%1,2);if(!t._context.staticPlot){var T=M.opacity(r.mc||s.marker.color),S=T<1||k>.01?h:f;d=S(d,p),p=S(p,d),m=S(m,v),v=S(v,m)}var E=y.select(this);E.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+d+","+m+"V"+v+"H"+p+"V"+m+"Z"),n(t,E,e,c,d,p,m,v)})}),s.call(A.plot,e)}},{"../../components/color":602,"../../components/drawing":626,"../../components/errorbars":632,"../../lib":724,"../../lib/svg_text_utils":743,"./attributes":852,d3:120,"fast-isnumeric":129,tinycolor2:532}],860:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var s,l,u,c,h,f=t._fullLayout.barmode,d="overlay"===f,p="group"===f;if(d)i(t,e,r,n);else if(p){for(s=[],l=[],u=0;uu+s||!y(l))&&(h=!0,f(c,t))}for(var i=r.traces,a=g(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,c=[l,u],h=!1,d=0;d1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,o=r.line,s=a.tryColorscale(r,""),l=a.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,a,u=(t.mlw+1||o.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",u+"px").call(i.fill,e),u&&(a="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,c.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":602,"../../components/drawing":626,"../../components/errorbars":632,d3:120}],863:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":602,"../../components/colorscale/defaults":611,"../../components/colorscale/has_colorscale":615}],864:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},xcalendar:n.xcalendar,ycalendar:n.ycalendar,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":601,"../../lib/extend":715,"../scatter/attributes":1025}],865:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,s,l,u,c,h,f,d,p=a.getFromId(t,e.xaxis||"x"),m=a.getFromId(t,e.yaxis||"y"),v=e.orientation,g=[];"h"===v?(r=p,o="x",u=m,c="y"):(r=m,o="y",u=p,c="x"),s=r.makeCalcdata(e,o),a.expand(r,s,{padded:!0}),h=function(t,e,r,a,o){var s;return r in e?h=a.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===a.type||n(e.name)&&-1!==["linear","log"].indexOf(a.type)||i.isDateTime(e.name)&&"date"===a.type)?e.name:t.numboxes,s=a.d2c(s,0,e[r+"calendar"]),h=o.map(function(){return s})),h}(t,e,c,u,s);var y=i.distinctVals(h);return f=y.vals,d=y.minDiff/2,l=function(t,e,r,a,o){var s,l,u,c,h=a.length,f=e.length,d=[],p=[];for(s=0;s=0&&u1,m=r.dPos*(1-c.boxgap)*(1-c.boxgroupgap)/(p?t.numboxes:1),v=p?2*r.dPos*((r.boxnum+.5)/t.numboxes-.5)*(1-c.boxgap):0,g=m*d.whiskerwidth;if(!0!==d.visible||r.emptybox)return void a.select(this).remove();"h"===d.orientation?(l=f,u=h):(l=h,u=f),r.bPos=v,r.bdPos=m,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=l.c2p(t.pos+v,!0),r=l.c2p(t.pos+v-m,!0),n=l.c2p(t.pos+v+m,!0),i=l.c2p(t.pos+v-g,!0),s=l.c2p(t.pos+v+g,!0),c=u.c2p(t.q1,!0),h=u.c2p(t.q3,!0),f=o.constrain(u.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),p=u.c2p(!1===d.boxpoints?t.min:t.lf,!0),y=u.c2p(!1===d.boxpoints?t.max:t.uf,!0);"h"===d.orientation?a.select(this).attr("d","M"+f+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+h+"V"+r+"ZM"+c+","+e+"H"+p+"M"+h+","+e+"H"+y+(0===d.whiskerwidth?"":"M"+p+","+i+"V"+s+"M"+y+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+c+"H"+n+"V"+h+"H"+r+"ZM"+e+","+c+"V"+p+"M"+e+","+h+"V"+y+(0===d.whiskerwidth?"":"M"+i+","+p+"H"+s+"M"+i+","+y+"H"+s))}),d.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=d}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,u,c="all"===d.boxpoints?t.val:t.val.filter(function(e){return et.uf}),h=Math.max((t.max-t.min)/10,t.q3-t.q1),f=1e-9*h,p=.01*h,g=[],y=0;if(d.jitter){if(0===h)for(y=1,g=new Array(c.length),e=0;et.lo&&(n.so=!0),n})}).enter().append("path").classed("point",!0).call(s.translatePoints,h,f),d.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=l.c2p(t.pos+v,!0),r=l.c2p(t.pos+v-m,!0),n=l.c2p(t.pos+v+m,!0),i=u.c2p(t.mean,!0),o=u.c2p(t.mean-t.sd,!0),s=u.c2p(t.mean+t.sd,!0);"h"===d.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==d.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==d.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})})}},{"../../components/drawing":626,"../../lib":724,d3:120}],872:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=["v","h"];for(o=0;o=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,I=L>0?Math.ceil:Math.floor,D=L>0?Math.min:Math.max,P=L>0?Math.max:Math.min,O=z(S+C),R=I(E-C);c=T(S);var F=[[c]];for(i=O;i*L=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}},{}],886:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,u,c,h,f,d,p,v,g=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,b.length=P,b.crossLength=D,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(f=t.dxydi([],n-1,o,0,s),g.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),g.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),g.push(h[0]),y.push(h[1]),l=h;else for(n=t.a2i(e),u=Math.floor(Math.max(0,Math.min(D-2,n))),c=n-u,b.length=D,b.crossLength=P,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],u,e,c,r)},i=0;i0&&(p=t.dxydj([],u,i-1,c,0),g.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),v=t.dxydj([],u,i-1,c,1),g.push(h[0]-v[0]/3),y.push(h[1]-v[1]/3)),g.push(h[0]),y.push(h[1]),l=h;return b.axisLetter=r,b.axis=M,b.crossAxis=E,b.value=e,b.constvar=a,b.index=m,b.x=g,b.y=y,b.smoothing=E.smoothing,b}function s(e){var n,i,o,s,l,u=[],c=[],h={};if(h.length=w.length,h.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(u),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(b=w[c],x=w[y],l=0;lw[w.length-1]||A.push(i(o(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}),d=f[0],p=f[1],m=d;m<=p;m++)v=M.tick0+M.dtick*m,k.push(i(o(v),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":715,"../../plots/cartesian/axes":764}],887:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},{}],903:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],u=r[0].trace,c=e.xaxis,h=e.yaxis,f=u.aaxis,d=u.baxis,p=t._fullLayout,m=e.plot.selectAll(".carpetlayer"),v=n(p._defs,"g","clips"),g=n(m,"g","carpet"+u.uid).classed("trace",!0),y=n(g,"g","minorlayer"),b=n(g,"g","majorlayer"),x=n(g,"g","boundarylayer"),_=n(g,"g","labellayer");g.style("opacity",u.opacity),o(c,h,b,f,"a",f._gridlines),o(c,h,b,d,"b",d._gridlines),o(c,h,y,f,"a",f._minorgridlines),o(c,h,y,d,"b",d._minorgridlines),o(c,h,x,f,"a-boundary",f._boundarylines),o(c,h,x,d,"b-boundary",d._boundarylines),l(t,_,u,i,c,h,s(t,c,h,u,i,_,f._labels,"a-label"),s(t,c,h,u,i,_,d._labels,"b-label")),a(u,i,v,c,h)}function a(t,e,r,i,a){var o,s,l,u,c=r.select("#"+t._clipPathId);c.size()||(c=r.append("clipPath").classed("carpetclip",!0));var h=n(c,"path","carpetboundary"),p=e.clipsegments,m=[];for(u=0;u0?"start":"end","data-notex":1}).call(h.font,i.font).text(i.text).call(m.convertToTspans,t),f=h.bBox(this);l.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*f.height+")"),u=Math.max(u,f.width+i.axis.labelpadding)}),l.exit().remove(),u}function l(t,e,r,n,i,a,o,s){var l,c,h,f;l=.5*(r.a[0]+r.a[r.a.length-1]),c=r.b[0],h=r.ab2xy(l,c,!0),f=r.dxyda_rough(l,c),u(t,e,r,n,h,f,r.aaxis,i,a,o,"a-title"),l=r.a[0],c=.5*(r.b[0]+r.b[r.b.length-1]),h=r.ab2xy(l,c,!0),f=r.dxydb_rough(l,c),u(t,e,r,n,h,f,r.baxis,i,a,s,"b-title")}function u(t,e,r,n,i,a,o,s,l,u,f){var d=[];o.title&&d.push(o.title);var v=e.selectAll("text."+f).data(d);v.enter().append("text").classed(f,!0),v.each(function(){var e=p(r,s,l,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(u=0),u+=o.titlefont.size+o.titleoffset,c.select(this).text(o.title||"").call(m.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+u+")").classed("user-select-none",!0).attr("text-anchor","middle").call(h.font,o.titlefont)}),v.exit().remove()}var c=t("d3"),h=t("../../components/drawing"),f=t("./map_1d_array"),d=t("./makepath"),p=t("./orient_text"),m=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||ev},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,h.smoothing,f.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],u,c,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[u-1]|ir[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,d,p,m=0,v=0,g=[];ne[u-1]?(h=u-2,f=1,m=(n-e[u-1])/(e[u-1]-e[u-2])):(h=Math.max(0,Math.min(u-2,Math.floor(o))),f=o-h),ir[c-1]?(d=c-2,p=1,v=(i-r[c-1])/(r[c-1]-r[c-2])):(d=Math.max(0,Math.min(c-2,Math.floor(s))),p=s-d),m&&(t.dxydi(g,h,d,f,p),l[0]+=g[0]*m,l[1]+=g[1]*m),v&&(t.dxydj(g,h,d,f,p),l[0]+=g[0]*v,l[1]+=g[1]*v)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=g*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":738,"./compute_control_points":890,"./constants":891,"./create_i_derivative_evaluator":892,"./create_j_derivative_evaluator":893,"./create_spline_evaluator":894}],905:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],u=t[0].length,c=t.length,h=0;for(i=0;i0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",M,"after",k,"iterations"),t}},{"../../lib":724}],906:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":946,"./has_columns":896}],907:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker.line;e.exports=s({},{locations:{valType:"data_array"},locationmode:n.locationmode,z:{valType:"data_array"},text:{valType:"data_array"},marker:{line:{color:l.color,width:s({},l.width,{dflt:1})}},hoverinfo:s({},o.hoverinfo,{flags:["location","z","text","name"]})},i,{colorbar:a})},{"../../components/colorbar/attributes":603,"../../components/colorscale/attributes":607,"../../lib/extend":715,"../../plots/attributes":762,"../scattergeo/attributes":1062}],908:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){n(e,e.z,"","z")}},{"../../components/colorscale/calc":608}],909:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l,u=s("locations");if(u&&(l=u.length),!u||!l)return void(e.visible=!1);var c=s("z");if(!Array.isArray(c))return void(e.visible=!1);c.length>l&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":611,"../../lib":724,"./attributes":907}],910:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],911:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e.hoverinfo,s="all"===o?a.hoverinfo.flags:o.split("+"),l=-1!==s.indexOf("name"),u=-1!==s.indexOf("location"),c=-1!==s.indexOf("z"),h=-1!==s.indexOf("text"),f=!l&&u,d=[];f?t.nameOverride=r.id:(l&&(t.nameOverride=e.name),u&&d.push(r.id)),c&&d.push(function(t){return i.tickText(n,n.c2l(t),"hover").text}(r.z)),h&&d.push(r.tx),t.extraText=d.join("
")}var i=t("../../plots/cartesian/axes"),a=t("./attributes");e.exports=function(t){var e=t.cd,r=e[0].trace,i=t.subplot,a=i.choroplethHoverPt;if(a){var o=i.projection(a.properties.ct);return t.x0=t.x1=o[0],t.y0=t.y1=o[1],t.index=a.index,t.location=a.id,t.z=a.z,n(t,r,a,i.mockAxis),[t]}}},{"../../plots/cartesian/axes":764,"./attributes":907}],912:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":792,"../heatmap/colorbar":945,"./attributes":907,"./calc":908,"./defaults":909,"./event_data":910,"./hover":911,"./plot":913}],913:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],i=t.locations,a=i.length,o=u(t,e),s=(t.marker||{}).line||{},l=0;l0&&(n[0].trace=t),n}function i(t){t.framework.selectAll("g.trace.choropleth").each(function(t){var e=t[0].trace,r=a.select(this),n=e.marker||{},i=n.line||{},u=l.makeColorScaleFunc(l.extractScale(e.colorscale,e.zmin,e.zmax));r.selectAll("path.choroplethlocation").each(function(t){a.select(this).attr("fill",function(t){return u(t.z)}).call(o.stroke,t.mlc||i.color).call(s.dashLine,"",t.mlw||i.width||0)})})}var a=t("d3"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("../../components/colorscale"),u=t("../../lib/topojson_utils").getTopojsonFeatures,c=t("../../lib/geo_location_utils").locationToFeature,h=t("../../lib/array_to_calc_item"),f=t("../../plots/geo/constants");e.exports=function(t,e,r){function o(t){return t[0].trace.uid}var s,l=t.framework,u=l.select("g.choroplethlayer"),c=l.select("g.baselayer"),h=l.select("g.baselayeroverchoropleth"),d=f.baseLayersOverChoropleth,p=u.selectAll("g.trace.choropleth").data(e,o);p.enter().append("g").attr("class","trace choropleth"),p.exit().remove(),p.each(function(e){var r=e[0].trace,i=n(r,t.topojson),o=a.select(this).selectAll("path.choroplethlocation").data(i);o.enter().append("path").classed("choroplethlocation",!0).on("mouseover",function(e){t.choroplethHoverPt=e}).on("mouseout",function(){t.choroplethHoverPt=null}),o.exit().remove()}),h.selectAll("*").remove();for(var m=0;ms.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:n(u,c,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":724,"../../plots/cartesian/axes":764,"../heatmap/calc":943}],916:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.autoMargin(t,s);var l=i(t,s);e[0].t.cb=l;var u=r.contours,c=r.line,h=u.size||1,f=u.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:c.color,width:!1!==u.showlines?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:h}).options(r.colorbar)()}},{"../../components/colorbar/draw":605,"../../plots/plots":827,"./end_plus":920,"./make_color_map":924}],917:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],918:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a,o=n.coerce2(t,e,i,"contours.start"),s=n.coerce2(t,e,i,"contours.end"),l=!1===o||!1===s,u=r("contours.size");!(a=l?e.autocontour=!0:r("autocontour",!1))&&u||r("ncontours")}},{"../../lib":724,"./attributes":914}],919:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}if(!a(t,e,c,u))return void(e.visible=!1);c("text"),c("connectgaps",i(e)),o(t,e,c),s(t,e,c,u)}},{"../../lib":724,"../heatmap/has_columns":949,"../heatmap/xyz_defaults":957,"./attributes":914,"./contours_defaults":918,"./style_defaults":928}],920:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],921:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20?(m=u.CHOOSESADDLE[m][(v[0]||v[1])<0?0:1],t.crossings[p]=u.SADDLEREMAINDER[m]):delete t.crossings[p],!(v=u.NEWDELTA[m])){l.log("Found bad marching index:",m,e,t.level);break}g.push(s(t,e,v)),e[0]+=v[0],e[1]+=v[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),p=e.join(",");var _=v[0]&&(e[0]<0||e[0]>x-2)||v[1]&&(e[1]<0||e[1]>b-2);if(p===d&&v.join(",")===y||r&&_)break;m=t.crossings[p]}1e4===f&&l.log("Infinite loop in contour?");var w,M,k,A,T,S,E,L=n(g[0],g[g.length-1],a,c),C=0,z=.2*t.smoothing,I=[],D=0;for(f=1;f=D;f--)if((w=I[f])=D&&w+I[M]20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==u.BOTTOMSTART.indexOf(t)?i=1:-1!==u.LEFTSTART.indexOf(t)?n=1:-1!==u.TOPSTART.indexOf(t)?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0),n+l,i]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0),n,i+u]}var l=t("../../lib"),u=t("./constants");e.exports=function(t,e,r){var n,i,o,s,u;for(e=e||.01,r=r||.01,o=0;ot?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208}return 15===r?0:r}var i=t("./constants");e.exports=function(t){var e,r,a,o,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(r=0;r1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function a(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function o(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=s(t,r);e?f.select(this).attr("d",e).style("stroke","none"):f.select(this).remove()})}function s(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,i,a,o,s,l,u=Math.min(t.z[0][0],t.z[0][1]),c=t.edgepaths.length||u<=t.level?"":"M"+e.join("L")+"Z",h=0,f=t.edgepaths.map(function(t,e){return e}),m=!0;f.length;){for(l=p.smoothopen(t.edgepaths[h],t.smoothing),c+=m?l:l.replace(/^M/,"L"),f.splice(f.indexOf(h),1),n=t.edgepaths[h][t.edgepaths[h].length-1],o=-1,a=0;a<4;a++){if(!n){d.log("Missing end?",h,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?r(n)&&(i=e[2]):i=e[3]:i=e[0]:i=e[1],s=0;s=0&&(i=v,o=s):Math.abs(n[1]-i[1])<.01?Math.abs(n[1]-v[1])<.01&&(v[0]-n[0])*(i[0]-v[0])>=0&&(i=v,o=s):d.log("endpt to newendpt is not vert. or horz.",n,i,v)}if(n=i,o>=0)break;c+="L"+i}if(o===t.edgepaths.length){d.log("unclosed perimeter path");break}h=o,m=-1===f.indexOf(h),m&&(h=f[0],c+="Z")}for(h=0;hn.center?n.right-o:o-n.left)/(u+Math.abs(Math.sin(l)*a)),f=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(c)+Math.cos(l)*a);if(h<1||f<1)return 1/0;var p=M.EDGECOST*(1/(h-1)+1/(f-1));p+=M.ANGLECOST*l*l;for(var m=o-u,v=s-c,g=o+u,y=s+c,b=0;b2*M.MAXCOST)break;p&&(o/=2),a=l-o/2,s=a+1.5*o}if(f<=M.MAXCOST)return c},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,u=Math.sin(l),c=Math.cos(l),h=i*c,f=a*u,d=i*u,p=-a*c,m=[[o-h-f,s-d-p],[o+h-f,s+d-p],[o+h+f,s+d+p],[o-h+f,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var a=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(a.exit().remove(),a.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;f.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(m.convertToTspans,r)}),i){for(var o="",s=0;sS){r("a scale is not linear");break}}if(s.length&&"fast"===A){var E=(s[s.length-1]-s[0])/(s.length-1),L=Math.abs(E/100);for(x=0;xL){r("b scale is not linear");break}}}var C=d(b),z="scaled"===e.xtype?"":n,I=v(e,z,i,o,C,w),D="scaled"===e.ytype?"":s,P=v(e,D,g,y,b.length,M),O={a:I,b:P,z:b};return"levels"===e.contours.type&&u(e,b,"","z"),[O]}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("../../lib").extendFlat,l=t("../../registry"),u=t("../../components/colorscale/calc"),c=t("../heatmap/has_columns"),h=t("../heatmap/convert_column_xyz"),f=t("../heatmap/clean_2d_array"),d=t("../heatmap/max_row_length"),p=t("../heatmap/interp2d"),m=t("../heatmap/find_empties"),v=t("../heatmap/make_bound_array"),g=t("./defaults"),y=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=y(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var a=t.data[r.index],l=t.data[e.index];l.a||(l.a=a.a),l.b||(l.b=a.b),g(l,e,e._defaultColor,t._fullLayout)}var u=i(t,e),c=e.contours;if(!0===e.autocontour){var h=n(e.zmin,e.zmax,e.ncontours);c.size=h.dtick,c.start=o.tickFirst(h),h.range.reverse(),c.end=o.tickFirst(h),c.start===e.zmin&&(c.start+=c.size),c.end===e.zmax&&(c.end-=c.size),c.start>c.end&&(c.start=c.end=(c.start+c.end)/2),e._input.contours=s({},c)}else{var f=c.start,d=c.end,p=e._input.contours;if(f>d&&(c.start=p.start=d,d=c.end=p.end=f,f=c.start),!(c.size>0)){var m;m=f===d?1:n(f,d,e.ncontours).dtick,p.size=c.size=m}}return u}}},{"../../components/colorscale/calc":608,"../../lib":724,"../../plots/cartesian/axes":764,"../../registry":842,"../carpet/lookup_carpetid":898,"../heatmap/clean_2d_array":944,"../heatmap/convert_column_xyz":946,"../heatmap/find_empties":948,"../heatmap/has_columns":949,"../heatmap/interp2d":952,"../heatmap/make_bound_array":953,"../heatmap/max_row_length":954,"./defaults":936}],931:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,u=n.z,c=-1/0,h=1/0;for(i=0;i":case">=":n.contours.value>c&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valuec&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),ac&&(t[0].prefixBoundary=!0)}}},{}],932:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],933:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":932,"fast-isnumeric":129}],934:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":933,"fast-isnumeric":129}],935:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":724}],938:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":774,"../contour/colorbar":916,"../contour/style":927,"./attributes":929,"./calc":930,"./defaults":936,"./plot":941}],939:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,u,c){function h(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,x=_):Math.abs(g[1]-y[1])=0&&(y=L,x=_):a.log("endpt to newendpt is not vert. or horz.",g,y,L)}if(x>=0)break;M+=m(g,y),g=y}if(x===e.edgepaths.length){a.log("unclosed perimeter path");break}v=x,A=-1===k.indexOf(v),A&&(v=k[0],M+=m(g,y)+"Z",g=null)}for(v=0;v=0;F--)P=s.clipsegments[F],O=f([],P.x,_.c2p),R=f([],P.y,T.c2p),O.reverse(),R.reverse(),N.push(d(O,R,P.bicubic));var B="M"+N.join("L")+"Z";u(j,s.clipsegments,_,T,C,m.coloring),c(a,j,_,T,L,z,n,o,s,m.coloring,B),i(j,L,t,r[0],m,e,o),p.setClipUrl(j,o._clipPathId)}}function i(t,e,r,n,i,o,s){var l=t.selectAll("g.contourlines").data([0]);l.enter().append("g").classed("contourlines",!0);var u=!1!==i.showlines,c=i.showlabels,f=u&&c,d=y.createLines(l,u||c,e),v=y.createLineClip(l,f,r._fullLayout._defs,n.trace.uid),g=t.selectAll("g.contourlabels").data(c?[0]:[]);if(g.exit().remove(),g.enter().append("g").classed("contourlabels",!0),c){var x=o.xaxis,_=o.yaxis,w=x._length,M=_._length,k=[[[0,0],[w,0],[w,M],[0,M]]],A=[];m.clearLocationCache();var T=y.labelFormatter(i,n.t.cb,r._fullLayout),S=p.tester.append("text").attr("data-notex",1).call(p.font,i.labelfont),E={left:0,right:w,center:w/2,top:0,bottom:M,middle:M/2},L=Math.sqrt(w*w+M*M),C=b.LABELDISTANCE*L/Math.max(1,e.length/b.LABELINCREASE);d.each(function(t){var e=y.calcTextOpts(t.level,T,S,r);h.select(this).selectAll("path").each(function(r){var n=this,i=m.getVisibleSegment(n,E,e.height/2);if(i&&(a(n,r,t,i,s,e.height),!(i.len<(e.width+e.height)*b.LABELMIN)))for(var o=Math.min(Math.ceil(i.len/C),b.LABELMAX),l=0;lb&&(n.max=b),n.len=n.max-n.min}}function o(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function s(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function l(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}function u(t,e,r,n,i,a){var o,s,l,u,c=t.selectAll("g.contourbg").data([0]);c.enter().append("g").classed("contourbg",!0);var h=c.selectAll("path").data("fill"!==a||i?[]:[0]);h.enter().append("path"),h.exit().remove();var p=[];for(u=0;uz){r("x scale is not linear");break}}if(y.length&&"fast"===E){var I=(y[y.length-1]-y[0])/(y.length-1),D=Math.abs(I/100);for(w=0;wD){r("y scale is not linear");break}}}var P=c(_),O="scaled"===e.xtype?"":m,R=p(e,O,v,g,P,M),F="scaled"===e.ytype?"":y,j=p(e,F,b,x,_.length,k);S||(a.expand(M,R),a.expand(k,j));var N={x:R,y:j,z:_,text:e.text};if(s(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,v,g,P,M),N.yfill=p(B,F,b,x,_.length,k)}return[N]}},{"../../components/colorscale/calc":608,"../../lib":724,"../../plots/cartesian/axes":764,"../../registry":842,"../histogram2d/calc":971,"./clean_2d_array":944,"./convert_column_xyz":946,"./find_empties":948,"./has_columns":949,"./interp2d":952,"./make_bound_array":953,"./max_row_length":954}],944:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,i,a,o,s,l;if(e){for(r=0,s=0;s=0;o--)a=f[o],r=a[0],i=a[1],(s=((h[[r-1,i]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":954}],949:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],950:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=n.constants.MAXDIST;e.exports=function(t,e,r,o,s){if(!(t.distance=y[0].length||h<0||h>y.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1])>a||n.inbox(r-g[0],r-g[g.length-1])>a)return;if(s){var w;for(x=[2*v[0]-v[1]],w=1;wm&&(g=Math.max(g,Math.abs(t[i][a]-p)/(v-m))))}return g}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":724}],953:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u0;)b=p.c2p(A[M]),M--;for(b0;)w=m.c2p(T[M]),M--;if(w<_&&(x=_,_=w,w=x,I=!0),S&&(A=r[0].xfill,T=r[0].yfill),"fast"!==E){var D="best"===E?0:.5;y=Math.max(-D*p._length,y),b=Math.min((1+D)*p._length,b),_=Math.max(-D*m._length,_),w=Math.min((1+D)*m._length,w)}var P=Math.round(b-y),O=Math.round(w-_),R=P<=0||O<=0,F=e.plot.select(".imagelayer").selectAll("g.hm."+g).data(R?[]:[0]);if(F.enter().append("g").classed("hm",!0).classed(g,!0),F.exit().remove(),!R){var j,N;"fast"===E?(j=C,N=L):(j=P,N=O);var B=document.createElement("canvas");B.width=j,B.height=N;var U,V,H=B.getContext("2d"),q=s.makeColorScaleFunc(s.extractScale(f.colorscale,f.zmin,f.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===E?(U=z?function(t){return C-1-t}:o.identity,V=I?function(t){return L-1-t}:o.identity):(U=function(t){return o.constrain(Math.round(p.c2p(A[t])-y),0,P)},V=function(t){return o.constrain(Math.round(m.c2p(T[t])-_),0,O)});var G,Y,X,W,Z,J,K,Q=V(0),$=[Q,Q],tt=z?0:1,et=I?0:1,rt=0,nt=0,it=0,at=0;if(E){var ot,st=0;try{ot=new Uint8Array(P*O*4)}catch(t){ot=new Array(P*O*4)}if("best"===E){var lt,ut,ct,ht=new Array(A.length),ft=new Array(T.length),dt=new Array(P);for(M=0;M0&&a0&&s0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}var i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("../bar/arrays_to_calcdata"),l=t("./bin_functions"),u=t("./norm_functions"),c=t("./average"),h=t("./clean_bins");e.exports=function(t,e){if(!0===e.visible){var r,f=[],d=[],p=o.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),m="h"===e.orientation?"y":"x",v={x:"y",y:"x"}[m],g=e[m+"calendar"],y=e.cumulative;h(e,p,m);var b=p.makeCalcdata(e,m),x=m+"bins",_="autobin"+m,w=e[x];!1===e[_]&&w&&null!==w.start&&null!==w.end||(w=o.autoBin(b,p,e["nbins"+m],!1,g),y.enabled&&"include"!==y.currentbin&&("decreasing"===y.direction?w.start=p.c2r(p.r2c(w.start)-w.size):w.end=p.c2r(p.r2c(w.end)+w.size)),e._input[x]=e[x]=w,e._input[_]=e[_]);var M,k,A,T="string"==typeof w.size,S=T?[]:w,E=[],L=[],C=0,z=e.histnorm,I=e.histfunc,D=-1!==z.indexOf("density");y.enabled&&D&&(z=z.replace(/ ?density$/,""),D=!1);var P,O="max"===I||"min"===I,R=O?null:0,F=l.count,j=u[z],N=!1,B=function(t){return p.r2c(t,0,g)};for(Array.isArray(e[v])&&"count"!==I&&(P=e[v],N="avg"===I,F=l[I]),r=B(w.start),k=B(w.end)+(r-o.tickIncrement(r,w.size,!1,g))/1e6;r=0&&Aq;r--)if(d[r]){G=r;break}for(r=q;r<=G;r++)i(f[r])&&i(d[r])&&H.push({p:f[r],s:d[r],b:0});return s(H,e),H}}},{"../../lib":724,"../../plots/cartesian/axes":764,"../bar/arrays_to_calcdata":851,"./average":962,"./bin_functions":964,"./clean_bins":966,"./norm_functions":969,"fast-isnumeric":129}],966:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",u=t[l];u||(u=t[l]={});var c="date"===a?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return n(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h="date"===a?o:1,f=u.size;if(n(f))u.size=f>0?Number(f):h;else if("string"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(u.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":704,"../../lib":724,"fast-isnumeric":129}],967:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,n){return i.coerce(t,e,u,r,n)}var f=h("x"),d=h("y");h("cumulative.enabled")&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var p=h("orientation",d&&!f?"h":"v"),m=e["v"===p?"x":"y"];if(!m||!m.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],c),e["h"===p?"x":"y"]&&h("histfunc"),o(t,e,h,"h"===p?["y"]:["x"]),s(t,e,h,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":602,"../../components/errorbars/defaults":631,"../../lib":724,"../../registry":842,"../bar/style_defaults":863,"./attributes":961,"./bin_defaults":963}],968:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":774,"../bar/hover":855,"../bar/layout_attributes":857,"../bar/layout_defaults":858,"../bar/plot":859,"../bar/set_positions":860,"../bar/style":862,"../scatter/colorbar":1028,"./attributes":961,"./calc":965,"./defaults":967}],969:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;ik&&m.splice(k,m.length-k),g.length>k&&g.splice(k,g.length-k),!e.autobinx&&e.xbins&&null!==e.xbins.start&&null!==e.xbins.end||(e.xbins=i.autoBin(m,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(i.tickIncrement(x(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(x(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins,e._input.autobinx=e.autobinx),!e.autobiny&&e.ybins&&null!==e.ybins.start&&null!==e.ybins.end||(e.ybins=i.autoBin(g,v,e.nbinsy,"2d",b),"histogram2dcontour"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,b)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,b))),e._input.ybins=e.ybins, -e._input.autobiny=e.autobiny),f=[];var A,T,S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,z=L?[]:e.xbins,I=C?[]:e.ybins,D=0,P=[],O=e.histnorm,R=e.histfunc,F=-1!==O.indexOf("density"),j="max"===R||"min"===R,N=j?null:0,B=a.count,U=o[O],V=!1,H=[],q=[],G="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";G&&"count"!==R&&(V="avg"===R,B=a[R]);var Y=e.xbins,X=x(Y.start),W=x(Y.end)+(X-i.tickIncrement(X,Y.size,!1,y))/1e6;for(d=X;d=0&&A=0&&T0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":742,"alpha-shape":41,"convex-hull":101,"delaunay-triangulate":121,"gl-mesh3d":203,tinycolor2:532}],982:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);if(!c)return void(e.visible=!1);h&&h.forEach(function(t){for(var e=0;eo?a=!0:e1)){var h=s.simpleMap(c.x,e.d2c,0,r.xcalendar),f=s.distinctVals(h).minDiff;a=Math.min(a,f)}}for(a===1/0&&(a=1),u=0;u");w.push(o,o,o,o,o,o,null)}(C,p[C],m[C],v[C],g[C]));e.x=x,e.y=_,e.text=w}},{"../../lib":724,"../../plots/cartesian/axes":764,"../../plots/cartesian/axis_ids":767,"./helpers":987,"fast-isnumeric":129}],991:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend").extendDeep,u=t("../../lib/extend").extendFlat;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},labelfont:u({},s,{}),tickfont:u({},s,{}),rangefont:u({},s,{}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string"},tickvals:o.tickvals,ticktext:o.ticktext,tickformat:{valType:"string",dflt:"3s"},visible:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},constraintrange:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},values:{valType:"data_array",dflt:[]}},line:u({},l({},n("line"),{colorscale:l({},n("line").colorscale,{dflt:a.Viridis}),autocolorscale:l({},n("line").autocolorscale,{dflt:!1})}),{showscale:{valType:"boolean",dflt:!1},colorbar:i})}},{"../../components/colorbar/attributes":603,"../../components/colorscale/color_attributes":609,"../../components/colorscale/scales":620,"../../lib/extend":715,"../../plots/cartesian/layout_attributes":775,"../../plots/font_attributes":788}],992:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("./plot"),o=t("../../constants/xmlns_namespaces"),s=t("./constants");r.name="parcoords",r.attr="type",r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){function e(e){var n=this,i=n.toDataURL("image/png"),a=r.append("svg:image"),l=t._fullLayout._size,u=t._fullData[e.model.key].domain;a.attr({xmlns:o.svg,"xlink:href":i,x:l.l+l.w*u.x[0]-s.overdrag,y:l.t+l.h*(1-u.y[1]),width:(u.x[1]-u.x[0])*l.w+2*s.overdrag,height:(u.y[1]-u.y[0])*l.h,preserveAspectRatio:"none"})}var r=t._fullLayout._glimages,i=n.selectAll(".svg-container");i.filter(function(t,e){return e===i.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus").each(e),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":706,"../../plots/plots":827,"./constants":995,"./plot":1e3,d3:120}],993:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib");e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),o=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),s=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,"line")&&i(e,e.line.color,"line","c"),[{lineColor:o,cscale:s}]}},{"../../components/colorscale/calc":608,"../../components/colorscale/has_colorscale":615,"../../lib":724}],994:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.line,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":605,"../../components/colorscale":616,"../../lib":724,"../../plots/plots":827,"fast-isnumeric":129}],995:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0}}},{}],996:[function(t,e,r){"use strict";function n(t,e,r,n,i){i("line.color",r),s(t,"line")&&a.isArray(t.line.color)?(i("line.colorscale"),l(t,e,n,i,{prefix:"line.",cLetter:"c"})):i("line.color",r)}function i(t,e){function r(t,e){return a.coerce(n,i,o.dimensions,t,e)}var n,i,s,l=t.dimensions||[],c=e.dimensions=[],h=1/0;for(l.length>u&&(a.log("parcoords traces support up to "+u+" dimensions at the moment"),l.splice(u)),s=0;s0);d&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),h=Math.min(h,i.values.length)),i._index=s,c.push(i)}if(isFinite(h))for(s=0;sh&&(i.values=i.values.slice(0,h));return c}var a=t("../../lib"),o=t("./attributes"),s=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/defaults"),u=t("./constants").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}var u=i(t,e);n(t,e,r,s,l),l("domain.x"),l("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var c={family:s.font.family,size:Math.round(s.font.size*(10/12)),color:s.font.color};a.coerceFont(l,"labelfont",c),a.coerceFont(l,"tickfont",c),a.coerceFont(l,"rangefont",c)}},{"../../components/colorscale/defaults":611,"../../components/colorscale/has_colorscale":615,"../../lib":724,"./attributes":991,"./constants":995}],997:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","noOpacity"],n.meta={},e.exports=n},{"./attributes":991,"./base_plot":992,"./calc":993,"./colorbar":994,"./defaults":996,"./plot":1e3}],998:[function(t,e,r){"use strict";function n(t){t.read({x:0,y:0,width:1,height:1,data:x})}function i(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function a(t,e,r,a,o,s){function l(n){var c;c=Math.min(a,o-n*a),s.offset=g*n*a,s.count=g*c,0===n&&(window.cancelAnimationFrame(r.currentRafs[u]),delete r.currentRafs[u],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),n*a+c>>8*e)%256/255}function u(t,e,r,n){for(var i=[],a=0;a=v-4?l(a,v-2-s):.5);return i}function c(t,e,r){var n,i,a,o=[];for(i=0;if&&(f=t[l].dim2.canvasX,c=l),t[l].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function l(t,e,r){var n=o(r);return r.tickvals?_.scale.ordinal().domain(r.tickvals).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):_.scale.linear().domain(n).range([t-e,e])}function u(t,e){return _.scale.linear().range([t-e,e])}function c(t){return _.scale.linear().domain(o(t))}function h(t){var e=o(t);return t.tickvals&&_.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function f(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}),n=r.map(function(t){return _.rgb(t)}),i=function(t){return function(e){return e[t]}},a="rgb".split("").map(function(t){return _.scale.linear().clamp(!0).domain(e).range(n.map(i(t)))});return function(t){return a.map(function(e){return e(t)})}}function d(t){return t[0]}function p(t,e,r){var n=d(e),i=n.trace,o=n.lineColor,s=n.cscale,l=i.line,u=i.domain,h=i.dimensions,p=t.width,m=i.labelfont,v=i.tickfont,g=i.rangefont,y=x.extendDeep({},l,{color:o.map(c({values:o,range:[l.cmin,l.cmax]})),blockLineCount:b.blockLineCount,canvasOverdrag:b.overdrag*b.canvasPixelRatio}),_=Math.floor(p*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w;return{key:r,colCount:h.filter(a).length,dimensions:h,tickDistance:b.tickDistance,unitToColor:f(s),lines:y,labelFont:m,tickFont:v,rangeFont:g,translateX:u.x[0]*p,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*b.canvasPixelRatio+2*y.canvasOverdrag,canvasHeight:A*b.canvasPixelRatio,width:k,height:A,canvasPixelRatio:b.canvasPixelRatio}}function m(t){var e=t.width,r=t.height,n=t.dimensions,i=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},s=b.verticalPadding/(r*i),f=1-2*s,d=function(t){return s+f*t},p={key:t.key,xScale:o,model:t},m={};return p.dimensions=n.filter(a).map(function(e,n){var a=c(e),s=m[e.label];return m[e.label]=(s||0)+1,{key:e.label+(s?"__"+s:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:b.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(d),xScale:o,x:o(n),canvasX:o(n)*i,unitScale:u(r,b.verticalPadding),domainScale:l(r,b.verticalPadding,e),ordinalScale:h(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function v(t){return b.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function g(t){t.classed("axisExtentText",!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var y=t("./lines"),b=t("./constants"),x=t("../../lib"),_=t("d3"),w=t("../../components/drawing");e.exports=function(t,e,r,a,o){function l(t){var e=t.selectAll("defs").data(i,n);e.enter().append("defs");var r=e.selectAll("#filterBarPattern").data(i,n);r.enter().append("pattern").attr("id","filterBarPattern").attr("patternUnits","userSpaceOnUse"),r.attr("x",-b.bar.width).attr("width",b.bar.capturewidth).attr("height",function(t){return t.model.height});var a=r.selectAll("rect").data(i,n);a.enter().append("rect").attr("shape-rendering","crispEdges"),a.attr("height",function(t){return t.model.height}).attr("width",b.bar.width).attr("x",b.bar.width/2).attr("fill",b.bar.fillcolor).attr("fill-opacity",b.bar.fillopacity).attr("stroke",b.bar.strokecolor).attr("stroke-opacity",b.bar.strokeopacity).attr("stroke-width",b.bar.strokewidth)}function u(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function c(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=0;a<1;a++)for(var o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,h={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==I&&(u?o.hover(h):o.unhover&&o.unhover(h),I=c)}}),C.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*b.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var D=e.selectAll(".parcoords").data(E,n);D.exit().remove(),D.enter().append("g").classed("parcoords",!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(l),D.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var P=D.selectAll(".parcoordsControlView").data(i,n);P.enter().append("g").classed("parcoordsControlView",!0).style("box-sizing","content-box"),P.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var O=P.selectAll(".yAxis").data(function(t){return t.dimensions},n);O.enter().append("g").classed("yAxis",!0).each(function(t){z.dimensions.push(t)}),P.each(function(t){f(O,t)}),C.each(function(t){t.lineLayer=y(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,b.scatter),t.viewModel[t.key]=t.lineLayer,z.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),O.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),O.call(_.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;S=!1,T||(t.x=Math.max(-b.overdrag,Math.min(t.model.width+b.overdrag,_.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,O.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),f(O,e),O.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),_.select(this).attr("transform","translate("+t.x+", 0)"),O.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;if(T)return void("ending"===T&&(T=!1));t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,f(O,e),_.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),S=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),O.exit().remove();var R=O.selectAll(".axisOverlays").data(i,n);R.enter().append("g").classed("axisOverlays",!0),R.selectAll(".axis").remove();var F=R.selectAll(".axis").data(i,n);F.enter().append("g").classed("axis",!0),F.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain(),i=t.ticktext;_.select(this).call(_.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n.map(function(t,e){return i&&i[e]||t}):null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),w.font(F.selectAll("text"),t.model.tickFont)}),F.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),F.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=R.selectAll(".axisHeading").data(i,n);j.enter().append("g").classed("axisHeading",!0);var N=j.selectAll(".axisTitle").data(i,n);N.enter().append("text").classed("axisTitle",!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),N.attr("transform","translate(0,"+-b.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){w.font(N,t.model.labelFont)});var B=R.selectAll(".axisExtent").data(i,n);B.enter().append("g").classed("axisExtent",!0);var U=B.selectAll(".axisExtentTop").data(i,n);U.enter().append("g").classed("axisExtentTop",!0),U.attr("transform","translate(0,"+-b.axisExtentOffset+")");var V=U.selectAll(".axisExtentTopText").data(i,n);V.enter().append("text").classed("axisExtentTopText",!0).attr("alignment-baseline","after-edge").call(g),V.text(function(t){return x(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){w.font(V,t.model.rangeFont)});var H=B.selectAll(".axisExtentBottom").data(i,n);H.enter().append("g").classed("axisExtentBottom",!0),H.attr("transform",function(t){return"translate(0,"+(t.model.height+b.axisExtentOffset)+")"});var q=H.selectAll(".axisExtentBottomText").data(i,n);q.enter().append("text").classed("axisExtentBottomText",!0).attr("alignment-baseline","before-edge").call(g),q.text(function(t){return x(t)(t.domainScale.domain()[0])}).each(function(t){w.font(q,t.model.rangeFont)});var G=R.selectAll(".axisBrush").data(i,n),Y=G.enter().append("g").classed("axisBrush",!0);G.each(function(t){t.brush||(t.brush=_.svg.brush().y(t.unitScale).on("brushstart",M).on("brush",k).on("brushend",A),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),_.select(this).call(t.brush))}),Y.selectAll("rect").attr("x",-b.bar.capturewidth/2).attr("width",b.bar.capturewidth),Y.selectAll("rect.extent").attr("fill","url(#filterBarPattern)").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),Y.selectAll(".resize rect").attr("height",b.bar.handleheight).attr("opacity",0).style("visibility","visible"),Y.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",b.bar.handleoverlap-b.bar.handleheight),Y.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",b.bar.handleoverlap);var X=!1,W=!1;return z}},{"../../components/drawing":626,"../../lib":724,"./constants":995,"./lines":998,d3:120}],1e3:[function(t,e,r){"use strict";var n=t("./parcoords");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,a=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var u=function(e,r,n){var i=s[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},c=function(e){t.emit("plotly_hover",e)},h=function(e){t.emit("plotly_unhover",e)},f=function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(s[e].filter(n));o[e].sort(a),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")};n(a,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:u,hover:c,unhover:h,axesMoved:f})}},{"./parcoords":999}],1001:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},hovertext:{valType:"string",dflt:"",arrayOk:!0},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:o({},i,{}),insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":601,"../../lib/extend":715,"../../plots/attributes":762,"../../plots/font_attributes":788}],1002:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}return m};var l},{"../../components/color":602,"./helpers":1005,"fast-isnumeric":129,tinycolor2:532}],1004:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=o("labels");Array.isArray(u)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var c=o("marker.colors");Array.isArray(c)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),f=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hovertext"),f&&"none"!==f){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,v=p||"outside"===d;if(m||v){var g=s(o,"textfont",a.font);m&&s(o,"insidetextfont",g),v&&s(o,"outsidetextfont",g)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":724,"./attributes":1001}],1005:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":724}],1006:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":1001,"./base_plot":1002,"./calc":1003,"./defaults":1004,"./layout_attributes":1007,"./layout_defaults":1008,"./plot":1009,"./style":1010,"./style_one":1011}],1007:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],1008:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){!function(r,a){n.coerce(t,e,i,r,a)}("hiddenlabels")}},{"../../lib":724,"./layout_attributes":1007}],1009:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},g=v.scale>f.scale?v:f;return u.scale<1&&g.scale>u.scale?g:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var i,a,o,s,l,u,c,h,f,d,p,m,v;for(a=0;a<2;a++)for(o=a?r:n,l=a?Math.max:Math.min,c=a?1:-1,i=0;i<2;i++){for(s=i?Math.max:Math.min,u=i?1:-1,h=t[a][i],h.sort(o),f=t[1-a][i],d=f.concat(h),m=[],p=0;p0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*c>0?(h=o.cyFinal+l(o.px0[1],o.px1[1]),(b=h-v-t.labelExtraY)*c>0&&(t.labelExtraY+=b)):(g+t.labelExtraY-y)*c>0&&(n=3*u*Math.abs(i-d.indexOf(t)),f=o.cxFinal+s(o.px0[0],o.px1[0]),(p=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*u>0&&(t.labelExtraX+=p)))}(m[p],g)}}}function s(t,e){var r,n,i,a,o,s,l,c,h,f,d=[];for(i=0;ic&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===d.indexOf(s.scalegroup)&&d.push(s.scalegroup)}for(a=0;ah.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t("d3"),h=t("../../components/fx"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],v=u.trace,g=(v.depth||0)*u.r*Math.sin(0)/2,y=v.tiltaxis||0,b=y*Math.PI/180,x=[g*Math.sin(b),g*Math.cos(b)],_=u.r*Math.cos(0),w=s.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],g=!1;s.each(function(e){function o(n){n.originalEvent=c.event;var a=t._fullLayout,o=t._fullData[v.index],s=h.castHoverinfo(o,a,e.i);if("all"===s&&(s="label+text+value+percent+name"),t._dragging||!1===a.hovermode||"none"===s||"skip"===s||!s)return void h.hover(t,n,"pie");var l=i(e,u),f=w+e.pxmid[0]*(1-l),d=M+e.pxmid[1]*(1-l),p=r.separators,g=[];-1!==s.indexOf("label")&&g.push(e.label),-1!==s.indexOf("text")&&(o.hovertext?g.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&g.push(o.text[e.i])),-1!==s.indexOf("value")&&g.push(m.formatPieValue(e.v,p)),-1!==s.indexOf("percent")&&g.push(m.formatPiePercent(e.v/u.vTotal,p)),h.loneHover({x0:f-l*u.r,x1:f+l*u.r,y:d,text:g.join("
"),name:-1!==s.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:h.castHoverOption(v,e.i,"bordercolor"),fontFamily:h.castHoverOption(v,e.i,"font.family"),fontSize:h.castHoverOption(v,e.i,"font.size"),fontColor:h.castHoverOption(v,e.i,"font.color")},{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:t}),h.hover(t,n,"pie"),T=!0}function s(e){e.originalEvent=c.event,t.emit("plotly_unhover",{event:c.event,points:[e]}),T&&(h.loneUnhover(r._hoverlayer.node()),T=!1)}function f(){t._hoverdata=[e],t._hoverdata.trace=u.trace,h.click(t,c.event)}function b(t,r,n,i){return"a"+i*u.r+","+i*_+" "+y+" "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)return void c.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,l[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=u.cx+x[0],M=u.cy+x[1],k=c.select(this),A=k.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",o).on("mouseout",s).on("click",f),v.pull){var S=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;S>0&&(w+=S*e.pxmid[0],M+=S*e.pxmid[1])}e.cxFinal=w,e.cyFinal=M;var E=v.hole;if(e.v===u.vTotal){var L="M"+(w+e.px0[0])+","+(M+e.px0[1])+b(e.px0,e.pxmid,!0,1)+b(e.pxmid,e.px0,!0,1)+"Z";E?A.attr("d","M"+(w+E*e.px0[0])+","+(M+E*e.px0[1])+b(e.px0,e.pxmid,!1,E)+b(e.pxmid,e.px0,!1,E)+"Z"+L):A.attr("d",L)}else{var C=b(e.px0,e.px1,!0,1);if(E){var z=1-E;A.attr("d","M"+(w+E*e.px1[0])+","+(M+E*e.px1[1])+b(e.px1,e.px0,!1,E)+"l"+z*e.px0[0]+","+z*e.px0[1]+C+"Z")}else A.attr("d","M"+w+","+M+"l"+e.px0[0]+","+e.px0[1]+C+"Z")}var I=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,D=k.selectAll("g.slicetext").data(e.text&&"none"!==I?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each(function(){var r=c.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,"outside"===I?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans,t);var i,o=d.bBox(r.node());"outside"===I?i=a(o,e):(i=n(o,e,u),"auto"===I&&i.scale<1&&(r.call(d.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(o=d.bBox(r.node())),i=a(o,e)));var s=w+e.pxmid[0]*i.rCenter+(i.x||0),l=M+e.pxmid[1]*i.rCenter+(i.y||0);i.outside&&(e.yLabelMin=l-o.height/2,e.yLabelMid=l,e.yLabelMax=l+o.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+s+","+l+")"+(i.scale<1?"scale("+i.scale+")":"")+(i.rotate?"rotate("+i.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),g&&o(l,v),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(s)>Math.abs(l)?a+="l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):a+="l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":602,"../../components/drawing":626,"../../components/fx":643,"../../lib/svg_text_utils":743,"./helpers":1005,d3:120}],1010:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":1011,d3:120}],1011:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({"stroke-width":a}).call(n.fill,e.color).call(n.stroke,i)}},{"../../components/color":602}],1012:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array"},indices:{valType:"data_array"},xbounds:{valType:"data_array"},ybounds:{valType:"data_array"},text:n.text,marker:{color:{valType:"color",arrayOk:!1},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1},blend:{valType:"boolean",dflt:null},sizemin:{valType:"number",min:.1,max:2,dflt:.5},sizemax:{valType:"number",min:.1,dflt:20},border:{color:{valType:"color",arrayOk:!1},arearatio:{valType:"number",min:0,max:1,dflt:0}}}}},{"../scattergl/attributes":1069}],1013:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r} -var a=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);if(f)r=f;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),v=t.opacity*t.marker.opacity;p[3]*=v,this.pointcloudOptions.color=p;var g=t.marker.blend;if(null===g){g=l.length<100||u.length<100}this.pointcloudOptions.blend=g,m[3]*=v,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},u.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},u.dispose=function(){this.pointcloud.dispose()},e.exports=i},{"../../lib/str2rgbarray":742,"../scatter/get_trace_color":1033,"gl-pointcloud2d":228}],1014:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":724,"./attributes":1012}],1015:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":804,"../scatter3d/calc":1049,"./attributes":1012,"./convert":1013,"./defaults":1014}],1016:[function(t,e,r){"use strict";var n=t("../../components/shapes/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../components/color/attributes"),s=t("../../lib/extend").extendFlat;e.exports={hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:i,node:{label:{valType:"data_array",dflt:[]},color:s({},n.fillcolor,{arrayOk:!0}),line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:s({},n.fillcolor,{arrayOk:!0}),line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}}},{"../../components/color/attributes":601,"../../components/shapes/attributes":678,"../../lib/extend":715,"../../plots/attributes":762,"../../plots/font_attributes":788}],1017:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("./plot");r.name="sankey",r.attr="type",r.plot=function(t){var e=n.getSubplotCalcData(t.calcdata,"sankey","sankey");e.length&&i(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../plots/plots":827,"./plot":1022}],1018:[function(t,e,r){"use strict";function n(t,e,r){for(var n=t.map(function(){return[]}),a=0;a1})}var i=t("strongly-connected-components"),a=t("../../lib");e.exports=function(t,e){return n(e.node.label,e.link.source,e.link.target)&&(a.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),[{link:e.link,node:e.node}]}},{"../../lib":724,"strongly-connected-components":526}],1019:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out"}},{}],1020:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,i,r,a)}u("node.label"),u("node.pad"),u("node.thickness"),u("node.line.color"),u("node.line.width");var c=function(t){return a[t%a.length]};u("node.color",e.node.label.map(function(t,e){return o.addOpacity(c(e),.8)})),u("link.label"),u("link.source"),u("link.target"),u("link.value"),u("link.line.color"),u("link.line.width"),u("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),u("domain.x"),u("domain.y"),u("orientation"),u("valueformat"),u("valuesuffix"),u("arrangement"),n.coerceFont(u,"textfont",n.extendFlat({},l.font));var h=function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)};e.node.label.some(h)&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":602,"../../components/color/attributes":601,"../../lib":724,"./attributes":1016,tinycolor2:532}],1021:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1016,"./base_plot":1017,"./calc":1018,"./defaults":1020,"./plot":1022}],1022:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function u(t,e,r){e&&r&&i(r,e).selectAll(".sankeyLink").filter(s(e)).call(h.bind(0,e,r,!1))}function c(t,e,r){e&&r&&i(r,e).selectAll(".sankeyLink").filter(s(e)).call(f.bind(0,e,r,!1))}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll(".sankeyLink").filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll(".sankeyNode").filter(l(t)).call(u)}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll(".sankeyLink").filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(".sankeyNode").filter(l(t)).call(c)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),v=t("../../components/fx"),g=t("../../components/color"),y=t("../../lib");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=function(e,r){var n=r.link;n.originalEvent=p.event,t._hoverdata=[n],v.click(t,{target:!0})},y=function(e,r,n){var i=r.link;i.originalEvent=p.event,p.select(e).call(h.bind(0,r,n,!0)),v.hover(t,i,"sankey")},b=function(e,i){var s=i.link.trace,l=t.getBoundingClientRect(),u=e.getBoundingClientRect(),c=u.left+u.width/2,h=u.top+u.height/2,f=v.loneHover({x:c-l.left,y:h-l.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label,["Source:",i.link.source.label].join(" "),["Target:",i.link.target.label].join(" ")].filter(n).join("
"),color:d(s,"bgcolor")||g.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(g,.85),o(g)},k=function(e,n,i){p.select(e).call(c,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),v.loneUnhover(r._hoverlayer.node())};m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:y,follow:b,unhover:x,select:l},nodeEvents:{hover:w,follow:M,unhover:k,select:_}})}},{"../../components/color":602,"../../components/fx":643,"../../lib":724,"./render":1023,d3:120}],1023:[function(t,e,r){"use strict";function n(t){return t.key}function i(t){return[t]}function a(t){return t[0]}function o(t){var e,r=[];for(e=0;e1||t.linkLineWidth>0}function _(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function w(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function M(t){return P.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+D.nodeTextOffsetHorizontal:D.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-D.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-D.nodeTextOffsetHorizontal,0]])}function k(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function A(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function T(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function S(t){return t.horizontal&&t.left?"100%":"0%"}function E(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function L(t,e,r){var n=P.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(n){if("fixed"!==n.arrangement&&(this.parentNode.appendChild(this),n.interactionState.dragInProgress=n.node,s(n.node),n.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,n.interactionState.hovered),n.interactionState.hovered=!1),"snap"===n.arrangement)){var i=n.traceId+"|"+Math.floor(n.node.originalX);n.forceLayouts[i]?n.forceLayouts[i].alpha(1):C(t,i,n),z(t,e,n,i)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=P.event.x,i=P.event.y;"snap"===r.arrangement?(r.node.x=n,r.node.y=i):("freeform"===r.arrangement&&(r.node.x=n),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,i))),s(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),y(t.filter(l(r)),e),t.call(p))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(n)}function C(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=N.forceSimulation(n).alphaDecay(0).force("collide",N.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(D.forceIterations)).force("constrain",I(t,e,n,r)).stop()}function z(t,e,r,n){window.requestAnimationFrame(function i(){for(var a=0;a0&&window.requestAnimationFrame(i)})}function I(t,e,r,n){return function(){for(var i=0,a=0;a0&&(n.forceLayouts[e].alpha(0),window.setTimeout(function(){t.call(p)},30))}}var D=t("./constants"),P=t("d3"),O=t("tinycolor2"),R=t("../../components/color"),F=t("../../components/drawing"),j=t("@plotly/d3-sankey").sankey,N=t("d3-force"),B=t("../../lib");e.exports=function(t,e,r,s){var l=t.selectAll(".sankey").data(e.filter(function(t){return a(t).trace.visible}).map(h.bind(null,r)),n);l.exit().remove(),l.enter().append("g").classed("sankey",!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").style("box-sizing","content-box").attr("transform",_),l.transition().ease(D.ease).duration(D.duration).attr("transform",_);var u=l.selectAll(".sankeyLinks").data(i,n);u.enter().append("g").classed("sankeyLinks",!0).style("fill","none");var c=u.selectAll(".sankeyLink").data(function(t){var e={};return t.sankey.links().filter(function(t){return t.value}).map(f.bind(null,e,t))},n);c.enter().append("path").classed("sankeyLink",!0).attr("d",v).call(E,l,s.linkEvents),c.style("stroke",function(t){return x(t)?R.tinyRGB(O(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return x(t)?R.opacity(t.linkLineColor):t.tinyColorAlpha}).style("stroke-width",function(t){return x(t)?t.linkLineWidth:1}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),c.transition().ease(D.ease).duration(D.duration).attr("d",v),c.exit().transition().ease(D.ease).duration(D.duration).style("opacity",0).remove();var p=l.selectAll(".sankeyNodeSet").data(i,n);p.enter().append("g").style("shape-rendering","geometricPrecision").classed("sankeyNodeSet",!0),p.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var g=p.selectAll(".sankeyNode").data(function(t){var e=t.sankey.nodes(),r={};return o(e),e.filter(function(t){return t.value}).map(d.bind(null,r,t))},n);g.enter().append("g").classed("sankeyNode",!0).call(m).call(E,l,s.nodeEvents),g.call(L,c,s),g.transition().ease(D.ease).duration(D.duration).call(m),g.exit().transition().ease(D.ease).duration(D.duration).style("opacity",0).remove();var y=g.selectAll(".nodeRect").data(i);y.enter().append("rect").classed("nodeRect",!0).call(b),y.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return R.tinyRGB(O(t.nodeLineColor))}).style("stroke-opacity",function(t){return R.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),y.transition().ease(D.ease).duration(D.duration).call(b);var C=g.selectAll(".nodeCapture").data(i);C.enter().append("rect").classed("nodeCapture",!0).style("fill-opacity",0),C.attr("x",function(t){return t.zoneX}).attr("y",function(t){return t.zoneY}).attr("width",function(t){return t.zoneWidth}).attr("height",function(t){return t.zoneHeight});var z=g.selectAll(".nodeCentered").data(i);z.enter().append("g").classed("nodeCentered",!0).attr("transform",w),z.transition().ease(D.ease).duration(D.duration).attr("transform",w);var I=z.selectAll(".nodeLabelGuide").data(i);I.enter().append("path").classed("nodeLabelGuide",!0).attr("id",function(t){return t.uniqueNodeLabelPathId}).attr("d",M).attr("transform",k),I.transition().ease(D.ease).duration(D.duration).attr("d",M).attr("transform",k);var P=z.selectAll(".nodeLabel").data(i);P.enter().append("text").classed("nodeLabel",!0).attr("transform",A).style("user-select","none").style("cursor","default").style("fill","black"),P.style("text-shadow",function(t){return t.horizontal?"-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff":"none"}).each(function(t){F.font(P,t.textFont)}),P.transition().ease(D.ease).duration(D.duration).attr("transform",A);var j=P.selectAll(".nodeLabelTextPath").data(i);j.enter().append("textPath").classed("nodeLabelTextPath",!0).attr("alignment-baseline","middle").attr("xlink:href",function(t){return"#"+t.uniqueNodeLabelPathId}).attr("startOffset",S).style("fill",T),j.text(function(t){return t.horizontal||t.node.dy>5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),j.transition().ease(D.ease).duration(D.duration).attr("startOffset",S).style("fill",T)}},{"../../components/color":602,"../../components/drawing":626,"../../lib":724,"./constants":1019,"@plotly/d3-sankey":36,d3:120,"d3-force":116,tinycolor2:532}],1024:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rm&&d.splice(m,d.length-m),p.length>m&&p.splice(m,p.length-m);var v={padded:!0},g={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var y={type:"linear"};i.setConvert(y),u=y.makeCalcdata(e.marker,"size"),u.length>m&&u.splice(m,u.length-m)}var b,x=1.6*(e.marker.sizeref||1);b="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},v.ppad=g.ppad=Array.isArray(u)?u.map(b):b(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,i.expand(h,d,v),i.expand(f,p,g);var _=new Array(m);for(c=0;c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1028:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":605,"../../components/colorscale":616,"../../lib":724,"../../plots/plots":827,"fast-isnumeric":129}],1029:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":608,"../../components/colorscale/has_colorscale":615,"./subtypes":1045}],1030:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],1031:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var v=s(t,e,p,m),g=vV!=P>=V&&(z=L[S-1][0],I=L[S][0],C=z+(I-z)*(V-D)/(P-D),j=Math.min(j,C),N=Math.max(N,C));j=Math.max(j,0),N=Math.min(N,f._length);var H=s.defaultLine;return s.opacity(h.fillcolor)?H=h.fillcolor:s.opacity((h.line||{}).color)&&(H=h.line.color),n.extendFlat(t,{distance:l+10,x0:j,x1:N,y0:V,y1:V,color:H}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":602,"../../components/errorbars":632,"../../components/fx":643,"../../lib":724,"./get_trace_color":1033}],1035:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":774,"./arrays_to_calcdata":1024,"./attributes":1025,"./calc":1026,"./clean_data":1027,"./colorbar":1028,"./defaults":1031,"./hover":1034,"./plot":1042,"./select":1043,"./style":1044,"./subtypes":1045}],1036:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":611,"../../components/colorscale/has_colorscale":615}],1037:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=_.c2p(t[e].x),i=w.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function i(t){var e=t[0]/_._length,r=t[1]/w._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*A}var a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_=e.xaxis,w=e.yaxis,M=e.simplify,k=e.connectGaps,A=e.baseTolerance,T=e.linear,S=[],E=.2,L=new Array(t.length),C=0;for(M||(A=E=-1),a=0;ai(c))break;s=c,g=p[0]*d[0]+p[1]*d[1],g>m?(m=g,l=c,f=!1):g=t.length||!c)break;L[C++]=c,o=c}}else L[C++]=l}S.push(L.slice(0,C))}return S}},{"../../constants/numerical":704}],1038:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1039:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":129}],1041:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,h=o.isBubble(t),f=(t.line||{}).color;if(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",h?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=f&&!Array.isArray(f)&&e.marker.color!==f?f:h?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",h?1:0)),h&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":602,"../../components/colorscale/defaults":611,"../../components/colorscale/has_colorscale":615,"./subtypes":1045}],1042:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),n._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function y(t){if(t.ids)return g}function b(){return!1}function x(e){var n,i,a,u=e[0].trace,h=o.select(this),f=c.hasMarkers(u),d=c.hasText(u),p=y(u),g=b,x=b;f&&(g=u.marker.maxdisplayed||u._needsCull?v:s.identity),d&&(x=u.marker.maxdisplayed||u._needsCull?v:s.identity),i=h.selectAll("path.point"),n=i.data(g,p);var _=n.enter().append("path").classed("point",!0);M&&_.call(l.pointStyle,u,t).call(l.translatePoints,k,A).style("opacity",0).transition().style("opacity",1);var w=f&&l.tryColorscale(u.marker,""),T=f&&l.tryColorscale(u.marker,"line");n.order(),n.each(function(e){var n=o.select(this),i=m(n);a=l.translatePoint(e,i,k,A),a?(l.singlePointStyle(e,i,u,w,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,k,A),u.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?n.exit().transition().style("opacity",0).remove():n.exit().remove(),i=h.selectAll("g"),n=i.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=m(e.select("text"));a=l.translatePoint(t,n,k,A),a?r.layerClipId&&l.hideOutsideRangePoint(t,e,k,A):e.remove()}),n.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=k.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,k=r.xaxis,A=r.yaxis,T=n[0].trace,S=T.line,E=o.select(f);if(E.call(u.plot,r,p),!0===T.visible){m(E).style("opacity",T.opacity);var L,C,z=T.fill.charAt(T.fill.length-1);"x"!==z&&"y"!==z&&(z=""),n[0].node3=E;var I="",D=[],P=T._prevtrace;P&&(I=P._prevRevpath||"",C=P._nextFill,D=P._polygons);var O,R,F,j,N,B,U,V,H,q="",G="",Y=[],X=[],W=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(S.shape)?(F=l.steps(S.shape),j=l.steps(S.shape.split("").reverse().join(""))):F=j="spline"===S.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return j(t.reverse())},Y=h(n,{xaxis:k,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,linear:"linear"===S.shape,simplify:S.simplify}),H=T._polygons=new Array(Y.length),w=0;w1}),W=function(t){return function(e){if(O=F(e),R=N(e),q?z?(q+="L"+O.substr(1),G=R+"L"+G.substr(1)):(q+="Z"+O,G=R+"Z"+G):(q=O,G=R),c.hasLines(T)&&e.length>1){var r=o.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",O),l.singleLineStyle(n,i)}}}}}var Z=E.selectAll(".js-line").data(X);m(Z.exit()).style("opacity",0).remove(),Z.each(W(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Z,r.layerClipId),Y.length&&(L?B&&V&&(z?("y"===z?B[1]=V[1]=A.c2p(0,!0):"x"===z&&(B[0]=V[0]=k.c2p(0,!0)),m(L).attr("d","M"+V+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):m(L).attr("d",q+"Z").call(l.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&q&&I&&("tonext"===T.fill?m(C).attr("d",q+"Z"+I+"Z").call(l.singleFillStyle):m(C).attr("d",q+"L"+I.substr(1)+"Z").call(l.singleFillStyle),T._polygons=T._polygons.concat(D)),T._prevRevpath=G,T._prevPolygons=H);var J=E.selectAll(".points");_=J.data([n]),J.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),h=o.extent(s.simpleMap(l.range,l.r2c)),f=n[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),v=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(c=p.selectAll("g.trace"),h=c.data(r,function(t){return t[0].trace.uid}),h.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),f(t,e,r),n(t,p,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),v){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});m&&h.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":626,"../../components/errorbars":632,"../../lib":724,"../../lib/polygon":734,"./line_points":1037,"./link_traces":1039,"./subtypes":1045,d3:120}],1043:[function(t,e,r){"use strict";var n=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,d=f.marker,p=!n.hasMarkers(f)&&!n.hasText(f);if(!0===f.visible&&!p){var m=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=v(f),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},A.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":701,"../../constants/gl3d_markers":702,"../../lib":724,"../../lib/gl_format_color":721,"../../lib/str2rgbarray":742,"../scatter/make_bubble_size_func":1040,"./calc_errors":1050,"delaunay-triangulate":121,"gl-error3d":159,"gl-line3d":170,"gl-mesh3d":203,"gl-scatter3d":249}],1052:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a=0&&f("surfacecolor",d||p);for(var m=["x","y","z"],v=0;v<3;++v){var g="projection."+m[v];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":631,"../../lib":724,"../../registry":842,"../scatter/line_defaults":1036,"../scatter/marker_defaults":1041,"../scatter/subtypes":1045,"../scatter/text_defaults":1046,"./attributes":1048}],1053:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":702,"../../plots/gl3d":807,"../scatter/colorbar":1028,"./attributes":1048,"./calc":1049,"./convert":1051,"./defaults":1052}],1054:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:"string"},a:{valType:"data_array"},b:{valType:"data_array"},sum:{valType:"number",dflt:0,min:0},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({},{symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({},{width:c.width},a("marker".line)),gradient:l.gradient},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":603,"../../components/colorscale/color_attributes":609,"../../lib/extend":715,"../../plots/attributes":762,"../scatter/attributes":1025}],1055:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,h,f=e.a.length,d=new Array(f),p=!1;for(u=0;uf&&y.splice(f,y.length-f)}return o(e),s(d,e),d}}},{"../../plots/cartesian/axes":764,"../carpet/lookup_carpetid":898,"../scatter/arrays_to_calcdata":1024,"../scatter/colorscale_calc":1029,"../scatter/subtypes":1045,"fast-isnumeric":129}],1056:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),v=d("b");if(!(p=Math.min(m.length,v.length)))return void(e.visible=!1);m&&p0?t.labelprefix:t._hovertitle+": ")+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,h=u-c;return s.x0=Math.max(Math.min(s.x0,h),c),s.x1=Math.max(Math.min(s.x1,h),c),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=d.hoverinfo.split("+"),v=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,f.a),-1!==m.indexOf("b")&&a(p.baxis,f.b);var g=p.ab2ij([f.a,f.b]),y=Math.floor(g[0]),b=g[0]-y,x=Math.floor(g[1]),_=g[1]-x,w=p.evalxy([],y,x,b,_);return v.push("y: "+w[1].toFixed(3)),s.extraText=v.join("
"),o}}},{"../scatter/hover":1034}],1058:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":774,"../scatter/colorbar":1028,"./attributes":1054,"./calc":1055,"./defaults":1056,"./hover":1057,"./plot":1059,"./select":1060,"./style":1061}],1059:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,u=r[0][0].carpet,c={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,c,r),o=0;o")}var i=t("../../components/fx"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("../scatter/get_trace_color"),l=t("./attributes");e.exports=function(t){function e(t){return h.projection(t)}function r(t){var r=t.lonlat;if(r[0]===o)return 1/0;if(h.isLonLatOverEdges(r))return 1/0;var n=e(r),i=u.c2p(),a=c.c2p(),s=Math.abs(i-n[0]),l=Math.abs(a-n[1]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-f,1-3/f)}var a=t.cd,l=a[0].trace,u=t.xa,c=t.ya,h=t.subplot;if(i.getClosest(a,r,t),!1!==t.index){var f=a[t.index],d=f.lonlat,p=e(d),m=f.mrc||1;return t.x0=p[0]-m,t.x1=p[0]+m,t.y0=p[1]-m,t.y1=p[1]+m,t.loc=f.loc,t.lon=d[0],t.lat=d[1],t.color=s(l,f),t.extraText=n(l,f,h.mockAxis),[t]}}},{"../../components/fx":643,"../../constants/numerical":704,"../../plots/cartesian/axes":764,"../scatter/get_trace_color":1033,"./attributes":1062}],1067:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/geo":792,"../scatter/colorbar":1028,"./attributes":1062,"./calc":1063,"./defaults":1064,"./event_data":1065,"./hover":1066,"./plot":1068}],1068:[function(t,e,r){"use strict";function n(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=c(r,e),i=r.locationmode,a=0;a=e.length?i:e[a]);return n}function o(t,e,r){return l(O(t,r),P(e,r),r)}function s(t,e,r,n){var i=k(t,e,n);return i=Array.isArray(i[0])?i:a(y.identity,[i],n),l(i,P(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;iZ?W-Z:0),!q||H.noBorder||H.noFill?c(this.scatter.options.colors,Y,f,B,G):c(this.scatter.options.colors,I,f,0),c(this.scatter.options.borderColors,X,f,B,G);N?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=k):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,h,j)},D.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r")}var i=t("../../components/fx"),a=t("../scatter/get_trace_color"),o=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){function s(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([p,e[1]])),i=Math.abs(h.c2p(e)-h.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*f,p=e-d;if(i.getClosest(l,s,t),!1!==t.index){var m=l[t.index],v=m.lonlat,g=[v[0]+d,v[1]],y=c.c2p(g),b=h.c2p(g),x=m.mrc||1;return t.x0=y-x,t.x1=y+x,t.y0=b-x,t.y1=b+x,t.color=a(u,m),t.extraText=n(u,m),[t]}}},{"../../components/fx":643,"../../constants/numerical":704,"../scatter/get_trace_color":1033}],1080:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":821,"../scatter/colorbar":1028,"../scattergeo/calc":1063,"./attributes":1075,"./defaults":1077,"./event_data":1078,"./hover":1079,"./plot":1081,"./select":1082}],1081:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":1076}],1082:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace;if(f._hasDimmedPts=!1,!0===f.visible&&n.hasMarkers(f)){if(!1===e)for(s=0;sk&&S.splice(k,S.length-k)}return o(e),s(A,e),A}},{"../../plots/cartesian/axes":764,"../scatter/arrays_to_calcdata":1024,"../scatter/colorscale_calc":1029,"../scatter/subtypes":1045,"fast-isnumeric":129}],1085:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),v=d("b"),g=d("c");if(m?(p=m.length,v?(p=Math.min(p,v.length),g&&(p=Math.min(p,g.length))):p=g?Math.min(p,g.length):0):v&&g&&(p=Math.min(v.length,g.length)),!p)return void(e.visible=!1);m&&p"),s}}},{"../../plots/cartesian/axes":764,"../scatter/hover":1034}],1087:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":835,"../scatter/colorbar":1028,"./attributes":1083,"./calc":1084,"./defaults":1085,"./hover":1086,"./plot":1088,"./select":1089,"./style":1090}],1088:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},a=0;a":return function(t){return f(t)>i};case">=":return function(t){return f(t)>=i};case"[]":return function(t){var e=f(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=f(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=f(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=f(t);return ei[1]};case"](":return function(t){var e=f(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=f(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(f(t))};case"}{":return function(t){return-1===i.indexOf(f(t))}}}var i=t("../lib"),a=t("../registry"),o=t("../plots/cartesian/axes"),s=["=","!=","<",">=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],u=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(u),dflt:"="},value:{valType:"any",dflt:0},preservegaps:{valType:"boolean",dflt:!1}},r.supplyDefaults=function(t){function e(e,a){return i.coerce(t,n,r.attributes,e,a)}var n={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=a.getComponentMethod("calendars","handleDefaults");o(t,n,"valuecalendar",null),o(t,n,"targetcalendar",null)}return n},r.calcTransform=function(t,e,r){function a(t,r){for(var n=0;n .checkmark { - display: none; - width: 0.7em; - height: 0.7em; - stroke-width: 10px; - stroke: #99829f; } - .react-dat-gui .cr.boolean .checkbox-wrapper input[type=checkbox] { - margin: 0; - opacity: 0; - z-index: 1; } - .react-dat-gui .cr.boolean .checkbox-wrapper input[type=checkbox]:checked ~ .checkbox > .checkmark { - display: block; } - .react-dat-gui .cr.boolean .checkbox-wrapper input[type=checkbox]:hover ~ .checkbox { - background-color: #3c3c3c; } - .react-dat-gui .cr.button { - border-left: 5px solid #c5bdad; } - .react-dat-gui .cr.button:hover { - background: #111; } - .react-dat-gui .cr.button span { - width: 100%; - cursor: pointer; } - .react-dat-gui .cr label, .react-dat-gui .cr span { - display: inline-block; - align-items: center; - min-width: 0; - width: 40%; - padding: 5px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - user-select: none; } - .react-dat-gui .cr input[type=text] { - background: #303030; - border: 3px solid #1a1a1a; - border-radius: 0; - padding: 2px 5px; - outline: none; - font-size: inherit; } - .react-dat-gui .cr input[type=text]:hover { - background: #3c3c3c; } - .react-dat-gui .cr input[type=text]:focus { - background: #494949; - color: #fff; } diff --git a/docs/example/assets/react-dat-gui.min.css b/docs/example/assets/react-dat-gui.min.css deleted file mode 100644 index 61e2380..0000000 --- a/docs/example/assets/react-dat-gui.min.css +++ /dev/null @@ -1,2 +0,0 @@ -.react-dat-gui{position:absolute;right:0;top:0;width:280px;font-size:12px;font-family:Lucida Grande,sans-serif;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent}.react-dat-gui *,.react-dat-gui :after,.react-dat-gui :before{box-sizing:inherit}.react-dat-gui .dg{margin:0;padding:0;color:#eee;overflow:auto}.react-dat-gui .dg.main{background:#272727}.react-dat-gui .dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.react-dat-gui .dg.main::-webkit-scrollbar-corner{height:0;display:none}.react-dat-gui .dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.react-dat-gui .cr{display:block;background-color:#1a1a1a;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.react-dat-gui .cr:not(:last-child){margin-bottom:1px}.react-dat-gui .cr.number{border-left:5px solid #2fa1d6}.react-dat-gui .cr.number input[type=text]{color:#2fa1d6}.react-dat-gui .cr.number .slider{display:block;position:relative;border:3px solid #1a1a1a;border-right-width:1px;background-color:#303030;background-image:-webkit-linear-gradient(left,#2fa1d6,#2fa1d6);background-image:linear-gradient(90deg,#2fa1d6,#2fa1d6);background-size:0 100%;background-repeat:no-repeat;cursor:ew-resize}.react-dat-gui .cr.number .slider:before{content:'\A0';display:block;padding:2px}.react-dat-gui .cr.string{border-left:5px solid #1ed36f}.react-dat-gui .cr.string input[type=text]{color:#1ed36f}.react-dat-gui .cr.boolean{position:relative;border-left:5px solid #806787}.react-dat-gui .cr.boolean .label-text{display:block;padding:5px 0;width:calc(100% - 2em)}.react-dat-gui .cr.boolean .checkbox,.react-dat-gui .cr.boolean input[type=checkbox]{position:absolute;top:1px;right:2px;bottom:1px;width:2em}.react-dat-gui .cr.boolean .checkbox{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border:3px solid #1a1a1a;background:#303030;z-index:0}.react-dat-gui .cr.boolean .checkbox>.checkmark{display:none;width:.6em;height:.6em;stroke-width:7px;stroke:#b09fb5}.react-dat-gui .cr.boolean input[type=checkbox]{height:calc(100% - 4px);margin:0;opacity:0;z-index:1}.react-dat-gui .cr.boolean input[type=checkbox]:hover~.checkbox{background-color:#3c3c3c}.react-dat-gui .cr.boolean input[type=checkbox]:checked~.checkbox>.checkmark{display:block}.react-dat-gui .cr.button{border-left:5px solid #c5bdad}.react-dat-gui .cr.button:hover{background:#111}.react-dat-gui .cr.button .label-text{display:block;width:100%;padding:6px 2px 6px 8px;cursor:pointer}.react-dat-gui .cr label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;width:100%;padding:1px 2px 1px 8px}.react-dat-gui .cr .label-text{width:40%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.react-dat-gui .cr input[type=text]{background:#303030;border:3px solid #1a1a1a;border-radius:0;padding:2px 5px;margin:0;outline:none;font-size:inherit}.react-dat-gui .cr input[type=text]:hover{background:#3c3c3c}.react-dat-gui .cr input[type=text]:focus{background:#494949;color:#fff}.react-dat-gui .cr input[type=text]::-ms-clear{display:none} -/*# sourceMappingURL=react-dat-gui.min.css.map */ diff --git a/docs/example/assets/styles.css b/docs/example/assets/styles.css deleted file mode 100644 index c60e19f..0000000 --- a/docs/example/assets/styles.css +++ /dev/null @@ -1,45 +0,0 @@ -body { - padding: 0; - margin: 0; - overflow: hidden -} - -._example_src_index__container { - position: absolute; - top: 50%; - left: 0; - right: 0; - bottom: 0; -} -._example_src_components_plot__container { - position: absolute; - left: 0; - right: 0; - top: 0; - height: 50%; - overflow: scroll; -} -._example_src_components_code__codeContainer { - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; - - padding: 2px; -} - -._example_src_components_code__codeContainer:before { - content: ' '; - position: absolute; - left: -2px; - right: -2px; - top: 1px; - height: 0px; - border-top: 1px solid #ccc; -} - -._example_src_components_code__codeContainer--invalid { - border: 2px solid red; - padding: 0; -} diff --git a/docs/example/index.html b/docs/example/index.html deleted file mode 100644 index 52a8816..0000000 --- a/docs/example/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - react-plotly.js - - - - - - - - - - diff --git a/docs/example/index.js b/docs/example/index.js deleted file mode 100644 index f81ff12..0000000 --- a/docs/example/index.js +++ /dev/null @@ -1 +0,0 @@ -!function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0&&void 0!==arguments[0]?arguments[0]:this.props;return(0,l.default)(t.data,t.path)}},{key:"handleChange",value:function(t){var e=this,n=t.target.value;this.setState({value:n},function(){e.props.liveUpdate&&e.update()})}},{key:"update",value:function(){var t=this.state.value;this.props._onUpdateValue&&this.props._onUpdateValue(this.props.path,t),this.props.onUpdate&&this.props.onUpdate(t)}},{key:"render",value:function(){var t=this.props,e=t.path,n=t.label,r=t.labelWidth,i=t.items,o=(0,u.default)(n)?n:e;return h.default.createElement("li",{className:"cr select"},h.default.createElement("label",null,h.default.createElement("span",{className:"label-text",style:{width:r+"%"}},o),h.default.createElement("select",{value:this.state.value,style:{width:100-r+"%"},onChange:this.handleChange},i&&i.map(function(t){return h.default.createElement("option",{key:t.label,value:t.value},t.label)}))))}}]),e}();f.propTypes={items:c.PropTypes.arrayOf(c.PropTypes.shape({value:c.PropTypes.string.isRequired,label:c.PropTypes.string.isRequired})).isRequired,data:c.PropTypes.object,path:c.PropTypes.string,label:c.PropTypes.string,labelWidth:c.PropTypes.number,liveUpdate:c.PropTypes.bool,onUpdate:c.PropTypes.func,_onUpdateValue:c.PropTypes.func},n.default=f},{1229:1229,298:298,300:300}],2:[function(t,e,n){e.exports={codeContainer:"_example_src_components_code__codeContainer","codeContainer--invalid":"_example_src_components_code__codeContainer--invalid"}},{}],3:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;nMath.abs(e))u.rotate(a,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*o*e/window.innerHeight*(a-u.lastT())/100;u.pan(a,0,0,h*(Math.exp(s)-1))}},!0),p};var r=t(1234),i=t(9),o=t(452),a=t(455),s=t(453)},{1234:1234,452:452,453:453,455:455,9:9}],9:[function(t,e,n){"use strict";function r(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],n=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=i(),h=o(),f=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,n,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,n,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,n,s),new r({turntable:c,orbit:h,matrix:f},u)};var i=t(1270),o=t(473),a=t(450),s=r.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],n=[],r=0;r0&&(e.y+=n),o=e.y+e.dy+p;if((n=o-p-m[1])>0)for(o=e.y-=n,r=a-2;r>=0;--r)(n=(e=t[r]).y+e.dy+p-o)>0&&(e.y-=n),o=e.y})}function i(t,e){return t.y-e.y}var o=n.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(v).map(function(t){return t.values});!function(){var t=e.min(o,function(t){return(m[1]-(t.length-1)*p)/e.sum(t,h)});o.forEach(function(e){e.forEach(function(e,n){e.y=n,e.dy=e.value*t})}),g.forEach(function(e){e.dy=e.value*t})}(),r();for(var a=1;t>0;--t)!function(t){function n(t){return c(t.target)*t.value}o.slice().reverse().forEach(function(r){r.forEach(function(r){if(r.sourceLinks.length){var i=e.sum(r.sourceLinks,n)/e.sum(r.sourceLinks,h);r.y+=(i-c(r))*t}})})}(a*=.99),r(),function(t){function n(t){return c(t.source)*t.value}o.forEach(function(r){r.forEach(function(r){if(r.targetLinks.length){var i=e.sum(r.targetLinks,n)/e.sum(r.targetLinks,h);r.y+=(i-c(r))*t}})})}(a),r()}function u(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}v.forEach(function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)}),v.forEach(function(t){var e=0,n=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=n,n+=t.dy})})}function c(t){return t.y+t.dy/2}function h(t){return t.value}var f={},d=24,p=8,m=[1,1],v=[],g=[];return f.nodeWidth=function(t){return arguments.length?(d=+t,f):d},f.nodePadding=function(t){return arguments.length?(p=+t,f):p},f.nodes=function(t){return arguments.length?(v=t,f):v},f.links=function(t){return arguments.length?(g=t,f):g},f.size=function(t){return arguments.length?(m=t,f):m},f.layout=function(e){return t(),i(),o(),l(e),u(),f},f.relayout=function(){return u(),f},f.link=function(){function t(t){var n=t.source.x+t.source.dx,i=t.target.x,o=r.interpolateNumber(n,i),a=o(e),s=o(1-e),l=t.source.y+t.sy,u=l+t.dy,c=t.target.y+t.ty,h=c+t.dy;return"M"+n+","+l+"C"+a+","+l+" "+s+","+c+" "+i+","+c+"L"+i+","+h+"C"+s+","+h+" "+a+","+u+" "+n+","+u+"Z"}var e=.5;return t.curvature=function(n){return arguments.length?(e=+n,t):e},t},f},Object.defineProperty(t,"__esModule",{value:!0})})},{90:90,91:91,95:95}],11:[function(t,e,n){"use strict";var r="undefined"==typeof WeakMap?t(1291):WeakMap,i=t(155),o=t(261),a=new r;e.exports=function(t){var e=a.get(t),n=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!n||!t.isBuffer(n)){var r=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=o(t,[{buffer:r,type:t.FLOAT,size:2}]))._triangleBuffer=r,a.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{1291:1291,155:155,261:261}],12:[function(t,e,n){var r=t(13);e.exports=function(t,e,n){e="number"==typeof e?e:1,n=n||": ";var i=t.split(/\r?\n/),o=String(i.length+e-1).length;return i.map(function(t,i){var a=i+e,s=String(a).length;return r(a,o-s)+n+t}).join("\n")}},{13:13}],13:[function(t,e,n){"use strict";var r=t(1232);e.exports=function(t,e,n){return n=void 0!==n?n+"":" ",r(n,e)+t}},{1232:1232}],14:[function(t,e,n){"use strict";function r(t,e){for(var n=new Array(e+1),r=0;ri&&(i=t[a]),t[a]=0;s--)if(l[s]!==u[s])return!1;for(s=l.length-1;s>=0;s--)if(a=l[s],!d(t[a],e[a],n,r))return!1;return!0}function v(t,e,n){d(t,e,!0)&&h(t,e,n,"notDeepStrictEqual",v)}function g(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function y(t){var e;try{t()}catch(t){e=t}return e}function x(t,e,n,r){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=y(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&h(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!t&&b.isError(i),s=!t&&i&&!n;if((a&&o&&g(i,n)||s)&&h(i,n,"Got unwanted exception"+r),t&&i&&n&&!g(i,n)||!t&&i)throw i}var b=t(1281),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M="foo"===function(){}.name,k=e.exports=f,T=/\s*function\s+([^\(\s]*)\s*/;k.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=c(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=s(e),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},b.inherits(k.AssertionError,Error),k.fail=h,k.ok=f,k.equal=function(t,e,n){t!=e&&h(t,e,n,"==",k.equal)},k.notEqual=function(t,e,n){t==e&&h(t,e,n,"!=",k.notEqual)},k.deepEqual=function(t,e,n){d(t,e,!1)||h(t,e,n,"deepEqual",k.deepEqual)},k.deepStrictEqual=function(t,e,n){d(t,e,!0)||h(t,e,n,"deepStrictEqual",k.deepStrictEqual)},k.notDeepEqual=function(t,e,n){d(t,e,!1)&&h(t,e,n,"notDeepEqual",k.notDeepEqual)},k.notDeepStrictEqual=v,k.strictEqual=function(t,e,n){t!==e&&h(t,e,n,"===",k.strictEqual)},k.notStrictEqual=function(t,e,n){t===e&&h(t,e,n,"!==",k.notStrictEqual)},k.throws=function(t,e,n){x(!0,t,e,n)},k.doesNotThrow=function(t,e,n){x(!1,t,e,n)},k.ifError=function(t){if(t)throw t};var A=Object.keys||function(t){var e=[];for(var n in t)_.call(t,n)&&e.push(n);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1281:1281}],20:[function(t,e,n){e.exports=function(t){return atob(t)}},{}],21:[function(t,e,n){"use strict";function r(t){for(var e=0,n=0;n0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}function o(t,e,n){for(var r,o=[],a=e;a0?u-4:u;var c=0;for(e=0;e>16&255,a[c++]=i>>8&255,a[c++]=255&i;return 2===o?(i=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,a[c++]=255&i):1===o&&(i=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,a[c++]=i>>8&255,a[c++]=255&i),a},n.fromByteArray=function(t){for(var e,n=t.length,r=n%3,i="",s=[],l=0,u=n-r;lu?u:l+16383));return 1===r?(e=t[n-1],i+=a[e>>2],i+=a[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=a[e>>10],i+=a[e>>4&63],i+=a[e<<2&63],i+="="),s.push(i),s.join("")};for(var a=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,h=u.length;c0?n=n.ushln(h):h<0&&(c=c.ushln(-h)),l(n,c)}var i=t(27),o=t(31),a=t(32),s=t(34),l=t(33),u=t(25);e.exports=r},{25:25,27:27,31:31,32:32,33:33,34:34}],27:[function(t,e,n){"use strict";var r=t(31);e.exports=function(t){return Array.isArray(t)&&2===t.length&&r(t[0])&&r(t[1])}},{31:31}],28:[function(t,e,n){"use strict";var r=t(41);e.exports=function(t){return t.cmp(new r(0))}},{41:41}],29:[function(t,e,n){"use strict";var r=t(28);e.exports=function(t){var e=t.length,n=t.words,i=0;if(1===e)i=n[0];else if(2===e)i=n[0]+67108864*n[1];else for(var o=0;o20?52:n+32}},{100:100,40:40}],31:[function(t,e,n){"use strict";t(41);e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{41:41}],32:[function(t,e,n){"use strict";var r=t(41),i=t(100);e.exports=function(t){var e=i.exponent(t);return e<52?new r(t):new r(t*Math.pow(2,52-e)).ushln(e-52)}},{100:100,41:41}],33:[function(t,e,n){"use strict";var r=t(32),i=t(28);e.exports=function(t,e){var n=i(t),o=i(e);if(0===n)return[r(0),r(1)];if(0===o)return[r(0),r(0)];o<0&&(t=t.neg(),e=e.neg());var a=t.gcd(e);return a.cmpn(1)?[t.div(a),e.div(a)]:[t,e]}},{28:28,32:32}],34:[function(t,e,n){"use strict";var r=t(41);e.exports=function(t){return new r(t)}},{41:41}],35:[function(t,e,n){"use strict";var r=t(33);e.exports=function(t,e){return r(t[0].mul(e[0]),t[1].mul(e[1]))}},{33:33}],36:[function(t,e,n){"use strict";var r=t(28);e.exports=function(t){return r(t[0])*r(t[1])}},{28:28}],37:[function(t,e,n){"use strict";var r=t(33);e.exports=function(t,e){return r(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{33:33}],38:[function(t,e,n){"use strict";var r=t(29),i=t(30);e.exports=function(t){var e=t[0],n=t[1];if(0===e.cmpn(0))return 0;var o=e.abs().divmod(n.abs()),a=o.div,s=r(a),l=o.mod,u=e.negative!==n.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4;return u*(s+(f=r(l.ushln(c).divRound(n)))*Math.pow(2,-c))}var h=n.bitLength()-l.bitLength()+53,f=r(l.ushln(h).divRound(n));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{29:29,30:30}],39:[function(t,e,n){"use strict";function r(t,e,n,r,i,o){var a=["function ",t,"(a,l,h,",r.join(","),"){",o?"":"var i=",n?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return o?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),n?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),o?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,n,i){return new Function([r("A","x"+t+"y",e,["y"],!1,i),r("B","x"+t+"y",e,["y"],!0,i),r("P","c(x,y)"+t+"0",e,["y","c"],!1,i),r("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",n,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",n].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],40:[function(t,e,n){"use strict";"use restrict";function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}n.INT_BITS=32,n.INT_MAX=2147483647,n.INT_MIN=-1<<31,n.sign=function(t){return(t>0)-(t<0)},n.abs=function(t){var e=t>>31;return(t^e)-e},n.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,n=(t>255)<<3,t>>>=n,e|=n,n=(t>15)<<2,t>>>=n,e|=n,n=(t>3)<<1,t>>>=n,(e|=n)|t>>1},n.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},n.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},n.countTrailingZeros=r,n.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},n.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},n.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var n=e,r=e,i=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=1&n,--i;t[e]=r<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},n.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},n.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},n.interleave3=function(t,e,n){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,n&=1023,n=4278190335&(n|n<<16),n=251719695&(n|n<<8),n=3272356035&(n|n<<4),n=1227133513&(n|n<<2),t|n<<2},n.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},n.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},{}],41:[function(t,e,n){!function(e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}function a(t,e,n){for(var r=0,i=Math.min(t.length,n),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function s(t,e,n,r){for(var i=0,o=Math.min(t.length,n),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}function l(t){for(var e=new Array(t.bitLength()),n=0;n>>i}return e}function u(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,l=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,h=67108863&l,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&a}n.words[u]=0|h,l=0|c}return 0!==l?n.words[u]=0|l:n.length--,n.strip()}function c(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}function h(t,e,n){return(new f).mulp(t,e,n)}function f(t,e){this.x=t,this.y=e}function d(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){d.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){d.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function g(){d.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var b;try{b=t(50).Buffer}catch(t){}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=a(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=a(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,l=Math.min(o,o-a)+n,u=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){t=t||10,e=0|e||1;var n;if(16===t||"hex"===t){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?_[6-l.length]+l+n:l+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var u=w[t],c=M[t];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modn(c).toString(t);n=(h=h.idivn(c)).isZero()?f+n:_[u-f.length]+f+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==b),this.toArrayLike(b,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,l="le"===e,u=new t(o),c=this.clone();if(l){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[s]=a;for(;s=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;var r,i;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,x=0|a[3],b=8191&x,_=x>>>13,w=0|a[4],M=8191&w,k=w>>>13,T=0|a[5],A=8191&T,S=T>>>13,E=0|a[6],C=8191&E,L=E>>>13,P=0|a[7],I=8191&P,O=P>>>13,D=0|a[8],z=8191&D,j=D>>>13,N=0|a[9],R=8191&N,F=N>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,W=H>>>13,G=0|s[2],Y=8191&G,X=G>>>13,Z=0|s[3],K=8191&Z,J=Z>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;n.negative=t.negative^e.negative,n.length=19;var vt=(u+(r=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;u=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,o=Math.imul(m,V);var gt=(u+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(g,U),i=(i=Math.imul(g,V))+Math.imul(y,U)|0,o=Math.imul(y,V),r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,W)|0;var yt=(u+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,o=Math.imul(_,V),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var xt=(u+(r=r+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(k,U)|0,o=Math.imul(k,V),r=r+Math.imul(b,q)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,X)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,J)|0;var bt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(S,U)|0,o=Math.imul(S,V),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,W)|0,r=r+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(g,K)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,J)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(f,nt)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(L,U)|0,o=Math.imul(L,V),r=r+Math.imul(A,q)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,W)|0,r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,X)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,J)|0,r=r+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var wt=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(O,U)|0,o=Math.imul(O,V),r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,r=r+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(g,nt)|0,i=(i=i+Math.imul(g,rt)|0)+Math.imul(y,nt)|0,o=o+Math.imul(y,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(u+(r=r+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(f,lt)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(z,U),i=(i=Math.imul(z,V))+Math.imul(j,U)|0,o=Math.imul(j,V),r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,X)|0,r=r+Math.imul(A,K)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,J)|0,r=r+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(_,nt)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,r=r+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ut)|0;var kt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,V))+Math.imul(F,U)|0,o=Math.imul(F,V),r=r+Math.imul(z,q)|0,i=(i=i+Math.imul(z,W)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,W)|0,r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,J)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ut)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Tt=(u+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(R,q),i=(i=Math.imul(R,W))+Math.imul(F,q)|0,o=Math.imul(F,W),r=r+Math.imul(z,Y)|0,i=(i=i+Math.imul(z,X)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,X)|0,r=r+Math.imul(I,K)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,J)|0,r=r+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(S,nt)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(R,Y),i=(i=Math.imul(R,X))+Math.imul(F,Y)|0,o=Math.imul(F,X),r=r+Math.imul(z,K)|0,i=(i=i+Math.imul(z,J)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,J)|0,r=r+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(C,nt)|0,i=(i=i+Math.imul(C,rt)|0)+Math.imul(L,nt)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,r=r+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ut)|0,r=r+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var St=(u+(r=r+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(R,K),i=(i=Math.imul(R,J))+Math.imul(F,K)|0,o=Math.imul(F,J),r=r+Math.imul(z,Q)|0,i=(i=i+Math.imul(z,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(O,nt)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,r=r+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ut)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ut)|0,r=r+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ft)|0;var Et=(u+(r=r+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(R,Q),i=(i=Math.imul(R,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(z,nt)|0,i=(i=i+Math.imul(z,rt)|0)+Math.imul(j,nt)|0,o=o+Math.imul(j,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,ut)|0,r=r+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,ft)|0;var Ct=(u+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(R,nt),i=(i=Math.imul(R,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(z,ot)|0,i=(i=i+Math.imul(z,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,r=r+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(O,lt)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ft)|0;var Lt=(u+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(S,pt)|0))<<13)|0;u=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(R,ot),i=(i=Math.imul(R,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(z,lt)|0,i=(i=i+Math.imul(z,ut)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ut)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(u+(r=r+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(R,lt),i=(i=Math.imul(R,ut))+Math.imul(F,lt)|0,o=Math.imul(F,ut),r=r+Math.imul(z,ht)|0,i=(i=i+Math.imul(z,ft)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ft)|0;var It=(u+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(R,ht),i=(i=Math.imul(R,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Ot=(u+(r=r+Math.imul(z,pt)|0)|0)+((8191&(i=(i=i+Math.imul(z,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Dt=(u+(r=Math.imul(R,pt))|0)+((8191&(i=(i=Math.imul(R,mt))+Math.imul(F,pt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=vt,l[1]=gt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=Tt,l[10]=At,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=Lt,l[15]=Pt,l[16]=It,l[17]=Ot,l[18]=Dt,0!==u&&(l[19]=u,n.length++),n};Math.imul||(k=u),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?k(this,t,e):n<63?u(this,t,e):n<1024?c(this,t,e):h(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r>=1;return r},f.prototype.permute=function(t,e,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=l(t);if(0===e.length)return new o(1);for(var n=this,r=0;r=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(e=0;e>>26-n}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0);var i;i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=this.length-t.length,r=this.clone(),i=t,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,l=r.length-i.length;if("mod"!==e){(s=new o(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[i.length+h])+(0|r.words[i.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(i,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,n){if(r(!t.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var i,a,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),l=new o(1),u=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++u;for(var c=n.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(s),a.isub(l)):(n.isub(e),s.isub(i),l.isub(a))}return{a:s,b:l,gcd:n.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;0==(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(n.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(n.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(a)):(n.isub(e),a.isub(i))}var f;return(f=0===e.cmpn(1)?i:a).cmpn(0)<0&&f.iadd(t),f},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var n;if(this.length>1)n=1;else{e&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];n=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new y(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var T={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},d.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):n.strip(),n},d.prototype.split=function(t,e){t.iushrn(this.n,0,e)},d.prototype.imulK=function(t){return t.imul(this.k)},i(p,d),p.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r>>22,i=o}i>>>=22,t.words[r-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(T[t])return T[t];var e;if("k256"===t)e=new p;else if("p224"===t)e=new m;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new g}return T[t]=e,e},y.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},y.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v=0;r--){for(var u=e.words[r],c=l-1;c>=0;c--){var h=u>>c&1;i!==n[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===c)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}l=26}return i},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,y),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{50:50}],42:[function(t,e,n){"use strict";e.exports=function(t){var e,n,r,i=t.length,o=0;for(e=0;e>>1;if(!(s<=0)){var l,u=c.mallocDouble(2*s*o),d=c.mallocInt32(o);if((o=i(t,s,u,d))>0){if(1===s&&r)h.init(o),l=h.sweepComplete(s,n,0,o,u,d,0,o,u,d);else{var p=c.mallocDouble(2*s*a),m=c.mallocInt32(a);(a=i(e,s,p,m))>0&&(h.init(o+a),l=1===s?h.sweepBipartite(s,n,0,o,u,d,0,a,p,m):f(s,n,r,o,u,d,a,p,m),c.free(p),c.free(m))}c.free(u),c.free(d)}return l}}}function a(t,e){u.push([t,e])}function s(t){return u=[],o(t,t,a,!0),u}function l(t,e){return u=[],o(t,e,a,!1),u}e.exports=function(t,e,n){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?o(t,t,e,!0):l(t,e);case 3:return o(t,e,n,!1);default:throw new Error("box-intersect: Invalid arguments")}};var u,c=t(1273),h=t(49),f=t(45)},{1273:1273,45:45,49:49}],44:[function(t,e,n){"use strict";function r(t,e,n){var r="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(n?"Full":""),i=["function ",r,"(",w.join(),"){","var ",u,"=2*",o,";"],l="for(var i="+c+","+p+"="+u+"*"+c+";i<"+h+";++i,"+p+"+="+u+"){var x0="+f+"["+a+"+"+p+"],x1="+f+"["+a+"+"+p+"+"+o+"],xi="+d+"[i];",M="for(var j="+m+","+x+"="+u+"*"+m+";j<"+v+";++j,"+x+"+="+u+"){var y0="+g+"["+a+"+"+x+"],"+(n?"y1="+g+"["+a+"+"+x+"+"+o+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",M):i.push(M,_,":",l),n?i.push("if(y1"+v+"-"+m+"){"),t?(e(!0,!1),a.push("}else{"),e(!1,!1)):(a.push("if("+l+"){"),e(!0,!0),a.push("}else{"),e(!0,!1),a.push("}}else{if("+l+"){"),e(!1,!0),a.push("}else{"),e(!1,!1),a.push("}")),a.push("}}return "+n);var s=i.join("")+a.join("");return new Function(s)()}var o="d",a="ax",s="vv",l="fp",u="es",c="rs",h="re",f="rb",d="ri",p="rp",m="bs",v="be",g="bb",y="bi",x="bp",b="rv",_="Q",w=[o,a,s,c,h,f,d,m,v,g,y];n.partial=i(!1),n.full=i(!0)},{}],45:[function(t,e,n){"use strict";function r(t,e){var n=8*l.log2(e+1)*(t+1)|0,r=l.nextPow2(k*n);A.length0;){var O=(P-=1)*k,D=A[O],z=A[O+1],j=A[O+2],N=A[O+3],R=A[O+4],F=A[O+5],B=P*T,U=S[B],V=S[B+1],H=1&F,q=!!(16&F),W=l,G=u,Y=E,X=C;if(H&&(W=E,G=C,Y=l,X=u),!(2&F&&(j=b(t,D,z,j,W,G,V),z>=j)||4&F&&(z=_(t,D,z,j,W,G,U))>=j)){var Z=j-z,K=R-N;if(q){if(t*Z*(Z+K)=p0)&&!(p1>=hi)",["p0","p1"]),x=p("lo===p0",["p0"]),b=p("lon&&i[h+e]>u;--c,h-=a){for(var f=h,d=h+a,p=0;p>>1,f=2*t,d=h,p=s[f*h+e];u=x?(d=y,p=x):g>=_?(d=v,p=g):(d=b,p=_):x>=_?(d=y,p=x):_>=g?(d=v,p=g):(d=b,p=_);for(var w=f*(c-1),M=f*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),n.push(r.replace("_",i.join()).replace("$",t)),Function.apply(void 0,n)};var r="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],48:[function(t,e,n){"use strict";function r(t,e,n){for(var r=2*(t+1),i=t+1;i<=e;++i){for(var o=n[r++],a=n[r++],s=i,l=r-2;s-- >t;){var u=n[l-2],c=n[l-1];if(un[e+1])}function u(t,e,n,r){var i=r[t*=2];return i>1,v=m-f,g=m+f,y=d,x=v,b=m,_=g,w=p,M=t+1,k=e-1,T=0;l(y,x,n)&&(T=y,y=x,x=T),l(_,w,n)&&(T=_,_=w,w=T),l(y,b,n)&&(T=y,y=b,b=T),l(x,b,n)&&(T=x,x=b,b=T),l(y,_,n)&&(T=y,y=_,_=T),l(b,_,n)&&(T=b,b=_,_=T),l(x,w,n)&&(T=x,x=w,w=T),l(x,b,n)&&(T=x,x=b,b=T),l(_,w,n)&&(T=_,_=w,w=T);for(var A=n[2*x],S=n[2*x+1],E=n[2*_],C=n[2*_+1],L=2*y,P=2*b,I=2*w,O=2*d,D=2*m,z=2*p,j=0;j<2;++j){var N=n[L+j],R=n[P+j],F=n[I+j];n[O+j]=N,n[D+j]=R,n[z+j]=F}o(v,t,n),o(g,e,n);for(var B=M;B<=k;++B)if(u(B,A,S,n))B!==M&&i(B,M,n),++M;else if(!u(B,E,C,n))for(;;){if(u(k,E,C,n)){u(k,A,S,n)?(a(B,M,k,n),++M,--k):(i(B,k,n),--k);break}if(--k>>1;s(m,S);for(var E=0,C=0,M=0;M=l)r(h,f,C--,L=L-l|0);else if(L>=0)r(u,c,E--,L);else if(L<=-l){for(L=-L-l|0,P=0;P>>1;s(m,E);for(var C=0,L=0,P=0,k=0;k>1==m[2*k+3]>>1&&(O=2,k+=1),I<0){for(var D=-(I>>1)-1,z=0;z>1)-1,0===O?r(u,c,C--,D):1===O?r(h,f,L--,D):2===O&&r(d,p,P--,D)}},scanBipartite:function(t,e,n,o,a,h,f,d,p,v,g,y){var x=0,b=2*t,_=e,w=e+t,M=1,k=1;o?k=l:M=l;for(L=a;L>>1;s(m,E);for(var C=0,L=0;L=l?(I=!o,T-=l):(I=!!o,T-=1),I)i(u,c,C++,T);else{var O=y[T],D=b*T,z=g[D+e+1],j=g[D+e+1+t];t:for(var N=0;N>>1;s(m,M);for(var k=0,x=0;x=l)u[k++]=b-l;else{var A=d[b-=1],S=v*b,E=f[S+e+1],C=f[S+e+1+t];t:for(D=0;D=0;--D)if(u[D]===b){for(var z=D+1;zZ)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(t)}return o(t,e,n)}function o(t,e,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return q(t)?h(t,e,n):"string"==typeof t?u(t,e):f(t)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function s(t,e,n){return a(t),t<=0?r(t):void 0!==e?"string"==typeof n?r(t).fill(e,n):r(t).fill(e):r(t)}function l(t){return a(t),r(t<0?0:0|d(t))}function u(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,e),o=r(n),a=o.write(t,e);return a!==n&&(o=o.slice(0,a)),o}function c(t){for(var e=t.length<0?0:0|d(t.length),n=r(e),i=0;i=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return 0|t}function p(t,e){if(i.isBuffer(t))return t.length;if(W(t)||q(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return E(this,e,n);case"latin1":case"binary":return C(this,e,n);case"base64":return T(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,G(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,n/=2}var u;if(i){var c=-1;for(u=n;us&&(n=s-l),u=n;u>=0;u--){for(var h=!0,f=0;fi&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=n){var l,u,c,h;switch(s){case 1:o<128&&(a=o);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&o)<<6|63&l)>127&&(a=h);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(h=(15&o)<<12|(63&l)<<6|63&u)>2047&&(h<55296||h>57343)&&(a=h);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(h=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(a=h)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return S(r)}function S(t){var e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,n,r,52,8),n+8}function N(t){if((t=t.trim().replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],a=0;a55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(t){for(var e=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function V(t){return Y.toByteArray(N(t))}function H(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function q(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function W(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function G(t){return t!==t}var Y=t(22),X=t(279);n.Buffer=i,n.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},n.INSPECT_MAX_BYTES=50;var Z=2147483647;n.kMaxLength=Z,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,n){return o(t,e,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,n){return s(t,e,n)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,n,r,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var a=o-r,s=n-e,l=Math.min(a,s),u=this.slice(r,o),c=t.slice(e,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return M(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||I(t,e,this.length);for(var r=this[t],i=1,o=0;++o>>=0,e>>>=0,n||I(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},i.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);for(var r=this[t],i=1,o=0;++o=i&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},i.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),X.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),X.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),X.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),X.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||O(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,n>>>=0,r||O(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);O(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);O(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,n){return z(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return z(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a0;){for(var d=n.pop(),c=-1,h=-1,l=a[s=n.pop()],p=1;p=0||(e.flip(s,d),r(t,e,n,c,s,h),r(t,e,n,s,h,c),r(t,e,n,h,d,c),r(t,e,n,d,c,h))}}},{1238:1238,57:57}],54:[function(t,e,n){"use strict";function r(t,e,n,r,i,o,a){this.cells=t,this.neighbor=e,this.flags=r,this.constraint=n,this.active=i,this.next=o,this.boundary=a}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function o(t,e){for(var n=t.cells(),o=n.length,a=0;a0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i,c[d];for(var p=0;p<3;++p){var m=f[3*d+p];m>=0&&0===u[m]&&(h[3*d+p]?l.push(m):(s.push(m),u[m]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var g=a(c,u,e);return n?g.concat(r.boundary):g},r.prototype.locate=function(){var t=[0,0,0];return function(e,n,r){var o=e,a=n,l=r;return n1&&f(n[c[d-2]],n[c[d-1]],r)>0;)t.push([c[d-1],c[d-2],i]),d-=1;c.length=d,c.push(i);for(var p=u.upperIds,d=p.length;d>1&&f(n[p[d-2]],n[p[d-1]],r)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var n;return(n=t.a[0]g[0]&&l.push(new i(g,v,m,h),new i(v,g,p,h))}l.sort(o);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),x=[new r([y,1],[y,0],-1,[],[],[],[])],b=[],h=0,_=l.length;h<_;++h){var w=l[h],M=w.type;M===d?s(b,x,t,w.a,w.idx):M===m?u(x,t,w):c(x,t,w)}return b}},{1240:1240,57:57}],56:[function(t,e,n){"use strict";function r(t,e){this.stars=t,this.edges=e}function i(t,e,n){for(var r=1,i=t.length;r=0}}(),a.removeTriangle=function(t,e,n){var r=this.stars;i(r[t],e,n),i(r[e],n,t),i(r[n],t,e)},a.addTriangle=function(t,e,n){var r=this.stars;r[t].push(e,n),r[e].push(n,t),r[n].push(t,e)},a.opposite=function(t,e){for(var n=this.stars[e],r=1,i=n.length;r>>1,x=a[m]"];return i?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),n?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,n,i){return new Function([r("A","x"+t+"y",e,["y"],i),r("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",n,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",n].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],58:[function(t,e,n){"use strict";e.exports=function(t){for(var e=1,n=1;nn?n:t:te?e:t}},{}],62:[function(t,e,n){!function(){"use strict";function t(){for(var e=[],r=0;r=0;--o){var p=r[o],m=e[a=p[0]],v=m[0],g=m[1],w=t[v],k=t[g];if((w[0]-k[0]||w[1]-k[1])<0){var T=v;v=g,g=T}m[0]=v;var A,S=m[1]=p[1];for(i&&(A=m[2]);o>0&&r[o-1][0]===a;){var E=(p=r[--o])[1];i?e.push([S,E,A]):e.push([S,E]),S=E}i?e.push([S,g,A]):e.push([S,g])}return s}function u(t,e,n){for(var i=e.length,o=new m(i),a=[],s=0;se[2]?1:0)}function f(t,e,n){if(0!==t.length){if(e)for(s=0;s0||d.length>0)}e.exports=function(t,e,n){var r;if(n){r=e;for(var i=new Array(e.length),o=0;o0;--e)t.removeChild(t.firstChild);return t}function n(t,n){return e(t).appendChild(n)}function r(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}function f(t,e){for(var n=0;n=e)return r+Math.min(a,e-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=e)return r}}function p(t){for(;Ra.length<=t;)Ra.push(m(Ra)+" ");return Ra[t]}function m(t){return t[t.length-1]}function v(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||Fa.test(t))}function _(t,e){return e?!!(e.source.indexOf("\\w")>-1&&b(t))||e.test(t):b(t)}function w(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function M(t){return t.charCodeAt(0)>=768&&Ba.test(t)}function k(t,e,n){for(;(n<0?e>0:e=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e=t.first&&en?z(n,S(t,n).text.length):H(e,S(t,e.line).text.length)}function H(t,e){var n=t.ch;return null==n||n>e?z(t.line,e):n<0?z(t.line,0):t}function q(t,e){for(var n=[],r=0;r=e:o.to>e);(r||(r=[])).push(new Y(a,o.from,s?null:o.to))}}return r}function $(t,e,n){var r;if(t)for(var i=0;i=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var b=0;b0)){var c=[l,1],h=j(u.from,s.from),d=j(u.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function nt(t){var e=t.markedSpans;if(e){for(var n=0;n=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?j(u.to,n)>=0:j(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?j(u.from,r)<=0:j(u.from,r)<0)))return!0}}}function ht(t){for(var e;e=lt(t);)t=e.find(-1,!0).line;return t}function ft(t){for(var e;e=ut(t);)t=e.find(1,!0).line;return t}function dt(t){for(var e,n;e=ut(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function pt(t,e){var n=S(t,e),r=ht(n);return n==r?e:P(r)}function mt(t,e){if(e>t.lastLine())return e;var n,r=S(t,e);if(!vt(t,r))return e;for(;n=ut(r);)r=n.find(1,!0).line;return P(r)+1}function vt(t,e){var n=Va&&e.markedSpans;if(n)for(var r=void 0,i=0;ie.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}function _t(t,e,n,r){if(!t)return r(e,n,"ltr");for(var i=!1,o=0;oe||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(e,n,"ltr")}function wt(t,e,n){var r;Ha=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:Ha=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:Ha=i)}return null!=r?r:Ha}function Mt(t,e){var n=t.order;return null==n&&(n=t.order=qa(t.text,e)),n}function kt(t,e,n){var r=k(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Tt(t,e,n){var r=kt(t,e.ch,n);return null==r?null:new z(e.line,r,n<0?"after":"before")}function At(t,e,n,r,i){if(t){var o=Mt(n,e.doc.direction);if(o){var a,s=i<0?m(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0){var u=Ke(e,n);a=i<0?n.text.length-1:0;var c=Je(e,u,a).top;a=T(function(t){return Je(e,u,t).top==c},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=kt(n,a,1))}else a=i<0?s.to:s.from;return new z(r,a,l)}}return new z(r,i<0?n.text.length:0,i<0?"before":"after")}function St(t,e,n,r){var i=Mt(e,t.doc.direction);if(!i)return Tt(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=wt(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=c.begin)){var d=h?"before":"after";return new z(n.line,f,d)}}var p=function(t,e,r){for(var o=function(t,e){return e?new z(n.line,l(t,1),"before"):new z(n.line,t,"after")};t>=0&&t0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==v||r>0&&v==e.text.length||!(m=p(r>0?0:i.length-1,r,u(v)))?null:m}function Et(t,e){return t._handlers&&t._handlers[e]||Wa}function Ct(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,i=r&&r[e];if(i){var o=f(i,n);o>-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function Lt(t,e){var n=Et(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Dt(t){t.prototype.on=function(t,e){Ga(this,t,e)},t.prototype.off=function(t,e){Ct(this,t,e)}}function zt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function jt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Nt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Rt(t){zt(t),jt(t)}function Ft(t){return t.target||t.srcElement}function Bt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),_a&&t.ctrlKey&&1==e&&(e=3),e}function Ut(t){if(null==Pa){var e=r("span","​");n(t,r("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Pa=e.offsetWidth<=1&&e.offsetHeight>2&&!(ua&&ca<8))}var i=Pa?r("span","​"):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Vt(t){if(null!=Ia)return Ia;var r=n(t,document.createTextNode("AخA")),i=Ta(r,0,1).getBoundingClientRect(),o=Ta(r,1,2).getBoundingClientRect();return e(t),!(!i||i.left==i.right)&&(Ia=o.right-i.right<3)}function Ht(t){if(null!=Ja)return Ja;var e=n(t,r("span","x")),i=e.getBoundingClientRect(),o=Ta(e,0,1).getBoundingClientRect();return Ja=Math.abs(i.left-o.left)>1}function qt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),$a[t]=e}function Wt(t){if("string"==typeof t&&Qa.hasOwnProperty(t))t=Qa[t];else if(t&&"string"==typeof t.name&&Qa.hasOwnProperty(t.name)){var e=Qa[t.name];"string"==typeof e&&(e={name:e}),(t=x(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Wt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Wt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Gt(t,e){e=Wt(e);var n=$a[e.name];if(!n)return Gt(t,"text/plain");var r=n(t,e);if(ts.hasOwnProperty(e.name)){var i=ts[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}function Yt(t,e){c(e,ts.hasOwnProperty(t)?ts[t]:ts[t]={})}function Xt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Zt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Kt(t,e,n){return!t.startState||t.startState(e,n)}function Jt(t,e,n,r){var i=[t.state.modeGen],o={};oe(t,e.text,t.doc.mode,n,function(t,e){return i.push(t,e)},o,r);for(var a=n.state,s=0;st&&i.splice(s,1,t,i[s+1],r),s+=2,l=Math.min(t,r)}if(e)if(a.opaque)i.splice(n,s-n,t,"overlay "+e),s=n+2;else for(;nt.options.maxHighlightLength&&Xt(t.doc.mode,r.state),o=Jt(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function Qt(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new rs(r,!0,e);var o=ae(t,e,n),a=o>r.first&&S(r,o-1).stateAfter,s=a?rs.fromSaved(r,a,o):new rs(r,Kt(r.mode),o);return r.iter(o,e,function(n){te(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&re.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}function re(t,e,n,r){var i,o,a=t.doc,s=a.mode,l=S(a,(e=V(a,e)).line),u=Qt(t,e.line,n),c=new es(l.text,t.options.tabSize,u);for(r&&(o=[]);(r||c.post.options.maxHighlightLength?(s=!1,a&&te(t,e,r,h.pos),h.pos=e.length,l=null):l=ie(ne(n,h,r.state,f),o),f){var d=f[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=S(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ns?u.lookAhead:0)<=o.modeFrontier))return s;var c=h(l.text,null,t.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function se(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var i=S(t,r).stateAfter;if(i&&(!(i instanceof ns)||r+i.lookAhead1&&!/ /.test(t))return t;for(var n=e,r="",i=0;iu&&h.from<=u);f++);if(h.to>=c)return t(n,r,i,o,a,s,l);t(n,r.slice(0,h.to-u),i,o,null,s,l),o=null,r=r.slice(h.to-u),u=h.to}}}function ve(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function ge(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,h,f,d=i.length,p=0,m=1,v="",g=0;;){if(g==p){l=u=c=h=s="",f=null,g=1/0;for(var y=[],x=void 0,b=0;bp||w.collapsed&&_.to==p&&_.from==p)?(null!=_.to&&_.to!=p&&g>_.to&&(g=_.to,u=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&_.from==p&&(c+=" "+w.startStyle),w.endStyle&&_.to==g&&(x||(x=[])).push(w.endStyle,_.to),w.title&&!h&&(h=w.title),w.collapsed&&(!f||at(f.marker,w)<0)&&(f=_)):_.from>p&&g>_.from&&(g=_.from)}if(x)for(var M=0;M=d)break;for(var T=Math.min(d,g);;){if(v){var A=p+v.length;if(!f){var S=A>T?v.slice(0,T-p):v;e.addToken(e,S,a?a+l:l,c,p+S.length==g?u:"",h,s)}if(A>=T){v=v.slice(T-p),p=T;break}p=A,c=""}v=i.slice(o,o=n[m++]),a=ce(n[m++],e.cm.options)}}else for(var E=1;E2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ge(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;rn)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Ye(t,e){var r=P(e=ht(e)),i=t.display.externalMeasured=new ye(t.doc,e,r);i.lineN=r;var o=i.built=he(t,i);return i.text=o.pre,n(t.display.lineMeasure,o.pre),i}function Xe(t,e,n,r){return Je(t,Ke(t,e),n,r)}function Ze(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(r=t[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)r=t[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=t[i]).left==n.right;i--);return n}function tn(t,e,n,r){var i,o=$e(e.map,n,r),a=o.node,s=o.start,l=o.end,u=o.collapse;if(3==a.nodeType){for(var c=0;c<4;c++){for(;s&&M(e.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l0&&(u=r="right");var h;i=t.options.lineWrapping&&(h=a.getClientRects()).length>1?h["right"==r?h.length-1:0]:a.getBoundingClientRect()}if(ua&&ca<9&&!s&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+xn(t.display),top:f.top,bottom:f.bottom}:hs}for(var d=i.top-e.rect.top,p=i.bottom-e.rect.top,m=(d+p)/2,v=e.view.measure.heights,g=0;g=r.text.length?(u=r.text.length,c="before"):u<=0&&(u=0,c="after"),!l)return a("before"==c?u-1:u,"before"==c);var h=wt(l,u,c),f=Ha,d=s(u,h,"before"==c);return null!=f&&(d.other=s(u,f,"before"!=c)),d}function fn(t,e){var n=0;e=V(t.doc,e),t.options.lineWrapping||(n=xn(t.display)*e.ch);var r=S(t.doc,e.line),i=yt(r)+Fe(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function dn(t,e,n,r,i){var o=z(t,e,n);return o.xRel=i,r&&(o.outside=!0),o}function pn(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return dn(r.first,0,null,!0,-1);var i=I(r,n),o=r.first+r.size-1;if(i>o)return dn(r.first+r.size-1,S(r,o).text.length,null,!0,1);e<0&&(e=0);for(var a=S(r,i);;){var s=gn(t,a,i,e,n),l=ut(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=P(a=u.to.line)}}function mn(t,e,n,r){var i=function(r){return ln(t,e,Je(t,n,r),"line")},o=e.text.length,a=T(function(t){return i(t-1).bottom<=r},o,0);return o=T(function(t){return i(t).top>r},a,o),{begin:a,end:o}}function vn(t,e,n,r){return mn(t,e,n,ln(t,e,Je(t,n,r),"line").top)}function gn(t,e,n,r,i){i-=yt(e);var o,a=0,s=e.text.length,l=Ke(t,e);if(Mt(e,t.doc.direction)){if(t.options.lineWrapping){var u;a=(u=mn(t,e,l,i)).begin,s=u.end}o=new z(n,Math.floor(a+(s-a)/2));var c,h,f=hn(t,o,"line",e,l).left,d=f1){var y=Math.abs(p-c)/m;m=Math.min(m,Math.ceil(Math.abs(p)/y)),d=p<0?1:-1}}while(0!=p&&(m>1||d<0!=p<0&&Math.abs(p)<=Math.abs(c)));if(Math.abs(p)>Math.abs(c)){if(p<0==c<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=h}}else{var x=T(function(n){var o=ln(t,e,Je(t,l,n),"line");return o.top>i?(s=Math.min(n,s),!0):!(o.bottom<=i)&&(o.left>r||!(o.rightb.right?1:0,o}function yn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==as){as=r("pre");for(var i=0;i<49;++i)as.appendChild(document.createTextNode("x")),as.appendChild(r("br"));as.appendChild(document.createTextNode("x"))}n(t.measure,as);var o=as.offsetHeight/50;return o>3&&(t.cachedTextHeight=o),e(t.measure),o||1}function xn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=r("span","xxxxxxxxxx"),i=r("pre",[e]);n(t.measure,i);var o=e.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(t.cachedCharWidth=a),a||10}function bn(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[t.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[t.options.gutters[a]]=o.clientWidth;return{fixedPos:_n(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function _n(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function wn(t){var e=yn(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/xn(t.display)-3);return function(i){if(vt(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;r=t.display.viewTo||s.to().line3&&(i(d,m.top,null,m.bottom),d=c,m.bottoml.bottom||u.bottom==l.bottom&&u.right>l.right)&&(l=u),d0?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Pn(t){t.state.focused||(t.display.input.focus(),On(t))}function In(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Dn(t))},100)}function On(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(Lt(t,"focus",t,e),t.state.focused=!0,s(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),ha&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),Ln(t))}function Dn(t,e){t.state.delayingBlurEvent||(t.state.focused&&(Lt(t,"blur",t,e),t.state.focused=!1,Ea(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function zn(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r.005||l<-.005)&&(L(i.line,o),jn(i.line),i.rest))for(var u=0;u=a&&(o=I(e,yt(S(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Rn(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=_n(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;a(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!ga){var a=r("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Fe(t.display))+"px;\n height: "+(e.bottom-e.top+Ve(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(a),a.scrollIntoView(o),t.display.lineSpace.removeChild(a)}}}function Un(t,e,n,r){null==r&&(r=0);var i;t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?z(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?z(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=hn(t,e),l=n&&n!=e?hn(t,n):s,u=Hn(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=u.scrollTop&&(Kn(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&($n(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return i}function Vn(t,e){var n=Hn(t,e);null!=n.scrollTop&&Kn(t,n.scrollTop),null!=n.scrollLeft&&$n(t,n.scrollLeft)}function Hn(t,e){var n=t.display,r=yn(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=qe(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Be(n),l=e.tops-r;if(e.topi+o){var c=Math.min(e.top,(u?s:e.bottom)-o);c!=i&&(a.scrollTop=c)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,f=He(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),d=e.right-e.left>f;return d&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.leftf+h-3&&(a.scrollLeft=e.right+(d?0:10)-f),a}function qn(t,e){null!=e&&(Xn(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Wn(t){Xn(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Gn(t,e,n){null==e&&null==n||Xn(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Yn(t,e){Xn(t),t.curOp.scrollToPos=e}function Xn(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Zn(t,fn(t,e.from),fn(t,e.to),e.margin))}function Zn(t,e,n,r){var i=Hn(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Gn(t,i.scrollLeft,i.scrollTop)}function Kn(t,e){Math.abs(t.doc.scrollTop-e)<2||(oa||Er(t,{top:e}),Jn(t,e,!0),oa&&Er(t),_r(t,100))}function Jn(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function $n(t,e,n,r){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,Rn(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Qn(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Be(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ve(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function tr(t,e){e||(e=Qn(t));var n=t.display.barWidth,r=t.display.barHeight;er(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&zn(t),er(t,Qn(t)),n=t.display.barWidth,r=t.display.barHeight}function er(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}function nr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ea(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new ps[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ga(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?$n(t,e):Kn(t,e)},t),t.display.scrollbars.addClass&&s(t.display.wrapper,t.display.scrollbars.addClass)}function rr(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ms},be(t.curOp)}function ir(t){we(t.curOp,function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new vs(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function sr(t){t.updatedDisplay=t.mustUpdate&&Ar(t.cm,t.update)}function lr(t){var e=t.cm,n=e.display;t.updatedDisplay&&zn(e),t.barMeasure=Qn(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Xe(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Ve(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-He(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection(t.focus))}function ur(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLefte)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Va&&pt(t.doc,e)i.viewFrom?gr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)gr(t);else if(e<=i.viewFrom){var o=yr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):gr(t)}else if(n>=i.viewTo){var a=yr(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):gr(t)}else{var s=yr(t,e,e,-1),l=yr(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(xe(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):gr(t)}var u=i.externalMeasured;u&&(n=i.lineN&&e=r.viewTo)){var o=r.view[Tn(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==f(a,n)&&a.push(n)}}}function gr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function yr(t,e,n,r){var i,o=Tn(t,e),a=t.display.view;if(!Va||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;pt(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function xr(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=xe(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=xe(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Tn(t,n)))),r.viewTo=n}function br(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo)){var n=+new Date+t.options.workTime,r=Qt(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Xt(e.mode,r.state):null,l=Jt(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&fn)return _r(t,t.options.workDelay),!0}),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&hr(t,function(){for(var e=0;e=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==br(t))return!1;Fn(t)&&(gr(t),n.dims=bn(t));var o=i.first+i.size,a=Math.max(n.visible.from-t.options.viewportMargin,i.first),s=Math.min(o,n.visible.to+t.options.viewportMargin);r.viewFroms&&r.viewTo-s<20&&(s=Math.min(o,r.viewTo)),Va&&(a=pt(t.doc,a),s=mt(t.doc,s));var l=a!=r.viewFrom||s!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;xr(t,a,s),r.viewOffset=yt(S(t.doc,r.viewFrom)),t.display.mover.style.top=r.viewOffset+"px";var u=br(t);if(!l&&0==u&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=kr(t);return u>4&&(r.lineDiv.style.display="none"),Cr(t,r.updateLineNumbers,n.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Tr(c),e(r.cursorDiv),e(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,_r(t,400)),r.updateLineNumbers=null,!0}function Sr(t,e){for(var n=e.viewport,r=!0;(r&&t.options.lineWrapping&&e.oldDisplayWidth!=He(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Be(t.display)-qe(t),n.top)}),e.visible=Nn(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&Ar(t,e);r=!1){zn(t);var i=Qn(t);An(t),tr(t,i),Pr(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Er(t,e){var n=new vs(t,e);if(Ar(t,n)){zn(t),Sr(t,n);var r=Qn(t);An(t),tr(t,r),Pr(t,r),n.finish()}}function Cr(t,n,r){function i(e){var n=e.nextSibling;return ha&&_a&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var o=t.display,a=t.options.lineNumbers,s=o.lineDiv,l=s.firstChild,u=o.view,c=o.viewFrom,h=0;h-1&&(p=!1),Te(t,d,c,r)),p&&(e(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(D(t.options,c)))),l=d.node.nextSibling}else{var m=Oe(t,d,c,r);s.insertBefore(m,l)}c+=d.size}for(;l;)l=i(l)}function Lr(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function Pr(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Ve(t)+"px"}function Ir(t){var n=t.display.gutters,i=t.options.gutters;e(n);for(var o=0;o-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}function Dr(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function zr(t){var e=Dr(t);return e.x*=ys,e.y*=ys,e}function jr(t,e){var n=Dr(e),r=n.x,i=n.y,o=t.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(r&&s||i&&l){if(i&&_a&&ha)t:for(var u=e.target,c=o.view;u!=a;u=u.parentNode)for(var h=0;h=0){var a=B(o.from(),i.from()),s=F(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;r<=e&&--e,t.splice(--r,2,new bs(l?s:a,l?a:s))}}return new xs(t,e)}function Rr(t,e){return new xs([new bs(t,e||t)],0)}function Fr(t){return t.text?z(t.from.line+t.text.length-1,m(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Br(t,e){if(j(t,e.from)<0)return t;if(j(t,e.to)<=0)return Fr(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Fr(e).ch-e.to.ch),z(n,r)}function Ur(t,e){for(var n=[],r=0;r1&&t.remove(s.line+1,p-1),t.insert(s.line+1,y)}Me(t,"change",t,e)}function Xr(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a1&&!t.done[t.done.length-2].ranges?(t.done.pop(),m(t.done)):void 0}function ni(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&i.lastModTime>s-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=ei(i,i.lastOp==r)))a=m(o.changes),0==j(e.from,e.to)&&0==j(e.from,a.to)?a.to=Fr(e):o.changes.push(Qr(t,e));else{var l=m(i.done);for(l&&l.ranges||oi(t.sel,i.done),o={changes:[Qr(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||Lt(t,"historyAdded")}function ri(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function ii(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ri(t,o,m(i.done),e))?i.done[i.done.length-1]=e:oi(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&ti(i.undone)}function oi(t,e){var n=m(e);n&&n.ranges&&n.equals(t)||e.push(t)}function ai(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o})}function si(t){if(!t)return null;for(var e,n=0;n-1&&(m(s)[h]=u[h],delete u[h])}}}return r}function hi(t,e,n,r){if(r){var i=t.anchor;if(n){var o=j(e,i)<0;o!=j(n,i)<0?(i=e,e=n):o!=j(e,n)<0&&(e=n)}return new bs(i,e)}return new bs(n||e,e)}function fi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),yi(t,new xs([hi(t.sel.primary(),e,n,i)],0),r)}function di(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(i&&(Lt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var u=l.find(r<0?1:-1),c=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(u=Ti(t,u,-r,u&&u.line==e.line?o:null)),u&&u.line==e.line&&(c=j(u,n))&&(r<0?c<0:c>0))return Mi(t,u,e,r,i)}var h=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(h=Ti(t,h,r,h.line==e.line?o:null)),h?Mi(t,h,e,r,i):null}}return e}function ki(t,e,n,r,i){var o=r||1,a=Mi(t,e,n,o,i)||!i&&Mi(t,e,n,o,!0)||Mi(t,e,n,-o,i)||!i&&Mi(t,e,n,-o,!0);return a||(t.cantEdit=!0,z(t.first,0))}function Ti(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?V(t,z(e.line-1)):null:n>0&&e.ch==(r||S(t,e.line)).text.length?e.line=0;--i)Ci(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text});else Ci(t,e)}}function Ci(t,e){if(1!=e.text.length||""!=e.text[0]||0!=j(e.from,e.to)){var n=Ur(t,e);ni(t,e,n,t.cm?t.cm.curOp.id:NaN),Ii(t,e,n,Q(t,e));var r=[];Xr(t,function(t,n){n||-1!=f(r,t.history)||(Ni(t.history,e),r.push(t.history)),Ii(t,e,null,Q(t,e))})}}function Li(t,e,n){if(!t.cm||!t.cm.state.suppressEdits||n){for(var r,i=t.history,o=t.sel,a="undo"==e?i.done:i.undone,s="undo"==e?i.undone:i.done,l=0;l=0;--h){var d=function(n){var i=r.changes[n];if(i.origin=e,c&&!Si(t,i,!1))return a.length=0,{};u.push(Qr(t,i));var o=n?Ur(t,i):m(a);Ii(t,i,o,ui(t,i)),!n&&t.cm&&t.cm.scrollIntoView({from:i.from,to:Fr(i)});var s=[];Xr(t,function(t,e){e||-1!=f(s,t.history)||(Ni(t.history,i),s.push(t.history)),Ii(t,i,null,ui(t,i))})}(h);if(d)return d.v}}}}function Pi(t,e){if(0!=e&&(t.first+=e,t.sel=new xs(v(t.sel.ranges,function(t){return new bs(z(t.anchor.line+e,t.anchor.ch),z(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){mr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:z(o,S(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=E(t,e.from,e.to),n||(n=Ur(t,e)),t.cm?Oi(t.cm,e,r):Yr(t,e,r),xi(t,n,za)}}function Oi(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=P(ht(S(r,o.line))),r.iter(l,a.line+1,function(t){if(t==i.maxLine)return s=!0,!0})),r.sel.contains(e.from,e.to)>-1&&It(t),Yr(r,e,n,wn(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,function(t){var e=xt(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)}),s&&(t.curOp.updateMaxLine=!0)),se(r,o.line),_r(t,400);var u=e.text.length-(a.line-o.line)-1;e.full?mr(t):o.line!=a.line||1!=e.text.length||Gr(t.doc,e)?mr(t,o.line,a.line+1,u):vr(t,o.line,"text");var c=Ot(t,"changes"),h=Ot(t,"change");if(h||c){var f={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};h&&Me(t,"change",t,f),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(f)}t.display.selForContextMenu=null}function Di(t,e,n,r,i){if(r||(r=n),j(r,n)<0){var o=r;r=n,n=o}"string"==typeof e&&(e=t.splitLines(e)),Ei(t,{from:n,to:r,text:e,origin:i})}function zi(t,e,n,r){n0||0==s&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ct(t,e.line,e,n,a)||e.line!=n.line&&ct(t,n.line,e,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");G()}a.addToHistory&&ni(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var l,u=e.line,h=t.cm;if(t.iter(u,n.line+1,function(t){h&&a.collapsed&&!h.options.lineWrapping&&ht(t)==h.display.maxLine&&(l=!0),a.collapsed&&u!=e.line&&L(t,0),K(t,new Y(a,u==e.line?e.ch:null,u==n.line?n.ch:null)),++u}),a.collapsed&&t.iter(e.line,n.line+1,function(e){vt(t,e)&&L(e,0)}),a.clearOnEnter&&Ga(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(W(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),a.collapsed&&(a.id=++ws,a.atomic=!0),h){if(l&&(h.curOp.updateMaxLine=!0),a.collapsed)mr(h,e.line,n.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=e.line;f<=n.line;f++)vr(h,f,"text");a.atomic&&_i(h.doc),Me(h,"markerAdded",h,a)}return a}function qi(t,e,n,r,i){(r=c(r)).shared=!1;var o=[Hi(t,e,n,r,i)],a=o[0],s=r.widgetNode;return Xr(t,function(t){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Hi(t,V(t,e),V(t,n),r,i));for(var l=0;l-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var l=t.dataTransfer.getData("Text");if(l){var u;if(e.state.draggingText&&!e.state.draggingText.copy&&(u=e.listSelections()),xi(e.doc,Rr(n,n)),u)for(var c=0;c=0;e--)Di(t.doc,"",r[e].from,r[e].to,"+delete");Wn(t)})}function co(t,e){var n=S(t.doc,e),r=ht(n);return r!=n&&(e=P(r)),At(!0,t,r,e,1)}function ho(t,e){var n=S(t.doc,e),r=ft(n);return r!=n&&(e=P(r)),At(!0,t,n,e,-1)}function fo(t,e){var n=co(t,e.line),r=S(t.doc,n.line),i=Mt(r,t.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return z(n.line,a?0:o,n.sticky)}return n}function po(t,e,n){if("string"==typeof e&&!(e=Ds[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),i=e(t)!=Da}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}function mo(t,e,n){for(var r=0;r-1&&(j((i=s.ranges[i]).from(),e)<0||e.xRel>0)&&(j(i.to(),e)>0||e.xRel<0)?Eo(t,r,e,o):Lo(t,r,e,o)}function Eo(t,e,n,r){var i=t.display,o=!1,a=fr(t,function(e){ha&&(i.scroller.draggable=!1),t.state.draggingText=!1,Ct(document,"mouseup",a),Ct(document,"mousemove",s),Ct(i.scroller,"dragstart",l),Ct(i.scroller,"drop",a),o||(zt(e),r.addNew||fi(t.doc,n,null,null,r.extend),ha||ua&&9==ca?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),s=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},l=function(){return o=!0};ha&&(i.scroller.draggable=!0),t.state.draggingText=a,a.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Ga(document,"mouseup",a),Ga(document,"mousemove",s),Ga(i.scroller,"dragstart",l),Ga(i.scroller,"drop",a),In(t),setTimeout(function(){return i.input.focus()},20)}function Co(t,e,n){if("char"==n)return new bs(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new bs(z(e.line,0),V(t.doc,z(e.line+1,0)));var r=n(t,e);return new bs(r.from,r.to)}function Lo(t,e,n,r){function i(e){if(0!=j(g,e))if(g=e,"rectangle"==r.unit){for(var i=[],o=t.options.tabSize,a=h(S(u,n.line).text,n.ch,o),s=h(S(u,e.line).text,e.ch,o),l=Math.min(a,s),m=Math.max(a,s),v=Math.min(n.line,e.line),y=Math.min(t.lastLine(),Math.max(n.line,e.line));v<=y;v++){var x=S(u,v).text,b=d(x,l,o);l==m?i.push(new bs(z(v,b),z(v,b))):x.length>b&&i.push(new bs(z(v,b),z(v,d(x,m,o))))}i.length||i.push(new bs(n,n)),yi(u,Nr(p.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var _,w=c,M=Co(t,e,r.unit),k=w.anchor;j(M.anchor,k)>0?(_=M.head,k=B(w.from(),M.anchor)):(_=M.anchor,k=F(w.to(),M.head));var T=p.ranges.slice(0);T[f]=new bs(V(u,k),_),yi(u,Nr(T,f),ja)}}function o(e){var n=++x,s=kn(t,e,!0,"rectangle"==r.unit);if(s)if(0!=j(s,g)){t.curOp.focus=a(),i(s);var c=Nn(l,u);(s.line>=c.to||s.liney.bottom?20:0;h&&setTimeout(fr(t,function(){x==n&&(l.scroller.scrollTop+=h,o(e))}),50)}}function s(e){t.state.selectingText=!1,x=1/0,zt(e),l.input.focus(),Ct(document,"mousemove",b),Ct(document,"mouseup",_),u.history.lastSelOrigin=null}var l=t.display,u=t.doc;zt(e);var c,f,p=u.sel,m=p.ranges;if(r.addNew&&!r.extend?(f=u.sel.contains(n),c=f>-1?m[f]:new bs(n,n)):(c=u.sel.primary(),f=u.sel.primIndex),"rectangle"==r.unit)r.addNew||(c=new bs(n,n)),n=kn(t,e,!0,!0),f=-1;else{var v=Co(t,n,r.unit);c=r.extend?hi(c,v.anchor,v.head,r.extend):v}r.addNew?-1==f?(f=m.length,yi(u,Nr(m.concat([c]),f),{scroll:!1,origin:"*mouse"})):m.length>1&&m[f].empty()&&"char"==r.unit&&!r.extend?(yi(u,Nr(m.slice(0,f).concat(m.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):pi(u,f,c,ja):(f=0,yi(u,new xs([c],0),ja),p=u.sel);var g=n,y=l.wrapper.getBoundingClientRect(),x=0,b=fr(t,function(t){Bt(t)?o(t):s(t)}),_=fr(t,s);t.state.selectingText=_,Ga(document,"mousemove",b),Ga(document,"mouseup",_)}function Po(t,e,n,r){var i,o;try{i=e.clientX,o=e.clientY}catch(e){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&zt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ot(t,n))return Nt(e);o-=s.top-a.viewOffset;for(var l=0;l=i)return Lt(t,n,t,I(t.doc,o),t.options.gutters[l],e),Nt(e)}}function Io(t,e){return Po(t,e,"gutterClick",!0)}function Oo(t,e){Re(t.display,e)||Do(t,e)||Pt(t,e,"contextmenu")||t.display.input.onContextMenu(e)}function Do(t,e){return!!Ot(t,"gutterContextMenu")&&Po(t,e,"gutterContextMenu",!1)}function zo(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),on(t)}function jo(t){Ir(t),mr(t),Rn(t)}function No(t,e,n){if(!e!=!(n&&n!=Bs)){var r=t.display.dragFunctions,i=e?Ga:Ct;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function Ro(t){t.options.lineWrapping?(s(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(Ea(t.display.wrapper,"CodeMirror-wrap"),bt(t)),Mn(t),mr(t),on(t),setTimeout(function(){return tr(t)},100)}function Fo(t,e){var n=this;if(!(this instanceof Fo))return new Fo(t,e);this.options=e=e?c(e):{},c(Us,e,!1),Or(e);var r=e.value;"string"==typeof r&&(r=new As(r,e.mode,null,e.lineSeparator,e.direction)),this.doc=r;var i=new Fo.inputStyles[e.inputStyle](this),o=this.display=new A(t,r,i);o.wrapper.CodeMirror=this,Ir(this),zo(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),nr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new La,keySeq:null,specialChars:null},e.autofocus&&!ba&&o.input.focus(),ua&&ca<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Bo(this),Qi(),rr(this),this.curOp.forceUpdate=!0,Zr(this,r),e.autofocus&&!ba||this.hasFocus()?setTimeout(u(On,this),20):Dn(this);for(var a in Vs)Vs.hasOwnProperty(a)&&Vs[a](n,e[a],Bs);Fn(this),e.finishInit&&e.finishInit(this);for(var s=0;s400}var i=t.display;Ga(i.scroller,"mousedown",fr(t,ko)),ua&&ca<11?Ga(i.scroller,"dblclick",fr(t,function(e){if(!Pt(t,e)){var n=kn(t,e);if(n&&!Io(t,e)&&!Re(t.display,e)){zt(e);var r=t.findWordAt(n);fi(t.doc,r.anchor,r.head)}}})):Ga(i.scroller,"dblclick",function(e){return Pt(t,e)||zt(e)}),Sa||Ga(i.scroller,"contextmenu",function(e){return Oo(t,e)});var o,a={end:0};Ga(i.scroller,"touchstart",function(e){if(!Pt(t,e)&&!n(e)){i.input.ensurePolled(),clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==e.touches.length&&(i.activeTouch.left=e.touches[0].pageX,i.activeTouch.top=e.touches[0].pageY)}}),Ga(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ga(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Re(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,s=t.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new bs(s,s):!o.prev.prev||r(o,o.prev.prev)?t.findWordAt(s):new bs(z(s.line,0),V(t.doc,z(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),zt(n)}e()}),Ga(i.scroller,"touchcancel",e),Ga(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Kn(t,i.scroller.scrollTop),$n(t,i.scroller.scrollLeft,!0),Lt(t,"scroll",t))}),Ga(i.scroller,"mousewheel",function(e){return jr(t,e)}),Ga(i.scroller,"DOMMouseScroll",function(e){return jr(t,e)}),Ga(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(e){Pt(t,e)||Rt(e)},over:function(e){Pt(t,e)||(Ki(t,e),Rt(e))},start:function(e){return Zi(t,e)},drop:fr(t,Xi),leave:function(e){Pt(t,e)||Ji(t)}};var s=i.input.getField();Ga(s,"keyup",function(e){return _o.call(t,e)}),Ga(s,"keydown",fr(t,xo)),Ga(s,"keypress",fr(t,wo)),Ga(s,"focus",function(e){return On(t,e)}),Ga(s,"blur",function(e){return Dn(t,e)})}function Uo(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Qt(t,e).state:n="prev");var a=t.options.tabSize,s=S(o,e),l=h(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==Da||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?h(S(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var f="",d=0;if(t.options.indentWithTabs)for(var m=Math.floor(u/a);m;--m)d+=a,f+="\t";if(d1)if(qs&&qs.text.join("\n")==e){if(r.ranges.length%qs.text.length==0){l=[];for(var u=0;u=0;h--){var f=r.ranges[h],d=f.from(),p=f.to();f.empty()&&(n&&n>0?d=z(d.line,d.ch-n):t.state.overwrite&&!a?p=z(p.line,Math.min(S(o,p.line).text.length,p.ch+m(s).length)):qs&&qs.lineWise&&qs.text.join("\n")==e&&(d=p=z(d.line,0))),c=t.curOp.updateInput;var g={from:d,to:p,text:l?l[h%l.length]:s,origin:i||(a?"paste":t.state.cutIncoming?"cut":"+input")};Ei(t.doc,g),Me(t,"inputRead",t,g)}e&&!a&&Wo(t,e),Wn(t),t.curOp.updateInput=c,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function qo(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||hr(e,function(){return Ho(e,n,0,null,"paste")}),!0}function Wo(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Uo(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(S(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Uo(t,i.head.line,"smart"));a&&Me(t,"electricInput",t,i.head.line)}}}function Go(t){for(var e=[],n=[],r=0;r=t.first+t.size)&&(e=new z(r,e.ch,e.sticky),u=S(t,r))}function a(r){var a;if(null==(a=i?St(t.cm,u,e,n):Tt(u,e,n))){if(r||!o())return!1;e=At(i,t.cm,u,e.line,n)}else e=a;return!0}var s=e,l=n,u=S(t,e.line);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var c=null,h="group"==r,f=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||a(!d);d=!1){var p=u.text.charAt(e.ch)||"\n",m=_(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||m||(m="s"),c&&c!=m){n<0&&(n=1,a(),e.sticky="after");break}if(m&&(c=m),n>0&&!a(!d))break}var v=ki(t,e,s,l,!0);return N(s,v)&&(v.hitSide=!0),v}function Ko(t,e,n,r){var i,o=t.doc,a=e.left;if("page"==r){var s=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*yn(t.display),3);i=(n>0?e.bottom:e.top)+n*l}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(var u;(u=pn(t,a,i)).outside;){if(n<0?i<=0:i>=o.height){u.hitSide=!0;break}i+=5*n}return u}function Jo(t,e){var n=Ze(t,e.line);if(!n||n.hidden)return null;var r=S(t.doc,e.line),i=Ge(n,r,e.line),o=Mt(r,t.doc.direction),a="left";o&&(a=wt(o,e.ch)%2?"right":"left");var s=$e(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function $o(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function Qo(t,e){return e&&(t.bad=!0),t}function ta(t,e,n,r,i){function o(t){return function(e){return e.id==t}}function a(){c&&(u+=h,c=!1)}function s(t){t&&(a(),u+=t)}function l(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(null!=n)return void s(n||e.textContent.replace(/\u200b/g,""));var u,f=e.getAttribute("cm-marker");if(f){var d=t.findMarks(z(r,0),z(i+1,0),o(+f));return void(d.length&&(u=d[0].find())&&s(E(t.doc,u.from,u.to).join(h)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(e.nodeName);p&&a();for(var m=0;m=15&&(pa=!1,ha=!0);var Ta,Aa=_a&&(fa||pa&&(null==ka||ka<12.11)),Sa=oa||ua&&ca>=9,Ea=function(e,n){var r=e.className,i=t(n).exec(r);if(i){var o=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(o?i[1]+o:"")}};Ta=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var Ca=function(t){t.select()};ya?Ca=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:ua&&(Ca=function(t){try{t.select()}catch(t){}});var La=function(){this.id=null};La.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var Pa,Ia,Oa=30,Da={toString:function(){return"CodeMirror.Pass"}},za={scroll:!1},ja={origin:"*mouse"},Na={origin:"+move"},Ra=[""],Fa=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ba=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Ua=!1,Va=!1,Ha=null,qa=function(){function t(t){return t<=247?n.charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?r.charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t,this.from=e,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/;return function(n,r){var u="ltr"==r?"L":"R";if(0==n.length||"ltr"==r&&!i.test(n))return!1;for(var c=n.length,h=[],f=0;f=this.string.length},es.prototype.sol=function(){return this.pos==this.lineStart},es.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},es.prototype.next=function(){if(this.pose},es.prototype.eatSpace=function(){for(var t=this,e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++t.pos;return this.pos>e},es.prototype.skipToEnd=function(){this.pos=this.string.length},es.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},es.prototype.backUp=function(t){this.pos-=t},es.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},es.prototype.current=function(){return this.string.slice(this.start,this.pos)},es.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},es.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)};var ns=function(t,e){this.state=t,this.lookAhead=e},rs=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0};rs.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},rs.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},rs.fromSaved=function(t,e,n){return e instanceof ns?new rs(t,Xt(t.mode,e.state),n,e.lookAhead):new rs(t,Xt(t.mode,e),n)},rs.prototype.save=function(t){var e=!1!==t?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ns(e,this.maxLookAhead):e};var is=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n},os=function(t,e,n){this.text=t,rt(this,e),this.height=n?n(this):1};os.prototype.lineNo=function(){return P(this)},Dt(os);var as,ss={},ls={},us=null,cs=null,hs={left:0,right:0,top:0,bottom:0},fs=function(t,e,n){this.cm=n;var i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(i),t(o),Ga(i,"scroll",function(){i.clientHeight&&e(i.scrollTop,"vertical")}),Ga(o,"scroll",function(){o.clientWidth&&e(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ua&&ca<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};fs.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},fs.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},fs.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},fs.prototype.zeroWidthHack=function(){var t=_a&&!va?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new La,this.disableVert=new La},fs.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}t.style.pointerEvents="auto",e.set(1e3,r)},fs.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var ds=function(){};ds.prototype.update=function(){return{bottom:0,right:0}},ds.prototype.setScrollLeft=function(){},ds.prototype.setScrollTop=function(){},ds.prototype.clear=function(){};var ps={native:fs,null:ds},ms=0,vs=function(t,e,n){var r=t.display;this.viewport=e,this.visible=Nn(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=He(t),this.force=n,this.dims=bn(t),this.events=[]};vs.prototype.signal=function(t,e){Ot(t,e)&&this.events.push(arguments)},vs.prototype.finish=function(){for(var t=this,e=0;e=0&&j(t,i.to())<=0)return r}return-1};var bs=function(t,e){this.anchor=t,this.head=e};bs.prototype.from=function(){return B(this.anchor,this.head)},bs.prototype.to=function(){return F(this.anchor,this.head)},bs.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Fi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=this,r=t,i=t+e;r1||!(this.children[0]instanceof Fi))){var l=[];this.collapse(l),this.children=[new Fi(l)],this.children[0].parent=this}},collapse:function(t){for(var e=this,n=0;n50){for(var s=o.lines.length%25+25,l=s;l10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=this,i=0;ie.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&mr(e,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&_i(e.doc)),e&&Me(e,"markerCleared",e,this,i,o),n&&ir(e),this.parent&&this.parent.clear()}},Ms.prototype.find=function(t,e){var n=this;null==t&&"bookmark"==this.type&&(t=1);for(var r,i,o=0;o=0;u--)Ei(r,i[u]);l?gi(this,l):this.cm&&Wn(this.cm)}),undo:pr(function(){Li(this,"undo")}),redo:pr(function(){Li(this,"redo")}),undoSelection:pr(function(){Li(this,"undo",!0)}),redoSelection:pr(function(){Li(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=V(this,t),e=V(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=o,++n}),V(this,z(n,e))},indexFromPos:function(t){var e=(t=V(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to0)i=new z(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),z(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=S(t.doc,i.line-1).text;a&&(i=new z(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),z(i.line-1,a.length-1),i,"+transpose"))}n.push(new bs(i,i))}t.setSelections(n)})},newlineAndIndent:function(t){return hr(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;rt&&0==j(e,this.pos)&&n==this.button};var Rs,Fs,Bs={toString:function(){return"CodeMirror.Init"}},Us={},Vs={};Fo.defaults=Us,Fo.optionHandlers=Vs;var Hs=[];Fo.defineInitHook=function(t){return Hs.push(t)};var qs=null,Ws=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new La,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ws.prototype.init=function(t){function e(t){if(!Pt(i,t)){if(i.somethingSelected())Vo({lineWise:!1,text:i.getSelections()}),"cut"==t.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var e=Go(i);Vo({lineWise:!0,text:e.text}),"cut"==t.type&&i.operation(function(){i.setSelections(e.ranges,0,za),i.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=qs.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var a=Xo(),s=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),s.value=qs.text.join("\n");var l=document.activeElement;Ca(s),setTimeout(function(){i.display.lineSpace.removeChild(a),l.focus(),l==o&&r.showPrimarySelection()},50)}}var n=this,r=this,i=r.cm,o=r.div=t.lineDiv;Yo(o,i.options.spellcheck),Ga(o,"paste",function(t){Pt(i,t)||qo(t,i)||ca<=11&&setTimeout(fr(i,function(){return n.updateFromDOM()}),20)}),Ga(o,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),Ga(o,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),Ga(o,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Ga(o,"touchstart",function(){return r.forceCompositionEnd()}),Ga(o,"input",function(){n.composing||n.readFromDOMSoon()}),Ga(o,"copy",e),Ga(o,"cut",e)},Ws.prototype.prepareSelection=function(){var t=Sn(this.cm,!1);return t.focus=this.cm.state.focused,t},Ws.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Ws.prototype.showPrimarySelection=function(){var t=window.getSelection(),e=this.cm,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(e.display.viewTo==e.display.viewFrom||r.line>=e.display.viewTo||i.line=e.display.viewFrom&&Jo(e,r)||{node:s[0].measure.map[2],offset:0},u=i.linet.firstLine()&&(r=z(r.line-1,S(t.doc,r.line-1).length)),i.ch==S(t.doc,i.line).text.length&&i.linee.viewTo-1)return!1;var o,a,s;r.line==e.viewFrom||0==(o=Tn(t,r.line))?(a=P(e.view[0].line),s=e.view[0].node):(a=P(e.view[o].line),s=e.view[o-1].node.nextSibling);var l,u,c=Tn(t,i.line);if(c==e.view.length-1?(l=e.viewTo-1,u=e.lineDiv.lastChild):(l=P(e.view[c+1].line)-1,u=e.view[c+1].node.previousSibling),!s)return!1;for(var h=t.doc.splitLines(ta(t,s,u,a,l)),f=E(t.doc,z(a,0),z(l,S(t.doc,l).text.length));h.length>1&&f.length>1;)if(m(h)==m(f))h.pop(),f.pop(),l--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),a++}for(var d=0,p=0,v=h[0],g=f[0],y=Math.min(v.length,g.length);dr.ch&&x.charCodeAt(x.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=x.slice(0,x.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var w=z(a,d),M=z(l,f.length?m(f).length-p:0);return h.length>1||h[0]||j(w,M)?(Di(t.doc,h,w,M,"+input"),!0):void 0},Ws.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ws.prototype.reset=function(){this.forceCompositionEnd()},Ws.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ws.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},Ws.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||hr(this.cm,function(){return mr(t.cm)})},Ws.prototype.setUneditable=function(t){t.contentEditable="false"},Ws.prototype.onKeyPress=function(t){0!=t.charCode&&(t.preventDefault(),this.cm.isReadOnly()||fr(this.cm,Ho)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Ws.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Ws.prototype.onContextMenu=function(){},Ws.prototype.resetPosition=function(){},Ws.prototype.needsContentAttribute=!0;var Gs=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new La,this.hasSelection=!1,this.composing=null};Gs.prototype.init=function(t){function e(t){if(!Pt(i,t)){if(i.somethingSelected())Vo({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Go(i);Vo({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,za):(r.prevInput="",a.value=e.text.join("\n"),Ca(a))}"cut"==t.type&&(i.state.cutIncoming=!0)}}var n=this,r=this,i=this.cm,o=this.wrapper=Xo(),a=this.textarea=o.firstChild;t.wrapper.insertBefore(o,t.wrapper.firstChild),ya&&(a.style.width="0px"),Ga(a,"input",function(){ua&&ca>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()}),Ga(a,"paste",function(t){Pt(i,t)||qo(t,i)||(i.state.pasteIncoming=!0,r.fastPoll())}),Ga(a,"cut",e),Ga(a,"copy",e),Ga(t.scroller,"paste",function(e){Re(t,e)||Pt(i,e)||(i.state.pasteIncoming=!0,r.focus())}),Ga(t.lineSpace,"selectstart",function(e){Re(t,e)||zt(e)}),Ga(a,"compositionstart",function(){var t=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ga(a,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Gs.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Sn(t);if(t.options.moveInputWithCursor){var i=hn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Gs.prototype.showSelection=function(t){var e=this.cm.display;n(e.cursorDiv,t.cursors),n(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Gs.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&Ca(this.textarea),ua&&ca>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",ua&&ca>=9&&(this.hasSelection=null))}},Gs.prototype.getField=function(){return this.textarea},Gs.prototype.supportsTouch=function(){return!1},Gs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!ba||a()!=this.textarea))try{this.textarea.focus()}catch(t){}},Gs.prototype.blur=function(){this.textarea.blur()},Gs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Gs.prototype.receivedFocus=function(){this.slowPoll()},Gs.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},Gs.prototype.fastPoll=function(){function t(){n.poll()||e?(n.pollingFast=!1,n.slowPoll()):(e=!0,n.polling.set(60,t))}var e=!1,n=this;n.pollingFast=!0,n.polling.set(20,t)},Gs.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Za(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(ua&&ca>=9&&this.hasSelection===i||_a&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(r.length,i.length);a1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Gs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Gs.prototype.onKeyPress=function(){ua&&ca>=9&&(this.hasSelection=null),this.fastPoll()},Gs.prototype.onContextMenu=function(t){function e(){if(null!=a.selectionStart){var t=i.somethingSelected(),e="​"+(t?a.value:"");a.value="⇚",a.value=e,r.prevInput=t?"":"​",a.selectionStart=1,a.selectionEnd=e.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=c,a.style.cssText=u,ua&&ca<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=a.selectionStart){(!ua||ua&&ca<9)&&e();var t=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?fr(i,Ai)(i):t++<10?o.detectingSelectAll=setTimeout(n,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,s=kn(i,t),l=o.scroller.scrollTop;if(s&&!pa){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(s)&&fr(i,yi)(i.doc,Rr(s),za);var u=a.style.cssText,c=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var h=r.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-h.top-5)+"px; left: "+(t.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(ua?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(ha&&(f=window.scrollY),o.input.focus(),ha&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),ua&&ca>=9&&e(),Sa){Rt(t);var d=function(){Ct(window,"mouseup",d),setTimeout(n,20)};Ga(window,"mouseup",d)}else setTimeout(n,50)}},Gs.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},Gs.prototype.setUneditable=function(){},Gs.prototype.needsContentAttribute=!1,function(t){function e(e,r,i,o){t.defaults[e]=r,i&&(n[e]=o?function(t,e,n){n!=Bs&&i(t,e,n)}:i)}var n=t.optionHandlers;t.defineOption=e,t.Init=Bs,e("value","",function(t,e){return t.setValue(e)},!0),e("mode",null,function(t,e){t.doc.modeOption=e,qr(t)},!0),e("indentUnit",2,qr,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(t){Wr(t),on(t),mr(t)},!0),e("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter(function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(z(r,o))}r++});for(var i=n.length-1;i>=0;i--)Di(t.doc,e,n[i],z(n[i].line,n[i].ch+e.length))}}),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Bs&&t.refresh()}),e("specialCharPlaceholder",fe,function(t){return t.refresh()},!0),e("electricChars",!0),e("inputStyle",ba?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),e("rtlMoveVisually",!Ma),e("wholeLineUpdateBefore",!0),e("theme","default",function(t){zo(t),jo(t)},!0),e("keyMap","default",function(t,e,n){var r=lo(e),i=n!=Bs&&lo(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,Ro,!0),e("gutters",[],function(t){Or(t.options),jo(t)},!0),e("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?_n(t.display)+"px":"0",t.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(t){return tr(t)},!0),e("scrollbarStyle","native",function(t){nr(t),tr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),e("lineNumbers",!1,function(t){Or(t.options),jo(t)},!0),e("firstLineNumber",1,jo,!0),e("lineNumberFormatter",function(t){return t},jo,!0),e("showCursorWhenSelecting",!1,An,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("readOnly",!1,function(t,e){"nocursor"==e&&(Dn(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),e("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),e("dragDrop",!0,No),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,An,!0),e("singleCursorHeightPerLine",!0,An,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Wr,!0),e("addModeClass",!1,Wr,!0),e("pollInterval",100),e("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),e("historyEventDelay",1250),e("viewportMargin",10,function(t){return t.refresh()},!0),e("maxHighlightLength",1e4,Wr,!0),e("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),e("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),e("autofocus",null),e("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0)}(Fo),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&fr(this,e[t])(this,n,i),Lt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](lo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nr&&(Uo(e,o.head.line,t,!0),r=o.head.line,i==e.doc.sel.primIndex&&Wn(e));else{var a=o.from(),s=o.to(),l=Math.max(r,a.line);r=Math.min(e.lastLine(),s.line-(s.ch?0:1))+1;for(var u=l;u0&&pi(e.doc,i,new bs(a,c[i].to()),za)}}}),getTokenAt:function(t,e){return re(this,t,e)},getLineTokens:function(t,e){return re(this,z(t),e,!0)},getTokenTypeAt:function(t){t=V(this.doc,t);var e,n=$t(this,S(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(t=o,i=!0),r=S(this.doc,t)}else r=t;return ln(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-yt(r):0)},defaultTextHeight:function(){return yn(this.display)},defaultCharWidth:function(){return xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display,a=(t=hn(this,V(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==i?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&Vn(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:dr(xo),triggerOnKeyPress:dr(wo),triggerOnKeyUp:_o,triggerOnMouseDown:dr(ko),execCommand:function(t){if(Ds.hasOwnProperty(t))return Ds[t].call(null,this)},triggerElectric:dr(function(t){Wo(this,t)}),findPosH:function(t,e,n,r){var i=this,o=1;e<0&&(o=-1,e=-e);for(var a=V(this.doc,t),s=0;s0&&a(e.charAt(n-1));)--n;for(;r.5)&&Mn(this),Lt(this,"refresh",this)}),swapDoc:dr(function(t){var e=this.doc;return e.cm=null,Zr(this,t),on(this),this.display.input.reset(),Gn(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Me(this,"swapDoc",this,e),e}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Dt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}(Fo);var Ys="iter insert remove copy getEditor constructor".split(" ");for(var Xs in As.prototype)As.prototype.hasOwnProperty(Xs)&&f(Ys,Xs)<0&&(Fo.prototype[Xs]=function(t){return function(){return t.apply(this.doc,arguments)}}(As.prototype[Xs]));return Dt(As),Fo.inputStyles={textarea:Gs,contenteditable:Ws},Fo.defineMode=function(t){Fo.defaults.mode||"null"==t||(Fo.defaults.mode=t),qt.apply(this,arguments)},Fo.defineMIME=function(t,e){Qa[t]=e},Fo.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Fo.defineMIME("text/plain","null"),Fo.defineExtension=function(t,e){Fo.prototype[t]=e},Fo.defineDocExtension=function(t,e){As.prototype[t]=e},Fo.fromTextArea=function(t,e){function n(){t.value=l.getValue()}if(e=e?c(e):{},e.value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=a();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}var i;if(t.form&&(Ga(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var s=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=s}}catch(t){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ct(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var l=Fo(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return l},function(t){t.off=Ct,t.on=Ga,t.wheelEventPixels=zr,t.Doc=As,t.splitLines=Xa,t.countColumn=h,t.findColumn=d,t.isWordChar=b,t.Pass=Da,t.signal=Lt,t.Line=os,t.changeEnd=Fr,t.scrollbarModel=ps,t.Pos=z,t.cmpPos=j,t.modes=$a,t.mimeModes=Qa,t.resolveMode=Wt,t.getMode=Gt,t.modeExtensions=ts,t.extendMode=Yt,t.copyState=Xt,t.startState=Kt,t.innerMode=Zt,t.commands=Ds,t.keyMap=Os,t.keyName=so,t.isModifierKey=oo,t.lookupKey=io,t.normalizeKeyMap=ro,t.StringStream=es,t.SharedTextMarker=ks,t.TextMarker=Ms,t.LineWidget=_s,t.e_preventDefault=zt,t.e_stopPropagation=jt,t.e_stop=Rt,t.addClass=s,t.contains=o,t.rmClass=Ea,t.keyNames=Cs}(Fo),Fo.version="5.28.0",Fo})},{}],66:[function(t,e,n){!function(r){"object"==typeof n&&"object"==typeof e?r(t(65)):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)}(function(t){"use strict";function e(t,e,n){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}t.defineMode("javascript",function(n,r){function i(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function o(t,e,n){return Tt=t,At=n,e}function a(t,n){var r=t.next();if('"'==r||"'"==r)return n.tokenize=s(r),n.tokenize(t,n);if("."==r&&t.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==r&&t.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r);if("="==r&&t.eat(">"))return o("=>","operator");if("0"==r&&t.eat(/x/i))return t.eatWhile(/[\da-f]/i),o("number","number");if("0"==r&&t.eat(/o/i))return t.eatWhile(/[0-7]/i),o("number","number");if("0"==r&&t.eat(/b/i))return t.eatWhile(/[01]/i),o("number","number");if(/\d/.test(r))return t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==r)return t.eat("*")?(n.tokenize=l,l(t,n)):t.eat("/")?(t.skipToEnd(),o("comment","comment")):e(t,n,1)?(i(t),t.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(t.eatWhile(Dt),o("operator","operator",t.current()));if("`"==r)return n.tokenize=u,u(t,n);if("#"==r)return t.skipToEnd(),o("error","error");if(Dt.test(r))return">"==r&&n.lexical&&">"==n.lexical.type||t.eatWhile(Dt),o("operator","operator",t.current());if(It.test(r)){t.eatWhile(It);var a=t.current();if("."!=n.lastType){if(Ot.propertyIsEnumerable(a)){var c=Ot[a];return o(c.type,c.style,a)}if("async"==a&&t.match(/^\s*[\(\w]/,!1))return o("async","keyword",a)}return o("variable","variable",a)}}function s(t){return function(e,n){var r,i=!1;if(Ct&&"@"==e.peek()&&e.match(zt))return n.tokenize=a,o("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=t||i);)i=!i&&"\\"==r;return i||(n.tokenize=a),o("string","string")}}function l(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=a;break}r="*"==n}return o("comment","comment")}function u(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=a;break}r=!r&&"\\"==n}return o("quasi","string-2",t.current())}function c(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(Pt){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l=jt.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(It.test(s))o=!0;else{if(/["'\/]/.test(s))return;if(o&&!i){++a;break}}}o&&!i&&(e.fatArrowAt=a)}}function h(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function f(t,e){for(r=t.localVars;r;r=r.next)if(r.name==e)return!0;for(var n=t.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==e)return!0}function d(t,e,n,r,i){var o=t.cc;for(Rt.state=t,Rt.stream=i,Rt.marked=null,Rt.cc=o,Rt.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;)if((o.length?o.pop():Lt?M:w)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Rt.marked?Rt.marked:"variable"==n&&f(t,r)?"variable-2":e}}function p(){for(var t=arguments.length-1;t>=0;t--)Rt.cc.push(arguments[t])}function m(){return p.apply(null,arguments),!0}function v(t){function e(e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}var n=Rt.state;if(Rt.marked="def",n.context){if(e(n.localVars))return;n.localVars={name:t,next:n.localVars}}else{if(e(n.globalVars))return;r.globalVars&&(n.globalVars={name:t,next:n.globalVars})}}function g(){Rt.state.context={prev:Rt.state.context,vars:Rt.state.localVars},Rt.state.localVars=Ft}function y(){Rt.state.localVars=Rt.state.context.vars,Rt.state.context=Rt.state.context.prev}function x(t,e){var n=function(){var n=Rt.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new h(r,Rt.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function b(){var t=Rt.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function _(t){function e(n){return n==t?m():";"==t?p():m(e)}return e}function w(t,e){return"var"==t?m(x("vardef",e.length),$,_(";"),b):"keyword a"==t?m(x("form"),T,w,b):"keyword b"==t?m(x("form"),w,b):"{"==t?m(x("}"),W,b):";"==t?m():"if"==t?("else"==Rt.state.lexical.info&&Rt.state.cc[Rt.state.cc.length-1]==b&&Rt.state.cc.pop()(),m(x("form"),T,w,b,rt)):"function"==t?m(ut):"for"==t?m(x("form"),it,w,b):"variable"==t?Pt&&"type"==e?(Rt.marked="keyword",m(Y,_("operator"),Y,_(";"))):m(x("stat"),R):"switch"==t?m(x("form"),T,_("{"),x("}","switch"),W,b,b):"case"==t?m(M,_(":")):"default"==t?m(_(":")):"catch"==t?m(x("form"),g,_("("),ct,_(")"),w,b,y):"class"==t?m(x("form"),ft,b):"export"==t?m(x("stat"),vt,b):"import"==t?m(x("stat"),yt,b):"module"==t?m(x("form"),Q,_("{"),x("}"),W,b,b):"async"==t?m(w):"@"==e?m(M,w):p(x("stat"),M,_(";"),b)}function M(t){return A(t,!1)}function k(t){return A(t,!0)}function T(t){return"("!=t?p():m(x(")"),M,_(")"),b)}function A(t,e){if(Rt.state.fatArrowAt==Rt.stream.start){var n=e?D:O;if("("==t)return m(g,x(")"),H(Q,")"),b,_("=>"),n,y);if("variable"==t)return p(g,Q,_("=>"),n,y)}var r=e?L:C;return Nt.hasOwnProperty(t)?m(r):"function"==t?m(ut,r):"class"==t?m(x("form"),ht,b):"keyword c"==t||"async"==t?m(e?E:S):"("==t?m(x(")"),S,_(")"),b,r):"operator"==t||"spread"==t?m(e?k:M):"["==t?m(x("]"),Mt,b,r):"{"==t?q(B,"}",null,r):"quasi"==t?p(P,r):"new"==t?m(z(e)):m()}function S(t){return t.match(/[;\}\)\],]/)?p():p(M)}function E(t){return t.match(/[;\}\)\],]/)?p():p(k)}function C(t,e){return","==t?m(M):L(t,e,!1)}function L(t,e,n){var r=0==n?C:L,i=0==n?M:k;return"=>"==t?m(g,n?D:O,y):"operator"==t?/\+\+|--/.test(e)?m(r):"?"==e?m(M,_(":"),i):m(i):"quasi"==t?p(P,r):";"!=t?"("==t?q(k,")","call",r):"."==t?m(F,r):"["==t?m(x("]"),S,_("]"),b,r):Pt&&"as"==e?(Rt.marked="keyword",m(Y,r)):void 0:void 0}function P(t,e){return"quasi"!=t?p():"${"!=e.slice(e.length-2)?m(P):m(M,I)}function I(t){if("}"==t)return Rt.marked="string-2",Rt.state.tokenize=u,m(P)}function O(t){return c(Rt.stream,Rt.state),p("{"==t?w:M)}function D(t){return c(Rt.stream,Rt.state),p("{"==t?w:k)}function z(t){return function(e){return"."==e?m(t?N:j):p(t?k:M)}}function j(t,e){if("target"==e)return Rt.marked="keyword",m(C)}function N(t,e){if("target"==e)return Rt.marked="keyword",m(L)}function R(t){return":"==t?m(b,w):p(C,_(";"),b)}function F(t){if("variable"==t)return Rt.marked="property",m()}function B(t,e){return"async"==t?(Rt.marked="property",m(B)):"variable"==t||"keyword"==Rt.style?(Rt.marked="property",m("get"==e||"set"==e?U:V)):"number"==t||"string"==t?(Rt.marked=Ct?"property":Rt.style+" property",m(V)):"jsonld-keyword"==t?m(V):"modifier"==t?m(B):"["==t?m(M,_("]"),V):"spread"==t?m(M,V):":"==t?p(V):void 0}function U(t){return"variable"!=t?p(V):(Rt.marked="property",m(ut))}function V(t){return":"==t?m(k):"("==t?p(ut):void 0}function H(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=Rt.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),m(function(n,r){return n==e||r==e?p():p(t)},r)}return i==e||o==e?m():m(_(e))}return function(n,i){return n==e||i==e?m():p(t,r)}}function q(t,e,n){for(var r=3;r"==t)return m(Y)}function Z(t,e){return"variable"==t||"keyword"==Rt.style?(Rt.marked="property",m(Z)):"?"==e?m(Z):":"==t?m(Y):"["==t?m(M,G,_("]"),Z):void 0}function K(t){return"variable"==t?m(K):":"==t?m(Y):void 0}function J(t,e){return"<"==e?m(x(">"),H(Y,">"),b,J):"|"==e||"."==t?m(Y):"["==t?m(_("]"),J):"extends"==e?m(Y):void 0}function $(){return p(Q,G,et,nt)}function Q(t,e){return"modifier"==t?m(Q):"variable"==t?(v(e),m()):"spread"==t?m(Q):"["==t?q(Q,"]"):"{"==t?q(tt,"}"):void 0}function tt(t,e){return"variable"!=t||Rt.stream.match(/^\s*:/,!1)?("variable"==t&&(Rt.marked="property"),"spread"==t?m(Q):"}"==t?p():m(_(":"),Q,et)):(v(e),m(et))}function et(t,e){if("="==e)return m(k)}function nt(t){if(","==t)return m($)}function rt(t,e){if("keyword b"==t&&"else"==e)return m(x("form","else"),w,b)}function it(t){if("("==t)return m(x(")"),ot,_(")"),b)}function ot(t){return"var"==t?m($,_(";"),st):";"==t?m(st):"variable"==t?m(at):p(M,_(";"),st)}function at(t,e){return"in"==e||"of"==e?(Rt.marked="keyword",m(M)):m(C,st)}function st(t,e){return";"==t?m(lt):"in"==e||"of"==e?(Rt.marked="keyword",m(M)):p(M,_(";"),lt)}function lt(t){")"!=t&&m(M)}function ut(t,e){return"*"==e?(Rt.marked="keyword",m(ut)):"variable"==t?(v(e),m(ut)):"("==t?m(g,x(")"),H(ct,")"),b,G,w,y):Pt&&"<"==e?m(x(">"),H(Y,">"),b,ut):void 0}function ct(t){return"spread"==t?m(ct):p(Q,G,et)}function ht(t,e){return"variable"==t?ft(t,e):dt(t,e)}function ft(t,e){if("variable"==t)return v(e),m(dt)}function dt(t,e){return"<"==e?m(x(">"),H(Y,">"),b,dt):"extends"==e||"implements"==e||Pt&&","==t?m(Pt?Y:M,dt):"{"==t?m(x("}"),pt,b):void 0}function pt(t,e){return"variable"==t||"keyword"==Rt.style?("async"==e||"static"==e||"get"==e||"set"==e||Pt&&("public"==e||"private"==e||"protected"==e||"readonly"==e||"abstract"==e))&&Rt.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Rt.marked="keyword",m(pt)):(Rt.marked="property",m(Pt?mt:ut,pt)):"["==t?m(M,_("]"),Pt?mt:ut,pt):"*"==e?(Rt.marked="keyword",m(pt)):";"==t?m(pt):"}"==t?m():"@"==e?m(M,pt):void 0}function mt(t,e){return"?"==e?m(mt):":"==t?m(Y,et):"="==e?m(k):p(ut)}function vt(t,e){return"*"==e?(Rt.marked="keyword",m(wt,_(";"))):"default"==e?(Rt.marked="keyword",m(M,_(";"))):"{"==t?m(H(gt,"}"),wt,_(";")):p(w)}function gt(t,e){return"as"==e?(Rt.marked="keyword",m(_("variable"))):"variable"==t?p(k,gt):void 0}function yt(t){return"string"==t?m():p(xt,bt,wt)}function xt(t,e){return"{"==t?q(xt,"}"):("variable"==t&&v(e),"*"==e&&(Rt.marked="keyword"),m(_t))}function bt(t){if(","==t)return m(xt,bt)}function _t(t,e){if("as"==e)return Rt.marked="keyword",m(xt)}function wt(t,e){if("from"==e)return Rt.marked="keyword",m(M)}function Mt(t){return"]"==t?m():p(H(k,"]"))}function kt(t,e){return"operator"==t.lastType||","==t.lastType||Dt.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}var Tt,At,St=n.indentUnit,Et=r.statementIndent,Ct=r.jsonld,Lt=r.json||Ct,Pt=r.typescript,It=r.wordCharacters||/[\w$\xa1-\uffff]/,Ot=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("operator"),o={type:"atom",style:"atom"},a={if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:t("new"),delete:r,throw:r,debugger:r,var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r};if(Pt){var s={type:"variable",style:"type"},l={interface:t("class"),implements:r,namespace:r,module:t("module"),enum:t("module"),public:t("modifier"),private:t("modifier"),protected:t("modifier"),abstract:t("modifier"),string:s,number:s,boolean:s,any:s};for(var u in l)a[u]=l[u]}return a}(),Dt=/[+\-*&%=<>!?|~^@]/,zt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,jt="([{}])",Nt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Rt={state:null,column:null,marked:null,cc:null},Ft={name:"this",next:{name:"arguments"}};return b.lex=!0,{startState:function(t){var e={tokenize:a,lastType:"sof",cc:[],lexical:new h((t||0)-St,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:t||0};return r.globalVars&&"object"==typeof r.globalVars&&(e.globalVars=r.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),c(t,e)),e.tokenize!=l&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==Tt?n:(e.lastType="operator"!=Tt||"++"!=At&&"--"!=At?Tt:"incdec",d(e,n,Tt,At,t))},indent:function(e,n){if(e.tokenize==l)return t.Pass;if(e.tokenize!=a)return 0;var i,o=n&&n.charAt(0),s=e.lexical;if(!/^\s*else\b/.test(n))for(var u=e.cc.length-1;u>=0;--u){var c=e.cc[u];if(c==b)s=s.prev;else if(c!=rt)break}for(;("stat"==s.type||"form"==s.type)&&("}"==o||(i=e.cc[e.cc.length-1])&&(i==C||i==L)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;Et&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var h=s.type,f=o==h;return"vardef"==h?s.indented+("operator"==e.lastType||","==e.lastType?s.info+1:0):"form"==h&&"{"==o?s.indented:"form"==h?s.indented+St:"stat"==h?s.indented+(kt(e,n)?Et||St:0):"switch"!=s.info||f||0==r.doubleIndentSwitch?s.align?s.column+(f?0:1):s.indented+(f?0:St):s.indented+(/^(?:case|default)\b/.test(n)?St:2*St)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Lt?null:"/*",blockCommentEnd:Lt?null:"*/",lineComment:Lt?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Lt?"json":"javascript",jsonldMode:Ct,jsonMode:Lt,expressionAllowed:e,skipExpression:function(t){var e=t.cc[t.cc.length-1];e!=M&&e!=k||t.cc.pop()}}}),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{65:65}],67:[function(t,e,n){"use strict";function r(t,e){null==e&&(e=!0);var n=t[0],r=t[1],o=t[2],a=t[3];return null==a&&(a=e?1:255),e&&(n*=255,r*=255,o*=255,a*=255),16777216*(n=255&i(n,0,255))+((r=255&i(r,0,255))<<16)+((o=255&i(o,0,255))<<8)+(a=255&i(a,0,255))}var i=t(61);e.exports=r,e.exports.to=r,e.exports.from=function(t,e){var n=(t=+t)>>>24,r=(16711680&t)>>>16,i=(65280&t)>>>8,o=255&t;return!1===e?[n,r,i,o]:[n/255,r/255,i/255,o/255]}},{61:61}],68:[function(t,e,n){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],69:[function(t,e,n){(function(n){"use strict";e.exports=function(t){var e,a,s=[],l=1;if("string"==typeof t)if(r[t])s=r[t].slice(),a="rgb";else if("transparent"===t)l=0,a="rgb",s=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1);l=1,(h=u.length)<=4?(s=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(l=parseInt(u[3]+u[3],16)/255)):(s=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(l=parseInt(u[6]+u[7],16)/255)),s[0]||(s[0]=0),s[1]||(s[1]=0),s[2]||(s[2]=0),a="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var c=e[1];a=u=c.replace(/a$/,"");var h="cmyk"===u?4:"gray"===u?1:3;s=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),c===u&&s.push(1),l=void 0===s[h]?1:s[h],s=s.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(s=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),a=t.match(/([a-z])/gi).join("").toLowerCase());else"number"==typeof t?(a="rgb",s=[t>>>16,(65280&t)>>>8,255&t]):i(t)?(null!=t.r?(s=[t.r,t.g,t.b],a="rgb"):null!=t.red?(s=[t.red,t.green,t.blue],a="rgb"):null!=t.h?(s=[t.h,t.s,t.l],a="hsl"):null!=t.hue&&(s=[t.hue,t.saturation,t.lightness],a="hsl"),null!=t.a?l=t.a:null!=t.alpha?l=t.alpha:null!=t.opacity&&(l=t.opacity/100)):(Array.isArray(t)||n.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(s=[t[0],t[1],t[2]],a="rgb",l=4===t.length?t[3]:1);return{space:a,values:s,alpha:l}};var r=t(68),i=t(288),o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{288:288,68:68}],70:[function(t,e,n){"use strict";var r=t(69),i=t(71),o=t(61);e.exports=function(t,e){if(Array.isArray(t))return t;null==e&&(e=!0);var n=r(t);if(!n.space)return[];var a,s=n.values,l=s.length;for(a=0;a1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[u]=255*o;return i}},r.hsl=function(t){var e,n,r,i=t[0]/255,o=t[1]/255,a=t[2]/255,s=Math.min(i,o,a),l=Math.max(i,o,a),u=l-s;return l===s?e=0:i===l?e=(o-a)/u:o===l?e=2+(a-i)/u:a===l&&(e=4+(i-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(s+l)/2,n=l===s?0:r<=.5?u/(l+s):u/(2-l-s),[e,100*n,100*r]}},{72:72}],72:[function(t,e,n){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],73:[function(t,e,n){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],74:[function(t,e,n){"use strict";function r(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function i(t){for(var e,n="#",r=0;r<3;++r)n+=("00"+(e=(e=t[r]).toString(16))).substr(e.length);return n}function o(t){return"rgba("+t.join(",")+")"}var a=t(73),s=t(294);e.exports=function(t){var e,n,l,u,c,h,f,d,p,m;if(t||(t={}),d=(t.nshades||72)-1,f=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!a[h])throw Error(h+" not a supported colorscale");c=a[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);c=h.slice()}if(c.length>d)throw new Error(h+" map requires nshades to be at least size "+c.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=c.map(function(t){return Math.round(t.index*d)}),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var v=c.map(function(t,e){var n=c[e].index,r=c[e].rgb.slice();return 4===r.length&&r[3]>=0&&r[3]<=1?r:(r[3]=p[0]+(p[1]-p[0])*n,r)}),g=[];for(m=0;m=0}e.exports=function(t,e,n,a){var s=i(e,n,a);if(0===s){var l=o(i(t,e,n)),u=o(i(t,e,a));if(l===u){if(0===l){var c=r(t,e,n);return c===r(t,e,a)?0:c?1:-1}return 0}return 0===u?l>0?-1:r(t,e,a)?-1:1:0===l?u>0?1:r(t,e,n)?1:-1:o(u-l)}var h=i(t,e,n);return h>0?s>0&&i(t,e,a)>0?1:-1:h<0?s>0||i(t,e,a)>0?1:-1:i(t,e,a)>0?1:r(t,e,n)?1:-1};var i=t(1240),o=t(1247),a=t(1272),s=t(1241),l=t(1245)},{1240:1240,1241:1241,1245:1245,1247:1247,1272:1272}],76:[function(t,e,n){function r(t,e){return t-e}e.exports=function(t,e){var n=t.length,o=t.length-e.length;if(o)return o;switch(n){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],s=e[0]+e[1];if(o=a+t[2]-(s+e[2]))return o;var l=i(t[0],t[1]),u=i(e[0],e[1]);return i(l,t[2])-i(u,e[2])||i(l+t[2],a)-i(u+e[2],s);case 4:var c=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],v=e[2],g=e[3];return c+h+f+d-(p+m+v+g)||i(c,h,f,d)-i(p,m,v,g,p)||i(c+h,c+f,c+d,h+f,h+d,f+d)-i(p+m,p+v,p+g,m+v,m+g,v+g)||i(c+h+f,c+h+d,c+f+d,h+f+d)-i(p+m+v,p+m+g,p+v+g,m+v+g);default:for(var y=t.slice().sort(r),x=e.slice().sort(r),b=0;bt[n][0]&&(n=r);return en?[[n],[e]]:[[e]]}},{}],80:[function(t,e,n){"use strict";e.exports=function(t){var e=r(t),n=e.length;if(n<=2)return[];for(var i=new Array(n),o=e[n-1],a=0;a=e[l]&&(s+=1);o[a]=s}}return t}e.exports=function(t,e){try{return o(t,!0)}catch(l){var n=a(t);if(n.length<=e)return[];var s=r(t,n);return i(o(s,!0),n)}};var o=t(280),a=t(14)},{14:14,280:280}],82:[function(t,e,n){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],83:[function(t,e,n){"use strict";function r(t){return t}var i=t(470),o=t(116),a=t(123),s="mixins";e.exports=function(t,e,n){function l(t,e){var n=g.hasOwnProperty(e)?g[e]:null;_.hasOwnProperty(e)&&a("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&a("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function u(t,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(s)&&y.mixins(t,n.mixins);for(var o in n)if(n.hasOwnProperty(o)&&o!==s){var u=n[o],c=r.hasOwnProperty(o);if(l(c,o),y.hasOwnProperty(o))y[o](t,u);else{var h=g.hasOwnProperty(o);if("function"!=typeof u||h||c||!1===n.autobind)if(c){var p=g[o];a(h&&("DEFINE_MANY_MERGED"===p||"DEFINE_MANY"===p),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",p,o),"DEFINE_MANY_MERGED"===p?r[o]=f(r[o],u):"DEFINE_MANY"===p&&(r[o]=d(r[o],u))}else r[o]=u;else i.push(o,u),r[o]=u}}}}function c(t,e){if(e)for(var n in e){var r=e[n];e.hasOwnProperty(n)&&(a(!(n in y),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),a(!(n in t),"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=r)}}function h(t,e){a(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(a(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function f(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return h(i,n),h(i,r),i}}function d(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function p(t,e){var n=e.bind(t);return n}function m(t){for(var e=t.__reactAutoBindPairs,n=0;n255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}var l={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],rebeccapurple:[102,51,153,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{n.parseCSSColor=function(t){var e=t.replace(/ /g,"").toLowerCase();if(e in l)return l[e].slice();if("#"===e[0]){if(4===e.length)return(n=parseInt(e.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null;if(7===e.length){var n=parseInt(e.substr(1),16);return n>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null}return null}var i=e.indexOf("("),u=e.indexOf(")");if(-1!==i&&u+1===e.length){var c=e.substr(0,i),h=e.substr(i+1,u-(i+1)).split(","),f=1;switch(c){case"rgba":if(4!==h.length)return null;f=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),f];case"hsla":if(4!==h.length)return null;f=a(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=a(h[1]),m=a(h[2]),v=m<=.5?m*(p+1):m+p-m*p,g=2*m-v;return[r(255*s(g,v,d+1/3)),r(255*s(g,v,d)),r(255*s(g,v,d-1/3)),f];default:return null}}return null}}catch(t){}},{}],85:[function(t,e,n){"use strict";e.exports=function(t,e,n,r,i,o){var a=i-1,s=i*i,l=a*a,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*a;if(t.length){o||(o=new Array(t.length));for(var d=t.length-1;d>=0;--d)o[d]=u*t[d]+c*e[d]+h*n[d]+f*r[d];return o}return u*t+c*e+h*n+f*r},e.exports.derivative=function(t,e,n,r,i,o){var a=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){o||(o=new Array(t.length));for(var c=t.length-1;c>=0;--c)o[c]=a*t[c]+s*e[c]+l*n[c]+u*r[c];return o}return a*t+s*e+l*n[c]+u*r}},{}],86:[function(t,e,n){"use strict";function r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}var i=t(88);e.exports=function(t){var e=new r;e.pre=t.pre,e.body=t.body,e.post=t.post;var n=t.args.slice(0);e.argTypes=n;for(var o=0;o0)throw new Error("cwise: pre() block may not reference array args");if(o0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(o),e.shimArgs.push("scalar"+o);else if("index"===a){if(e.indexArgs.push(o),o0)throw new Error("cwise: pre() block may not reference array index");if(o0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(o),on.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,i(e)}},{88:88}],87:[function(t,e,n){"use strict";function r(t,e,n){var r,i,o=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(r=0;r0&&l.push("var "+u.join(",")),r=o-1;r>=0;--r)c=t[r],l.push(["for(i",r,"=0;i",r,"0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,n,i){for(var o=e.length,a=n.arrayArgs.length,s=n.blockSize,l=n.indexArgs.length>0,u=[],c=0;c0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(c=0;c0&&(n=n&&e[r]===e[r-1])}return n?e[0]:e.join("")}var l=t(1275);e.exports=function(t,e){for(var n=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,u=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=0;h0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(n),h=0;h0&&b.push("var "+_.join(","));for(h=0;h3&&b.push(a(t.pre,t,c));var A=a(t.body,t,c),S=o(v);S3&&b.push(a(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+b.join("\n")+"\n----------");var E=[t.funcName||"unnamed","_cwise_loop_",u[0].join("s"),"m",S,s(c)].join("");return new Function(["function ",E,"(",x.join(","),"){",b.join("\n"),"} return ",E].join(""))()}},{1275:1275}],88:[function(t,e,n){"use strict";var r=t(87);e.exports=function(t){var e=["'use strict'","var CACHED={}"],n=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(c=0;c=0?(o>=_?10:o>=w?5:o>=M?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=_?10:o>=w?5:o>=M?2:1)}function i(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=_?i*=10:o>=w?i*=5:o>=M&&(i*=2),ee?1:t>=e?0:NaN},s=function(t){return 1===t.length&&(t=e(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}},l=s(a),u=l.right,c=l.left,h=function(t){return null===t?NaN:+t},f=function(t,e){var n,r,i=t.length,o=0,a=-1,s=0,l=0;if(null==e)for(;++a1)return l/(o-1)},d=function(t,e){var n=f(t,e);return n?Math.sqrt(n):n},p=function(t,e){var n,r,i,o=t.length,a=-1;if(null==e){for(;++a=n)for(r=i=n;++an&&(r=n),i=n)for(r=i=n;++an&&(r=n),i=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}},A=function(t,e){var n,r,i=t.length,o=-1;if(null==e){for(;++o=n)for(r=n;++on&&(r=n)}else for(;++o=n)for(r=n;++on&&(r=n);return r},S=function(t){if(!(i=t.length))return[];for(var e=-1,n=A(t,o),r=new Array(n);++et?1:e>=t?0:NaN},t.deviation=d,t.extent=p,t.histogram=function(){function t(t){var o,a,s=t.length,l=new Array(s);for(o=0;of;)d.pop(),--p;var m,v=new Array(p+1);for(o=0;o<=p;++o)(m=v[o]=[]).x0=o>0?d[o-1]:h,m.x1=o=n)for(r=n;++or&&(r=n)}else for(;++o=n)for(r=n;++or&&(r=n);return r},t.mean=function(t,e){var n,r=t.length,i=r,o=-1,a=0;if(null==e)for(;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n},t.min=A,t.pairs=function(t,e){null==e&&(e=n);for(var r=0,i=t.length-1,o=t[0],a=new Array(i<0?0:i);r0)return[t];if((i=e0)for(t=Math.ceil(t/s),e=Math.floor(e/s),a=new Array(o=Math.ceil(e-t+1));++l=c.length)return null!=s&&e.sort(s),null!=l?l(e):e;for(var a,u,h,f=-1,d=e.length,p=c[r++],m=n(),v=i();++fc.length)return t;var r,i=h[n-1];return null!=l&&n>=c.length?r=t.entries():(r=[],t.each(function(t,i){r.push({key:i,values:e(t,n)})})),null!=i?r.sort(function(t,e){return i(t.key,e.key)}):r}var s,l,u,c=[],h=[];return u={object:function(e){return t(e,0,r,i)},map:function(e){return t(e,0,o,a)},entries:function(n){return e(t(n,0,o,a),0)},key:function(t){return c.push(t),u},sortKeys:function(t){return h[c.length-1]=t,u},sortValues:function(t){return s=t,u},rollup:function(t){return l=t,u}}},t.set=l,t.map=n,t.keys=function(t){var e=[];for(var n in t)e.push(n);return e},t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],92:[function(t,e,n){!function(t,r){"object"==typeof n&&void 0!==e?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r(t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function n(){}function r(t){var e;return t=(t+"").trim().toLowerCase(),(e=P.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=I.exec(t))?i(parseInt(e[1],16)):(e=O.exec(t))?new l(e[1],e[2],e[3],1):(e=D.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=z.exec(t))?o(e[1],e[2],e[3],e[4]):(e=j.exec(t))?o(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=N.exec(t))?u(e[1],e[2]/100,e[3]/100,1):(e=R.exec(t))?u(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function o(t,e,n,r){return r<=0&&(t=e=n=NaN),new l(t,e,n,r)}function a(t){return t instanceof n||(t=r(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,n,r){return 1===arguments.length?a(t):new l(t,e,n,null==r?1:r)}function l(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function u(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,n,r)}function c(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=r(t)),!t)return new f;if(t instanceof f)return t;var e=(t=t.rgb()).r/255,i=t.g/255,o=t.b/255,a=Math.min(e,i,o),s=Math.max(e,i,o),l=NaN,u=s-a,c=(s+a)/2;return u?(l=e===s?(i-o)/u+6*(i0&&c<1?0:l,new f(l,u,c,t.opacity)}function h(t,e,n,r){return 1===arguments.length?c(t):new f(t,e,n,null==r?1:r)}function f(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function d(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function p(t){if(t instanceof v)return new v(t.l,t.a,t.b,t.opacity);if(t instanceof M){var e=t.h*B;return new v(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=a(t));var n=b(t.r),r=b(t.g),i=b(t.b),o=g((.4124564*n+.3575761*r+.1804375*i)/V),s=g((.2126729*n+.7151522*r+.072175*i)/H);return new v(116*s-16,500*(o-s),200*(s-g((.0193339*n+.119192*r+.9503041*i)/q)),t.opacity)}function m(t,e,n,r){return 1===arguments.length?p(t):new v(t,e,n,null==r?1:r)}function v(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function g(t){return t>X?Math.pow(t,1/3):t/Y+W}function y(t){return t>G?t*t*t:Y*(t-W)}function x(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function b(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _(t){if(t instanceof M)return new M(t.h,t.c,t.l,t.opacity);t instanceof v||(t=p(t));var e=Math.atan2(t.b,t.a)*U;return new M(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function w(t,e,n,r){return 1===arguments.length?_(t):new M(t,e,n,null==r?1:r)}function M(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function k(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);t instanceof l||(t=a(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(nt*r+tt*e-et*n)/(nt+tt-et),o=r-i,s=(Q*(n-i)-J*o)/$,u=Math.sqrt(s*s+o*o)/(Q*i*(1-i)),c=u?Math.atan2(s,o)*U-120:NaN;return new A(c<0?c+360:c,u,i,t.opacity)}function T(t,e,n,r){return 1===arguments.length?k(t):new A(t,e,n,null==r?1:r)}function A(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}var S=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t},E="\\s*([+-]?\\d+)\\s*",C="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",L="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",P=/^#([0-9a-f]{3})$/,I=/^#([0-9a-f]{6})$/,O=new RegExp("^rgb\\("+[E,E,E]+"\\)$"),D=new RegExp("^rgb\\("+[L,L,L]+"\\)$"),z=new RegExp("^rgba\\("+[E,E,E,C]+"\\)$"),j=new RegExp("^rgba\\("+[L,L,L,C]+"\\)$"),N=new RegExp("^hsl\\("+[C,L,L]+"\\)$"),R=new RegExp("^hsla\\("+[C,L,L,C]+"\\)$"),F={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};S(n,r,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),S(l,s,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),S(f,h,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new l(d(t>=240?t-240:t+120,i,r),d(t,i,r),d(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var B=Math.PI/180,U=180/Math.PI,V=.95047,H=1,q=1.08883,W=4/29,G=6/29,Y=3*G*G,X=G*G*G;S(v,m,e(n,{brighter:function(t){return new v(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new v(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return t=H*y(t),e=V*y(e),n=q*y(n),new l(x(3.2404542*e-1.5371385*t-.4985314*n),x(-.969266*e+1.8760108*t+.041556*n),x(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),S(M,w,e(n,{brighter:function(t){return new M(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new M(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return p(this).rgb()}}));var Z=-.14861,K=1.78277,J=-.29227,$=-.90649,Q=1.97294,tt=Q*$,et=Q*K,nt=K*J-$*Z;S(A,T,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*B,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new l(255*(e+n*(Z*r+K*i)),255*(e+n*(J*r+$*i)),255*(e+n*(Q*r)),this.opacity)}})),t.color=r,t.rgb=s,t.hsl=h,t.lab=m,t.hcl=w,t.cubehelix=T,Object.defineProperty(t,"__esModule",{value:!0})})},{}],93:[function(t,e,n){!function(t,r){"object"==typeof n&&void 0!==e?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r(t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,r=arguments.length,i={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function i(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;oh+l||rd+l||oi.index){var c=h-a.x-a.vx,v=d-a.y-a.vy,g=c*c+v*v;gt.r&&(t.r=t[e].r)}function i(){if(s){var e,n,r=s.length;for(l=new Array(r),e=0;e=m)){(t.data!==a||t.next)&&(0===i&&(i=f(),c+=i*i),0===o&&(o=f(),c+=o*o),c1?(null==e?v.remove(t):v.set(t,s(e)),l):v.get(t)},find:function(e,n,r){var i,o,a,s,l,u=0,c=t.length;for(null==r?r=1/0:r*=r,u=0;u1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,n=0,a=r.length;n180||n<-180?n-360*Math.round(n/360):n):k(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?s:function(e,n){return n-e?i(e,n,t):k(isNaN(e)?n:e)}}function s(t,e){var n=e-t;return n?r(t,n):k(isNaN(t)?e:t)}function l(t){return function(n){var r,i,o=n.length,a=new Array(o),s=new Array(o),l=new Array(o);for(r=0;r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:L(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}function s(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:L(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}function l(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:L(t,n)},{i:s-2,x:L(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}return function(e,n){var r=[],i=[];return e=t(e),n=t(n),o(e.translateX,e.translateY,n.translateX,n.translateY,r,i),a(e.rotate,n.rotate,r,i),s(e.skewX,n.skewX,r,i),l(e.scaleX,e.scaleY,n.scaleX,n.scaleY,r,i),e=n=null,function(t){for(var e,n=-1,o=i.length;++n=1?(r=1,e-1):Math.floor(r*e),o=t[i],a=t[i+1],s=i>0?t[i-1]:2*o-a,l=io&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:L(n,r)})),o=O.lastIndex;return o=(o=(m+g)/2))?m=o:g=o,(c=n>=(a=(v+y)/2))?v=a:y=a,i=d,!(d=d[h=c<<1|u]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(o=(m+g)/2))?m=o:g=o,(c=n>=(a=(v+y)/2))?v=a:y=a}while((h=c<<1|u)==(f=(l>=a)<<1|s>=o));return i[f]=d,i[h]=p,t}function n(t){return t[0]}function r(t){return t[1]}function i(t,e,i){var a=new o(null==e?n:e,null==i?r:i,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function a(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var s=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i},l=i.prototype=o.prototype;l.copy=function(){var t,e,n=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=a(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=a(e));return n},l.add=function(t){var n=+this._x.call(null,t),r=+this._y.call(null,t);return e(this.cover(n,r),n,r,t)},l.addAll=function(t){var n,r,i,o,a=t.length,s=new Array(a),l=new Array(a),u=1/0,c=1/0,h=-1/0,f=-1/0;for(r=0;rh&&(h=i),of&&(f=o));for(ht||t>i||r>e||e>o))return this;var a,s,l=i-n,u=this._root;switch(s=(e<(r+o)/2)<<1|t<(n+i)/2){case 0:do{a=new Array(4),a[s]=u,u=a}while(l*=2,i=n+l,o=r+l,t>i||e>o);break;case 1:do{a=new Array(4),a[s]=u,u=a}while(l*=2,n=i-l,o=r+l,n>t||e>o);break;case 2:do{a=new Array(4),a[s]=u,u=a}while(l*=2,i=n+l,r=o-l,t>i||r>e);break;case 3:do{a=new Array(4),a[s]=u,u=a}while(l*=2,n=i-l,r=o-l,n>t||r>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var r,i,o,a,l,u,c,h=this._x0,f=this._y0,d=this._x1,p=this._y1,m=[],v=this._root;for(v&&m.push(new s(v,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);u=m.pop();)if(!(!(v=u.node)||(i=u.x0)>d||(o=u.y0)>p||(a=u.x1)=y)<<1|t>=g)&&(u=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=u)}else{var x=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),_=x*x+b*b;if(_=(s=(p+v)/2))?p=s:v=s,(c=a>=(l=(m+g)/2))?m=l:g=l,e=d,!(d=d[h=c<<1|u]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[f]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,n=t.length;e=0&&n._call.call(null,t),n=n._next;--f}function a(){g=(v=x.now())+y,f=d=0;try{o()}finally{f=0,l(),g=0}}function s(){var t=x.now(),e=t-v;e>m&&(y-=e,v=t)}function l(){for(var t,e,n=c,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:c=e);h=t,u(r)}function u(t){f||(d&&(d=clearTimeout(d)),t-g>24?(t<1/0&&(d=setTimeout(a,t-x.now()-y)),p&&(p=clearInterval(p))):(p||(v=x.now(),p=setInterval(s,m)),f=1,b(a)))}var c,h,f=0,d=0,p=0,m=1e3,v=0,g=0,y=0,x="object"==typeof performance&&performance.now?performance:Date,b="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};r.prototype=i.prototype={constructor:r,restart:function(t,n,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?e():+r)+(null==n?0:+n),this._next||h===this||(h?h._next=this:c=this,h=this),this._call=t,this._time=r,u()},stop:function(){this._call&&(this._call=null,this._time=1/0,u())}};t.now=e,t.timer=i,t.timerFlush=o,t.timeout=function(t,e,n){var i=new r;return e=null==e?0:+e,i.restart(function(n){i.stop(),t(n+e)},e,n),i},t.interval=function(t,n,i){var o=new r,a=n;return null==n?(o.restart(t,n,i),o):(n=+n,i=null==i?e():+i,o.restart(function e(r){r+=a,o.restart(e,a+=n,i),t(r)},n,i),o)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],98:[function(t,e,n){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function r(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function a(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function s(t){return t.length}function l(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function c(){this._=Object.create(null)}function h(t){return(t+="")===ta||t[0]===ea?ea+t:t}function f(t){return(t+="")[0]===ea?t.slice(1):t}function d(t){return h(t)in this._}function p(t){return(t=h(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(f(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function y(){this._=Object.create(null)}function x(t){return t}function b(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function _(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=na.length;n=e&&(e=i+1);!(a=s[e])&&++e0&&(t=t.slice(0,o));var s=fa.get(t);return s&&(t=s,a=Z),o?e?function(){var o=a(e,Wo(arguments));r.call(this),this.addEventListener(t,this[i]=o,o.$=n),o._=e}:r:e?w:function(){var e,n=new RegExp("^__on([^.]+)"+Ho.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];this.removeEventListener(e[1],i,i.$),delete this[r]}}}function X(t,e){return function(n){var r=Ho.event;Ho.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{Ho.event=r}}}function Z(t,e){var n=X(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function K(e){var r=".dragsuppress-"+ ++pa,i="click"+r,o=Ho.select(n(e)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==da&&(da=!("onselectstart"in e)&&_(e.style,"userSelect")),da){var a=t(e).style,s=a[da];a[da]="none"}return function(t){if(o.on(r,null),da&&(a[da]=s),t){var e=function(){o.on(i,null)};o.on(i,function(){T(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(ma<0){var o=n(t);if(o.scrollX||o.scrollY){var a=(r=Ho.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();ma=!(a.f||a.e),r.remove()}}return ma?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function $(){return Ho.event.changedTouches[0].identifier}function Q(t){return t>0?1:t<0?-1:0}function tt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function et(t){return t>1?0:t<-1?ya:Math.acos(t)}function nt(t){return t>1?_a:t<-1?-_a:Math.asin(t)}function rt(t){return((t=Math.exp(t))-1/t)/2}function it(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function at(t){return(t=Math.sin(t/2))*t}function st(){}function lt(t,e,n){return this instanceof lt?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof lt?new lt(t.h,t.s,t.l):wt(""+t,Mt,lt):new lt(t,e,n)}function ut(t,e,n){function r(t){return t>360?t-=360:t<0&&(t+=360),t<60?o+(a-o)*t/60:t<180?a:t<240?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=n<0?0:n>1?1:n,a=n<=.5?n*(1+e):n+e-n*e,o=2*n-a,new yt(i(t+120),i(t),i(t-120))}function ct(t,e,n){return this instanceof ct?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ct?new ct(t.h,t.c,t.l):t instanceof ft?pt(t.l,t.a,t.b):pt((t=kt((t=Ho.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ct(t,e,n)}function ht(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ft(n,Math.cos(t*=wa)*e,Math.sin(t)*e)}function ft(t,e,n){return this instanceof ft?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof ft?new ft(t.l,t.a,t.b):t instanceof ct?ht(t.h,t.c,t.l):kt((t=yt(t)).r,t.g,t.b):new ft(t,e,n)}function dt(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;return i=mt(i)*Pa,r=mt(r)*Ia,o=mt(o)*Oa,new yt(gt(3.2404542*i-1.5371385*r-.4985314*o),gt(-.969266*i+1.8760108*r+.041556*o),gt(.0556434*i-.2040259*r+1.0572252*o))}function pt(t,e,n){return t>0?new ct(Math.atan2(n,e)*Ma,Math.sqrt(e*e+n*n),t):new ct(NaN,NaN,t)}function mt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function gt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function yt(t,e,n){return this instanceof yt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof yt?new yt(t.r,t.g,t.b):wt(""+t,yt,ut):new yt(t,e,n)}function xt(t){return new yt(t>>16,t>>8&255,255&t)}function bt(t){return xt(t)+""}function _t(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function wt(t,e,n){var r,i,o,a=0,s=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(At(i[0]),At(i[1]),At(i[2]))}return(o=ja.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a|=a>>4,s=240&o,s|=s>>4,l=15&o,l|=l<<4):7===t.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,l=255&o)),e(a,s,l))}function Mt(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,l=(a+o)/2;return s?(i=l<.5?s/(a+o):s/(2-a-o),r=t==a?(e-n)/s+(e0&&l<1?0:r),new lt(r,i,l)}function kt(t,e,n){var r=vt((.4124564*(t=Tt(t))+.3575761*(e=Tt(e))+.1804375*(n=Tt(n)))/Pa),i=vt((.2126729*t+.7151522*e+.072175*n)/Ia);return ft(116*i-16,500*(r-i),200*(i-vt((.0193339*t+.119192*e+.9503041*n)/Oa)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function At(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function St(t){return"function"==typeof t?t:function(){return t}}function Et(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Ct(e,n,t,r)}}function Ct(t,e,n,r){function i(){var t,e=l.status;if(!e&&Pt(l)||e>=200&&e<300||304===e){try{t=n.call(o,l)}catch(t){return void a.error.call(o,t)}a.load.call(o,t)}else a.error.call(o,l)}var o={},a=Ho.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=Ho.event;Ho.event=t;try{a.progress.call(o,l)}finally{Ho.event=e}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return n=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(Wo(arguments)))}}),o.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(n,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),a.beforesend.call(o,l),l.send(null==r?null:r),o},o.abort=function(){return l.abort(),o},Ho.rebind(o,a,"on"),null==r?o:o.get(Lt(r))}function Lt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Pt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function It(t,e,n){var r=arguments.length;r<2&&(e=0),r<3&&(n=Date.now());var i={c:t,t:n+e,n:null};return Ra?Ra.n=i:Na=i,Ra=i,Fa||(Ba=clearTimeout(Ba),Fa=1,Ua(Ot)),i}function Ot(){var t=Dt(),e=zt()-t;e>24?(isFinite(e)&&(clearTimeout(Ba),Ba=setTimeout(Ot,e)),Fa=0):(Fa=1,Ua(Ot))}function Dt(){for(var t=Date.now(),e=Na;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function zt(){for(var t,e=Na,n=1/0;e;)e.c?(e.t0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),o.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=r[a=(a+1)%r.length];return o.reverse().join(n)}:x;return function(t){var n=Ha.exec(t),r=n[1]||" ",a=n[2]||">",s=n[3]||"-",l=n[4]||"",u=n[5],c=+n[6],h=n[7],f=n[8],d=n[9],p=1,m="",v="",g=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||"0"===r&&"="===a)&&(u=r="0",a="="),d){case"n":h=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":g=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],v=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=qa.get(d)||Rt;var x=u&&h;return function(t){var n=v;if(g&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=Ho.formatPrefix(t,f);t=l.scale(t),n=l.symbol+v}else t*=p;var b,_,w=(t=d(t,f)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(b=t,_=""):(b=t.substring(0,M),_=t.substring(M))}else b=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(b=o(b,1/0));var k=m.length+b.length+_.length+(x?0:i.length),T=k"===a?T+i+t:"^"===a?T.substring(0,k>>=1)+i+t+T.substring(k):i+(x?t:T+t))+n}}}function Rt(t){return t+""}function Ft(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Bt(t,e,n){function r(e){var n=t(e),r=o(n,1);return e-n1)for(;a=u)return-1;if(37===(i=e.charCodeAt(s++))){if(a=e.charAt(s++),!(o=_[a in Xa?e.charAt(s++):a])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}var r=t.dateTime,i=t.date,o=t.time,a=t.periods,s=t.days,l=t.shortDays,u=t.months,c=t.shortMonths;e.utc=function(t){function n(t){try{var e=new(Ga=Ft);return e._=t,r(e)}finally{Ga=Date}}var r=e(t);return n.parse=function(t){try{Ga=Ft;var e=r.parse(t);return e&&e._}finally{Ga=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=le;var h=Ho.map(),f=qt(s),d=Wt(s),p=qt(l),m=Wt(l),v=qt(u),g=Wt(u),y=qt(c),x=Wt(c);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var b={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:e(r),d:function(t,e){return Ht(t.getDate(),e,2)},e:function(t,e){return Ht(t.getDate(),e,2)},H:function(t,e){return Ht(t.getHours(),e,2)},I:function(t,e){return Ht(t.getHours()%12||12,e,2)},j:function(t,e){return Ht(1+Wa.dayOfYear(t),e,3)},L:function(t,e){return Ht(t.getMilliseconds(),e,3)},m:function(t,e){return Ht(t.getMonth()+1,e,2)},M:function(t,e){return Ht(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ht(t.getSeconds(),e,2)},U:function(t,e){return Ht(Wa.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ht(Wa.mondayOfYear(t),e,2)},x:e(i),X:e(o),y:function(t,e){return Ht(t.getFullYear()%100,e,2)},Y:function(t,e){return Ht(t.getFullYear()%1e4,e,4)},Z:ae,"%":function(){return"%"}},_={a:function(t,e,n){p.lastIndex=0;var r=p.exec(e.slice(n));return r?(t.w=m.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){f.lastIndex=0;var r=f.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){y.lastIndex=0;var r=y.exec(e.slice(n));return r?(t.m=x.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){v.lastIndex=0;var r=v.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,e,r){return n(t,b.c.toString(),e,r)},d:te,e:te,H:ne,I:ne,j:ee,L:oe,m:Qt,M:re,p:function(t,e,n){var r=h.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)},S:ie,U:Yt,w:Gt,W:Xt,x:function(t,e,r){return n(t,b.x.toString(),e,r)},X:function(t,e,r){return n(t,b.X.toString(),e,r)},y:Kt,Y:Zt,Z:Jt,"%":se};return e}function Ht(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3)}function Qt(t,e,n){Za.lastIndex=0;var r=Za.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function te(t,e,n){Za.lastIndex=0;var r=Za.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ee(t,e,n){Za.lastIndex=0;var r=Za.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ne(t,e,n){Za.lastIndex=0;var r=Za.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function re(t,e,n){Za.lastIndex=0;var r=Za.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ie(t,e,n){Za.lastIndex=0;var r=Za.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function oe(t,e,n){Za.lastIndex=0;var r=Za.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ae(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=Qo(e)/60|0,i=Qo(e)%60;return n+Ht(r,"0",2)+Ht(i,"0",2)}function se(t,e,n){Ka.lastIndex=0;var r=Ka.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function le(t){for(var e=t.length,n=-1;++n=0?1:-1,s=a*n,l=Math.cos(e),u=Math.sin(e),c=o*u,h=i*l+c*Math.cos(s),f=c*a*Math.sin(s);ns.add(Math.atan2(f,h)),r=t,i=l,o=u}var e,n,r,i,o;rs.point=function(a,s){rs.point=t,r=(e=a)*wa,i=Math.cos(s=(n=s)*wa/2+ya/4),o=Math.sin(s)},rs.lineEnd=function(){t(e,n)}}function me(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ve(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ge(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ye(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function be(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function _e(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function we(t,e){return Qo(t[0]-e[0])=0;--s)i.point((h=c[s])[0],h[1]);else r(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(_||(o.polygonStart(),_=!0),o.lineStart();++a1&&2&e&&n.push(n.pop().concat(n.shift())),d.push(n.filter(De))}var d,p,m,v=e(o),g=i.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=l,y.lineEnd=u,d=Ho.merge(d);var t=Re(g,p);d.length?(_||(o.polygonStart(),_=!0),Le(d,je,t,n,o)):t&&(_||(o.polygonStart(),_=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),d=p=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}},x=ze(),b=e(x),_=!1;return y}}function De(t){return t.length>1}function ze(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:w,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function je(t,e){return((t=t.x)[0]<0?t[1]-_a-va:_a-t[1])-((e=e.x)[0]<0?e[1]-_a-va:_a-e[1])}function Ne(t,e,n,r){var i,o,a=Math.sin(t-n);return Qo(a)>va?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function Re(t,e){var n=t[0],r=t[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;ns.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>ya,T=p*x;if(ns.add(Math.atan2(T*w*Math.sin(M),m*b+T*Math.cos(M))),o+=k?_+w*xa:_,k^f>=n^g>=n){var A=ge(me(h),me(t));be(A);var S=ge(i,A);be(S);var E=(k^_>=0?-1:1)*nt(S[2]);(r>E||r===E&&(A[0]||A[1]))&&(a+=k^_>=0?1:-1)}if(!v++)break;f=g,p=x,m=b,h=t}}return(o<-va||oi}function n(t,e,n){var r=[1,0,0],o=ge(me(t),me(e)),a=ve(o,o),s=o[0],l=a-s*s;if(!l)return!n&&t;var u=i*a/l,c=-i*s/l,h=ge(r,o),f=xe(r,u);ye(f,xe(o,c));var d=h,p=ve(f,d),m=ve(d,d),v=p*p-m*(ve(f,f)-1);if(!(v<0)){var g=Math.sqrt(v),y=xe(d,(-p-g)/m);if(ye(y,f),y=_e(y),!n)return y;var x,b=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(Qo(y[0]-b)ya^(b<=y[0]&&y[0]<=_)){var S=xe(d,(-p+g)/m);return ye(S,f),[y,_e(S)]}}}function r(e,n){var r=o?t:ya-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var i=Math.cos(t),o=i>0,a=Qo(i)>va;return Oe(e,function(t){var i,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p=[h,f],m=e(h,f),v=o?m?0:r(h,f):m?r(h+(h<0?ya:-ya),f):0;if(!i&&(u=l=m)&&t.lineStart(),m!==l&&(d=n(i,p),(we(i,d)||we(p,d))&&(p[0]+=va,p[1]+=va,m=e(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),d=n(p,i),t.point(d[0],d[1])):(d=n(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(a&&i&&o^m){var g;v&s||!(g=n(p,i,!0))||(c=0,o?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!m||i&&we(i,p)||t.point(p[0],p[1]),i=p,l=m,s=v},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return c|(u&&l)<<1}}},fn(t,6*wa),o?[0,-t]:[-ya,t-ya])}function Be(t,e,n,r){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=0,h=1,f=s.x-l,d=s.y-u;if(o=t-l,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=n-l,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=d,d<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=r-u,d||!(o<0)){if(o/=d,d<0){if(o>h)return;o>c&&(c=o)}else if(d>0){if(o0&&(i.a={x:l+c*f,y:u+c*d}),h<1&&(i.b={x:l+h*f,y:u+h*d}),i}}}}}}function Ue(t,e,n,r){function i(r,i){return Qo(r[0]-t)0?0:3:Qo(r[0]-n)0?2:1:Qo(r[1]-e)0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,n=p.length,r=t[1],i=0;ir&&tt(u,o,t)>0&&++e:o[1]<=r&&tt(u,o,t)<0&&--e,u=o;return 0!==e}function u(o,s,l,u){var c=0,h=0;if(null==o||(c=i(o,l))!==(h=i(s,l))||a(o,s)<0^l>0)do{u.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+l+4)%4)!==h);else u.point(s[0],s[1])}function c(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function h(t,e){c(t,e)&&s.point(t,e)}function f(t,e){var n=c(t=Math.max(-gs,Math.min(gs,t)),e=Math.max(-gs,Math.min(gs,e)));if(p&&m.push([t,e]),w)v=t,g=e,y=n,w=!1,n&&(s.lineStart(),s.point(t,e));else if(n&&_)s.point(t,e);else{var r={a:{x:x,y:b},b:{x:t,y:e}};A(r)?(_||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),M=!1):n&&(s.lineStart(),s.point(t,e),M=!1)}x=t,b=e,_=n}var d,p,m,v,g,y,x,b,_,w,M,k=s,T=ze(),A=Be(t,e,n,r),S={point:h,lineStart:function(){S.point=f,p&&p.push(m=[]),w=!0,_=!1,x=b=NaN},lineEnd:function(){d&&(f(v,g),y&&_&&T.rejoin(),d.push(T.buffer())),S.point=h,_&&s.lineEnd()},polygonStart:function(){s=T,d=[],p=[],M=!0},polygonEnd:function(){s=k,d=Ho.merge(d);var e=l([t,r]),n=M&&e,i=d.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&Le(d,o,e,u,s),s.polygonEnd()),d=p=m=null}};return S}}function Ve(t){var e=0,n=ya/3,r=rn(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*ya/180,n=t[1]*ya/180):[e/ya*180,n/ya*180]},i}function He(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;return n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,nt((o-(t*t+n*n)*i*i)/(2*i))]},n}function qe(){function t(t,e){xs+=i*t-r*e,r=t,i=e}var e,n,r,i;ks.point=function(o,a){ks.point=t,e=r=o,n=i=a},ks.lineEnd=function(){t(e,n)}}function We(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e),s.point=n}function n(t,e){a.push("L",t,",",e)}function r(){s.point=t}function i(){a.push("Z")}var o=Ge(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r,s.point=t},pointRadius:function(t){return o=Ge(t),s},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return s}function Ge(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ye(t,e){as+=t,ss+=e,++ls}function Xe(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);us+=a*(e+t)/2,cs+=a*(n+r)/2,hs+=a,Ye(e=t,n=r)}var e,n;As.point=function(r,i){As.point=t,Ye(e=r,n=i)}}function Ze(){As.point=Ye}function Ke(){function t(t,e){var n=t-r,o=e-i,a=Math.sqrt(n*n+o*o);us+=a*(r+t)/2,cs+=a*(i+e)/2,hs+=a,fs+=(a=i*t-r*e)*(r+t),ds+=a*(i+e),ps+=3*a,Ye(r=t,i=e)}var e,n,r,i;As.point=function(o,a){As.point=t,Ye(e=r=o,n=i=a)},As.lineEnd=function(){t(e,n)}}function Je(t){function e(e,n){t.moveTo(e+a,n),t.arc(e,n,a,0,xa)}function n(e,n){t.moveTo(e,n),s.point=r}function r(e,n){t.lineTo(e,n)}function i(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return a=t,s},result:w};return s}function $e(t){function e(t){return(s?r:n)(t)}function n(e){return en(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){x=NaN,k.point=o,e.lineStart()}function o(n,r){var o=me([n,r]),a=t(n,r);i(x,b,y,_,w,M,x=a[0],b=a[1],y=n,_=o[0],w=o[1],M=o[2],s,e),e.point(x,b)}function a(){k.point=n,e.lineEnd()}function l(){r(),k.point=u,k.lineEnd=c}function u(t,e){o(h=t,f=e),d=x,p=b,m=_,v=w,g=M,k.point=o}function c(){i(x,b,y,_,w,M,d,p,h,m,v,g,s,e),k.lineEnd=a,a()}var h,f,d,p,m,v,g,y,x,b,_,w,M,k={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=r}};return k}function i(e,n,r,s,l,u,c,h,f,d,p,m,v,g){var y=c-e,x=h-n,b=y*y+x*x;if(b>4*o&&v--){var _=s+d,w=l+p,M=u+m,k=Math.sqrt(_*_+w*w+M*M),T=Math.asin(M/=k),A=Qo(Qo(M)-1)o||Qo((y*L+x*P)/b-.5)>.3||s*d+l*p+u*m0&&16,e):Math.sqrt(o)},e}function Qe(t){var e=$e(function(e,n){return t([e*Ma,n*Ma])});return function(t){return on(e(t))}}function tn(t){this.stream=t}function en(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function nn(t){return rn(function(){return t})()}function rn(t){function e(t){return t=s(t[0]*wa,t[1]*wa),[t[0]*f+l,u-t[1]*f]}function n(t){return(t=s.invert((t[0]-l)/f,(u-t[1])/f))&&[t[0]*Ma,t[1]*Ma]}function r(){s=Ee(a=ln(g,y,b),o);var t=o(m,v);return l=d-t[0]*f,u=p+t[1]*f,i()}function i(){return c&&(c.valid=!1,c=null),e}var o,a,s,l,u,c,h=$e(function(t,e){return t=o(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,m=0,v=0,g=0,y=0,b=0,_=vs,w=x,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=on(_(a,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(M=t,vs):Fe((M=+t)*wa),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,w=t?Ue(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):k},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*wa,v=t[1]%360*wa,r()):[m*Ma,v*Ma]},e.rotate=function(t){return arguments.length?(g=t[0]%360*wa,y=t[1]%360*wa,b=t.length>2?t[2]%360*wa:0,r()):[g*Ma,y*Ma,b*Ma]},Ho.rebind(e,h,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&n,r()}}function on(t){return en(t,function(e,n){t.point(e*wa,n*wa)})}function an(t,e){return[t,e]}function sn(t,e){return[t>ya?t-xa:t<-ya?t+xa:t,e]}function ln(t,e,n){return t?e||n?Ee(cn(t),hn(e,n)):cn(t):e||n?hn(e,n):sn}function un(t){return function(e,n){return e+=t,[e>ya?e-xa:e<-ya?e+xa:e,n]}}function cn(t){var e=un(t);return e.invert=un(-t),e}function hn(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*r+s*i;return[Math.atan2(l*o-c*a,s*r-u*i),nt(c*o+l*a)]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*o-l*a;return[Math.atan2(l*o+u*a,s*r+c*i),nt(c*r-s*i)]},n}function fn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,s){var l=a*e;null!=i?(i=dn(n,i),o=dn(n,o),(a>0?io)&&(i+=a*xa)):(i=t+a*xa,o=t-.5*l);for(var u,c=i;a>0?c>o:c0?e<-_a+va&&(e=-_a+va):e>_a-va&&(e=_a-va);var n=a/Math.pow(i(e),o);return[n*Math.sin(o*t),a-n*Math.cos(o*t)]}var r=Math.cos(t),i=function(t){return Math.tan(ya/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),o)/o;return o?(n.invert=function(t,e){var n=a-e,r=Q(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(a/r,1/o))-_a]},n):wn}function _n(t,e){function n(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/i+t;return Qo(i)1&&tt(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function En(t,e){return t[0]-e[0]||t[1]-e[1]}function Cn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Ln(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,s=r[0]-o,l=t[1],u=n[1],c=e[1]-l,h=r[1]-u,f=(s*(l-u)-h*(i-o))/(h*a-s*c);return[i+f*a,l+f*c]}function Pn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function In(){Qn(this),this.edge=this.site=this.circle=null}function On(t){var e=Bs.pop()||new In;return e.site=t,e}function Dn(t){qn(t),Ns.remove(t),Bs.push(t),Qn(t)}function zn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,s=[t];Dn(t);for(var l=o;l.circle&&Qo(n-l.circle.x)va)s=s.L;else{if(!((i=o-Rn(s,a))>va)){r>-va?(e=s.P,n=s):i>-va?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}var l=On(t);if(Ns.insert(e,l),e||n){if(e===n)return qn(e),n=On(e.site),Ns.insert(l,n),l.edge=n.edge=Xn(e.site,l.site),Hn(e),void Hn(n);if(n){qn(e),qn(n);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=n.site,m=p.x-c,v=p.y-h,g=2*(f*v-d*m),y=f*f+d*d,x=m*m+v*v,b={x:(v*y-d*x)/g+c,y:(f*x-m*y)/g+h};Kn(n.edge,u,p,b),l.edge=Xn(u,t,null,b),n.edge=Xn(t,p,null,b),Hn(e),Hn(n)}else l.edge=Xn(e.site,l.site)}}function Nn(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var s=(n=a.site).x,l=n.y,u=l-e;if(!u)return s;var c=s-r,h=1/o-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-o/2)))/h+r:(r+s)/2}function Rn(t,e){var n=t.N;if(n)return Nn(n,e);var r=t.site;return r.y===e?r.x:1/0}function Fn(t){this.site=t,this.edges=[]}function Bn(t){for(var e,n,r,i,o,a,s,l,u,c,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=js,v=m.length;v--;)if((o=m[v])&&o.prepare())for(l=(s=o.edges).length,a=0;ava||Qo(i-n)>va)&&(s.splice(a,0,new Jn(Zn(o.site,c,Qo(r-h)va?{x:h,y:Qo(e-h)va?{x:Qo(n-p)va?{x:f,y:Qo(e-f)va?{x:Qo(n-d)=-ga)){var f=l*l+u*u,d=c*c+v*v,p=(v*f-u*d)/h,m=(l*d-c*f)/h,v=m+s,g=Us.pop()||new Vn;g.arc=t,g.site=i,g.x=p+a,g.y=v+Math.sqrt(p*p+m*m),g.cy=v,t.circle=g;for(var y=null,x=Fs._;x;)if(g.y=s)return;if(f>p){if(o){if(o.y>=u)return}else o={x:v,y:l};n={x:v,y:u}}else{if(o){if(o.y1)if(f>p){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.xo||h>a||f=_)<<1|e>=b,M=w+4;wo&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:fr(n,r)})),o=qs.lastIndex;return o=0&&!(n=Ho.interpolators[r](t,e)););return n}function mr(t,e){var n,r=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;n=1?1:t(e)}}function gr(t){return function(e){return 1-t(1-e)}}function yr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function xr(t){return t*t}function br(t){return t*t*t}function _r(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function wr(t){return 1-Math.cos(t*_a)}function Mr(t){return Math.pow(2,10*(t-1))}function kr(t){return 1-Math.sqrt(1-t*t)}function Tr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Ar(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Sr(t){var e=[t.a,t.b],n=[t.c,t.d],r=Cr(e),i=Er(e,n),o=Cr(Lr(n,e,-i))||0;e[0]*n[1]180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(Pr(n)+"rotate(",null,")")-2,x:fr(t,e)})):e&&n.push(Pr(n)+"rotate("+e+")")}function Dr(t,e,n,r){t!==e?r.push({i:n.push(Pr(n)+"skewX(",null,")")-2,x:fr(t,e)}):e&&n.push(Pr(n)+"skewX("+e+")")}function zr(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var i=n.push(Pr(n)+"scale(",null,",",null,")");r.push({i:i-4,x:fr(t[0],e[0])},{i:i-2,x:fr(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(Pr(n)+"scale("+e+")")}function jr(t,e){var n=[],r=[];return t=Ho.transform(t),e=Ho.transform(e),Ir(t.translate,e.translate,n,r),Or(t.rotate,e.rotate,n,r),Dr(t.skew,e.skew,n,r),zr(t.scale,e.scale,n,r),t=e=null,function(t){for(var e,i=-1,o=r.length;++i=0;)n.push(i[r])}function Zr(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++ai&&(r=n,i=e);return r}function ai(t){return t.reduce(si,0)}function si(t,e){return t+e[1]}function li(t,e){return ui(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function ui(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function ci(t){return[Ho.min(t),Ho.max(t)]}function hi(t,e){return t.value-e.value}function fi(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function di(t,e){t._pack_next=e,e._pack_prev=t}function pi(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function mi(t){function e(t){c=Math.min(t.x-t.r,c),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((n=t.children)&&(u=n.length)){var n,r,i,o,a,s,l,u,c=1/0,h=-1/0,f=1/0,d=-1/0;if(n.forEach(vi),r=n[0],r.x=-r.r,r.y=0,e(r),u>1&&(i=n[1],i.x=i.r,i.y=0,e(i),u>2))for(xi(r,i,o=n[2]),e(o),fi(r,o),r._pack_prev=o,fi(o,i),i=r._pack_next,a=3;a=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Ti(t,e,n){return t.a.parent===e.parent?t.a:n}function Ai(t){return 1+Ho.max(t,function(t){return t.y})}function Si(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ei(t){var e=t.children;return e&&e.length?Ei(e[0]):t}function Ci(t){var e,n=t.children;return n&&(e=n.length)?Ci(n[e-1]):t}function Li(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Pi(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return i<0&&(n+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function Ii(t){var e=t[0],n=t[t.length-1];return e2?Ni:Di,l=r?Rr:Nr;return a=i(t,e,l,n),s=i(e,t,l,pr),o}function o(t){return a(t)}var a,s;return o.invert=function(t){return s(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},o.range=function(t){return arguments.length?(e=t,i()):e},o.rangeRound=function(t){return o.range(t).interpolate(Ar)},o.clamp=function(t){return arguments.length?(r=t,i()):r},o.interpolate=function(t){return arguments.length?(n=t,i()):n},o.ticks=function(e){return Vi(t,e)},o.tickFormat=function(e,n){return Hi(t,e,n)},o.nice=function(e){return Bi(t,e),i()},o.copy=function(){return Ri(t,e,n,r)},i()}function Fi(t,e){return Ho.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Bi(t,e){return zi(t,ji(Ui(t,e)[2])),zi(t,ji(Ui(t,e)[2])),t}function Ui(t,e){null==e&&(e=10);var n=Ii(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Vi(t,e){return Ho.range.apply(Ho,Ui(t,e))}function Hi(t,e,n){var r=Ui(t,e);if(n){var i=Ha.exec(n);if(i.shift(),"s"===i[8]){var o=Ho.formatPrefix(Math.max(Qo(r[0]),Qo(r[1])));return i[7]||(i[7]="."+qi(o.scale(r[2]))),i[8]="f",n=Ho.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+Wi(i[8],r)),n=i.join("")}else n=",."+qi(r[2])+"f";return Ho.format(n)}function qi(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Wi(t,e){var n=qi(e[2]);return t in nl?Math.abs(n-qi(Math.max(Qo(e[0]),Qo(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Gi(t,e,n,r){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}return a.invert=function(e){return o(t.invert(e))},a.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),a):r},a.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),a):e},a.nice=function(){var e=zi(r.map(i),n?Math:il);return t.domain(e),r=e.map(o),a},a.ticks=function(){var t=Ii(r),a=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(c-u)){if(n){for(;u0;f--)a.push(o(u)*f);for(u=0;a[u]l;c--);a=a.slice(u,c)}return a},a.tickFormat=function(t,n){if(!arguments.length)return rl;arguments.length<2?n=rl:"function"!=typeof n&&(n=Ho.format(n));var r=Math.max(1,e*t/a.ticks().length);return function(t){var a=t/o(Math.round(i(t)));return a*e0?s[n-1]:t[0],n0?0:1}function so(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=t[0]+l,h=t[1]+u,f=e[0]+l,d=e[1]+u,p=(c+f)/2,m=(h+d)/2,v=f-c,g=d-h,y=v*v+g*g,x=n-r,b=c*d-f*h,_=(g<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*g-v*_)/y,M=(-b*v-g*_)/y,k=(b*g+v*_)/y,T=(-b*v+g*_)/y,A=w-p,S=M-m,E=k-p,C=T-m;return A*A+S*S>E*E+C*C&&(w=k,M=T),[[w-l,M-u],[w*n/x,M*n/x]]}function lo(t){function e(e){function a(){u.push("M",o(t(c),s))}for(var l,u=[],c=[],h=-1,f=e.length,d=St(n),p=St(r);++h1?t.join("L"):t+"Z"}function co(t){return t.join("L")+"Z"}function ho(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){s=e[1],o=t[l],l++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u9&&(i=3*e/Math.sqrt(i),a[s]=i*n,a[s+1]=i*r);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}function wo(t){for(var e,n,r,i=-1,o=t.length;++i0;)f[--s].call(t,a);if(o>=1)return p.event&&p.event.end.call(t,t.__data__,e),--d.count?delete d[r]:delete t[n],1}var s,l,u,h,f,d=t[n]||(t[n]={active:0,count:0}),p=d[r];p||(s=i.time,l=It(function(t){var e=p.delay;if(l.t=e+s,e<=t)return o(t-e);l.c=o},0,s),p=d[r]={tween:new c,time:s,timer:l,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++d.count)}function jo(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function No(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ro(t){return t.toISOString()}function Fo(t,e,n){function r(e){return t(e)}function i(t,n){var r=(t[1]-t[0])/n,i=Ho.bisect(Cl,r);return i==Cl.length?[e.year,Ui(t.map(function(t){return t/31536e6}),n)[2]]:i?e[r/Cl[i-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=Bo(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Bo(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Ii(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(n[0],Bo(+n[1]+1),e<1?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Fo(t.copy(),e,n)},Fi(r,t)}function Bo(t){return new Date(t)}function Uo(t){return JSON.parse(t.responseText)}function Vo(t){var e=Go.createRange();return e.selectNode(Go.body),e.createContextualFragment(t.responseText)}var Ho={version:"3.5.17"},qo=[].slice,Wo=function(t){return qo.call(t)},Go=this.document;if(Go)try{Wo(Go.documentElement.childNodes)[0].nodeType}catch(t){Wo=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),Go)try{Go.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var Yo=this.Element.prototype,Xo=Yo.setAttribute,Zo=Yo.setAttributeNS,Ko=this.CSSStyleDeclaration.prototype,Jo=Ko.setProperty;Yo.setAttribute=function(t,e){Xo.call(this,t,e+"")},Yo.setAttributeNS=function(t,e,n){Zo.call(this,t,e,n+"")},Ko.setProperty=function(t,e,n){Jo.call(this,t,e+"",n)}}Ho.ascending=r,Ho.descending=function(t,e){return et?1:e>=t?0:NaN},Ho.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n},Ho.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n},Ho.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o=r){n=i=r;break}for(;++or&&(n=r),i=r){n=i=r;break}for(;++or&&(n=r),i1)return l/(c-1)},Ho.deviation=function(){var t=Ho.variance.apply(this,arguments);return t?Math.sqrt(t):t};var $o=a(r);Ho.bisectLeft=$o.left,Ho.bisect=Ho.bisectRight=$o.right,Ho.bisector=function(t){return a(1===t.length?function(e,n){return r(t(e),n)}:t)},Ho.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,o<2&&(e=0));for(var r,i,o=n-e;o;)i=Math.random()*o--|0,r=t[o+e],t[o+e]=t[i+e],t[i+e]=r;return t},Ho.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},Ho.pairs=function(t){for(var e=0,n=t.length-1,r=t[0],i=new Array(n<0?0:n);e=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n};var Qo=Math.abs;Ho.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var r,i=[],o=l(Qo(n)),a=-1;if(t*=o,e*=o,(n*=o)<0)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)=o.length)return r?r.call(i,a):n?a.sort(n):a;for(var l,u,h,f,d=-1,p=a.length,m=o[s++],v=new c;++d=o.length)return t;var r=[],i=a[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},o=[],a=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(Ho.map,n,0),0)},i.key=function(t){return o.push(t),i},i.sortKeys=function(t){return a[o.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},Ho.set=function(t){var e=new y;if(t)for(var n=0,r=t.length;n=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},Ho.event=null,Ho.requote=function(t){return t.replace(ra,"\\$&")};var ra=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ia={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},oa=function(t,e){return e.querySelector(t)},aa=function(t,e){return e.querySelectorAll(t)},sa=function(t,e){var n=t.matches||t[_(t,"matchesSelector")];return(sa=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(oa=function(t,e){return Sizzle(t,e)[0]||null},aa=Sizzle,sa=Sizzle.matchesSelector),Ho.selection=function(){return Ho.select(Go.documentElement)};var la=Ho.selection.prototype=[];la.select=function(t){var e,n,r,i,o=[];t=C(t);for(var a=-1,s=this.length;++a=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),ca.hasOwnProperty(n)?{space:ca[n],local:t}:t}},la.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=Ho.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(P(e,t[e]));return this}return this.each(P(t,e))},la.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=D(t)).length,i=-1;if(e=n.classList){for(;++i=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},la.sort=function(t){t=H.apply(this,arguments);for(var e=-1,n=this.length;++e0&&(e=e.transition().duration(C)),e.call(t.event)}function s(){_&&_.domain(b.range().map(function(t){return(t-k.x)/k.k}).map(b.invert)),M&&M.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){L++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),v=null)}function h(){var t=this,r=z.of(t,arguments),i=0,a=Ho.select(n(t)).on(I,function(){i=1,o(Ho.mouse(t),s),u(r)}).on(O,function(){a.on(I,null).on(O,null),h(i),c(r)}),s=e(Ho.mouse(t)),h=K(t);xl.call(t),l(r)}function f(){function t(){var t=Ho.touches(p);return d=k.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function n(){var e=Ho.event.target;Ho.select(e).on(b,r).on(_,s),w.push(e);for(var n=Ho.event.changedTouches,i=0,o=n.length;i1){var c=l[0],h=l[1],f=c[0]-h[0],d=c[1]-h[1];g=f*f+d*d}}function r(){var t,e,n,r,a=Ho.touches(p);xl.call(p);for(var s=0,l=a.length;s=u)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++8?function(t){return t/n}:function(t){return t*n},symbol:t}});Ho.formatPrefix=function(t,e){var n=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=Ho.round(t,jt(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Va[8+n/3]};var Ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,qa=Ho.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Ho.round(t,jt(t,e))).toFixed(Math.max(0,Math.min(20,jt(t*(1+1e-15),e))))}}),Wa=Ho.time={},Ga=Date;Ft.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(){Ya.setUTCDate.apply(this._,arguments)},setDay:function(){Ya.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ya.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ya.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ya.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ya.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ya.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ya.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ya.setTime.apply(this._,arguments)}};var Ya=Date.prototype;Wa.year=Bt(function(t){return(t=Wa.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Wa.years=Wa.year.range,Wa.years.utc=Wa.year.utc.range,Wa.day=Bt(function(t){var e=new Ga(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Wa.days=Wa.day.range,Wa.days.utc=Wa.day.utc.range,Wa.dayOfYear=function(t){var e=Wa.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=Wa[t]=Bt(function(t){return(t=Wa.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=Wa.year(t).getDay();return Math.floor((Wa.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});Wa[t+"s"]=n.range,Wa[t+"s"].utc=n.utc.range,Wa[t+"OfYear"]=function(t){var n=Wa.year(t).getDay();return Math.floor((Wa.dayOfYear(t)+(n+e)%7)/7)}}),Wa.week=Wa.sunday,Wa.weeks=Wa.sunday.range,Wa.weeks.utc=Wa.sunday.utc.range,Wa.weekOfYear=Wa.sundayOfYear;var Xa={"-":"",_:" ",0:"0"},Za=/^\s*\d+/,Ka=/^%/;Ho.locale=function(t){return{numberFormat:Nt(t),timeFormat:Vt(t)}};var Ja=Ho.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"]});Ho.format=Ja.numberFormat,Ho.geo={},ue.prototype={s:0,t:0,add:function(t){ce(t,this.t,$a),ce($a.s,this.s,this),this.s?this.t+=$a.t:this.s=$a.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var $a=new ue;Ho.geo.stream=function(t,e){t&&Qa.hasOwnProperty(t.type)?Qa[t.type](t,e):he(t,e)};var Qa={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rd&&(d=e)}function e(e,n){var r=me([e*wa,n*wa]);if(g){var i=ge(g,r),o=ge([i[1],-i[0],0],i);be(o),o=_e(o);var a=e-p,l=a>0?1:-1,u=o[0]*Ma*l,m=Qo(a)>180;if(m^(l*pd&&(d=v);else if(u=(u+360)%360-180,m^(l*pd&&(d=n);m?es(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e):f>=c?(ef&&(f=e)):e>p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e)}else t(e,n);g=r,p=e}function n(){_.point=e}function r(){b[0]=c,b[1]=f,_.point=t,g=null}function i(t,n){if(g){var r=t-p;y+=Qo(r)>180?r+(r>0?360:-360):r}else m=t,v=n;rs.point(t,n),e(t,n)}function o(){rs.lineStart()}function a(){i(m,v),rs.lineEnd(),Qo(y)>va&&(c=-(f=180)),b[0]=c,b[1]=f,g=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tva?d=90:y<-va&&(h=-90),b[0]=c,b[1]=f}};return function(t){d=f=-(c=h=1/0),x=[],Ho.geo.stream(t,_);var e=x.length;if(e){x.sort(l);for(var n=1,r=[p=x[0]];ns(p[0],p[1])&&(p[1]=o[1]),s(o[0],p[1])>s(p[0],p[1])&&(p[0]=o[0])):r.push(p=o);for(var i,o,a=-1/0,n=0,p=r[e=r.length-1];n<=e;p=o,++n)o=r[n],(i=s(p[1],o[0]))>a&&(a=i,c=o[0],f=p[1])}return x=b=null,c===1/0||h===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,h],[f,d]]}}(),Ho.geo.centroid=function(t){is=os=as=ss=ls=us=cs=hs=fs=ds=ps=0,Ho.geo.stream(t,ms);var e=fs,n=ds,r=ps,i=e*e+n*n+r*r;return i0?ya:-ya,l=Qo(o-n);Qo(l-ya)0?_a:-_a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&l>=ya&&(Qo(n-i)va){var o=t[0]=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:o).invert(t)},t.stream=function(t){var e=o.stream(t),n=a.stream(t),r=s.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(o.precision(e),a.precision(e),s.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),a.scale(.35*e),s.scale(e),t.translate(o.translate())):o.scale()},t.translate=function(e){if(!arguments.length)return o.translate();var u=o.scale(),c=+e[0],h=+e[1];return n=o.translate(e).clipExtent([[c-.455*u,h-.238*u],[c+.455*u,h+.238*u]]).stream(l).point,r=a.translate([c-.307*u,h+.201*u]).clipExtent([[c-.425*u+va,h+.12*u+va],[c-.214*u-va,h+.234*u-va]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+va,h+.166*u+va],[c-.115*u-va,h+.234*u-va]]).stream(l).point,t},t.scale(1070)};var ys,xs,bs,_s,ws,Ms,ks={point:w,lineStart:w,lineEnd:w,polygonStart:function(){xs=0,ks.lineStart=qe},polygonEnd:function(){ks.lineStart=ks.lineEnd=ks.point=w,ys+=Qo(xs/2)}},Ts={point:function(t,e){tws&&(ws=t),e<_s&&(_s=e),e>Ms&&(Ms=e)},lineStart:w,lineEnd:w,polygonStart:w,polygonEnd:w},As={point:Ye,lineStart:Xe,lineEnd:Ze,polygonStart:function(){As.lineStart=Ke},polygonEnd:function(){As.point=Ye,As.lineStart=Xe,As.lineEnd=Ze}};Ho.geo.path=function(){function t(t){return t&&("function"==typeof s&&o.pointRadius(+s.apply(this,arguments)),a&&a.valid||(a=i(o)),Ho.geo.stream(t,a)),o.result()}function e(){return a=null,t}var n,r,i,o,a,s=4.5;return t.area=function(t){return ys=0,Ho.geo.stream(t,i(ks)),ys},t.centroid=function(t){return as=ss=ls=us=cs=hs=fs=ds=ps=0,Ho.geo.stream(t,i(As)),ps?[fs/ps,ds/ps]:hs?[us/hs,cs/hs]:ls?[as/ls,ss/ls]:[NaN,NaN]},t.bounds=function(t){return ws=Ms=-(bs=_s=1/0),Ho.geo.stream(t,i(Ts)),[[bs,_s],[ws,Ms]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||Qe(t):x,e()):n},t.context=function(t){return arguments.length?(o=null==(r=t)?new We:new Je(t),"function"!=typeof s&&o.pointRadius(s),e()):r},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(o.pointRadius(+e),+e),t):s},t.projection(Ho.geo.albersUsa()).context(null)},Ho.geo.transform=function(t){return{stream:function(e){var n=new tn(e);for(var r in t)n[r]=t[r];return n}}},tn.prototype={point:function(t,e){this.stream.point(t,e)},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()}},Ho.geo.projection=nn,Ho.geo.projectionMutator=rn,(Ho.geo.equirectangular=function(){return nn(an)}).raw=an.invert=an,Ho.geo.rotation=function(t){function e(e){return e=t(e[0]*wa,e[1]*wa),e[0]*=Ma,e[1]*=Ma,e}return t=ln(t[0]%360*wa,t[1]*wa,t.length>2?t[2]*wa:0),e.invert=function(e){return e=t.invert(e[0]*wa,e[1]*wa),e[0]*=Ma,e[1]*=Ma,e},e},sn.invert=an,Ho.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=ln(-t[0]*wa,-t[1]*wa,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Ma,t[1]*=Ma}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=fn((e=+r)*wa,i*wa),t):e},t.precision=function(r){return arguments.length?(n=fn(e*wa,(i=+r)*wa),t):i},t.angle(90)},Ho.geo.distance=function(t,e){var n,r=(e[0]-t[0])*wa,i=t[1]*wa,o=e[1]*wa,a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),h=Math.cos(o);return Math.atan2(Math.sqrt((n=h*a)*n+(n=u*c-l*h*s)*n),l*c+u*h*s)},Ho.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Ho.range(Math.ceil(o/v)*v,i,v).map(f).concat(Ho.range(Math.ceil(u/g)*g,l,g).map(d)).concat(Ho.range(Math.ceil(r/p)*p,n,p).filter(function(t){return Qo(t%v)>va}).map(c)).concat(Ho.range(Math.ceil(s/m)*m,a,m).filter(function(t){return Qo(t%g)>va}).map(h))}var n,r,i,o,a,s,l,u,c,h,f,d,p=10,m=p,v=90,g=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(o).concat(d(l).slice(1),f(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],o>i&&(e=o,o=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[o,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),t.precision(y)):[[r,s],[n,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],g=+e[1],t):[v,g]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=pn(s,a,90),h=mn(r,n,y),f=pn(u,l,90),d=mn(o,i,y),t):y},t.majorExtent([[-180,-90+va],[180,90-va]]).minorExtent([[-180,-80-va],[180,80+va]])},Ho.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=vn,i=gn;return t.distance=function(){return Ho.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},Ho.geo.interpolate=function(t,e){return yn(t[0]*wa,t[1]*wa,e[0]*wa,e[1]*wa)},Ho.geo.length=function(t){return Ss=0,Ho.geo.stream(t,Es),Ss};var Ss,Es={sphere:w,point:w,lineStart:function(){function t(t,i){var o=Math.sin(i*=wa),a=Math.cos(i),s=Qo((t*=wa)-e),l=Math.cos(s);Ss+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*o-n*a*l)*s),n*o+r*a*l),e=t,n=o,r=a}var e,n,r;Es.point=function(i,o){e=i*wa,n=Math.sin(o*=wa),r=Math.cos(o),Es.point=t},Es.lineEnd=function(){Es.point=Es.lineEnd=w}},lineEnd:w,polygonStart:w,polygonEnd:w},Cs=xn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Ho.geo.azimuthalEqualArea=function(){return nn(Cs)}).raw=Cs;var Ls=xn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(Ho.geo.azimuthalEquidistant=function(){return nn(Ls)}).raw=Ls,(Ho.geo.conicConformal=function(){return Ve(bn)}).raw=bn,(Ho.geo.conicEquidistant=function(){return Ve(_n)}).raw=_n;var Ps=xn(function(t){return 1/t},Math.atan);(Ho.geo.gnomonic=function(){return nn(Ps)}).raw=Ps,wn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-_a]},(Ho.geo.mercator=function(){return Mn(wn)}).raw=wn;var Is=xn(function(){return 1},Math.asin);(Ho.geo.orthographic=function(){return nn(Is)}).raw=Is;var Os=xn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Ho.geo.stereographic=function(){return nn(Os)}).raw=Os,kn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-_a]},(Ho.geo.transverseMercator=function(){var t=Mn(kn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=kn,Ho.geom={},Ho.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=St(n),o=St(r),a=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e=r&&u.x<=o&&u.y>=i&&u.y<=a?[[r,a],[o,a],[o,i],[r,i]]:[]).point=t[s]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/va)*va,y:Math.round(a(t,e)/va)*va,i:e}})}var r=Tn,i=An,o=r,a=i,s=Vs;return t?e(t):(e.links=function(t){return rr(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return rr(n(t)).cells.forEach(function(n,r){for(var i,o=n.site,a=n.edges.sort(Un),s=-1,l=a.length,u=a[l-1].edge,c=u.l===o?u.r:u.l;++s=u,f=r>=c,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),h?i=u:s=u,f?a=c:l=c,o(t,e,n,r,i,a,s,l)}var c,h,f,d,p,m,v,g,y,x=St(s),b=St(l);if(null!=e)m=e,v=n,g=r,y=i;else if(g=y=-(m=v=1/0),h=[],f=[],p=t.length,a)for(d=0;dg&&(g=c.x),c.y>y&&(y=c.y),h.push(c.x),f.push(c.y);else for(d=0;dg&&(g=_),w>y&&(y=w),h.push(_),f.push(w)}var M=g-m,k=y-v;M>k?y=v+M:g=m+k;var T={leaf:!0,nodes:[],point:null,x:null,y:null};if(T.add=function(t){o(T,t,+x(t,++d),+b(t,d),m,v,g,y)},T.visit=function(t){lr(t,T,m,v,g,y)},T.find=function(t){return ur(T,t[0],t[1],m,v,g,y)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=Gs.get(n)||Ws,r=Ys.get(r)||x,vr(r(n.apply(null,qo.call(arguments,1))))},Ho.interpolateHcl=function(t,e){t=Ho.hcl(t),e=Ho.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,s=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.c:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return ht(n+o*t,r+a*t,i+s*t)+""}},Ho.interpolateHsl=function(t,e){t=Ho.hsl(t),e=Ho.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,s=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.s:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return ut(n+o*t,r+a*t,i+s*t)+""}},Ho.interpolateLab=function(t,e){t=Ho.lab(t),e=Ho.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,s=e.b-i;return function(t){return dt(n+o*t,r+a*t,i+s*t)+""}},Ho.interpolateRound=Ar,Ho.transform=function(t){var e=Go.createElementNS(Ho.ns.prefix.svg,"g");return(Ho.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Sr(n?n.matrix:Xs)})(t)},Sr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Xs={a:1,b:0,c:0,d:1,e:0,f:0};Ho.interpolateTransform=jr,Ho.layout={},Ho.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n0?i=t:(n.c=null,n.t=NaN,n=null,u.end({type:"end",alpha:i=0})):t>0&&(u.start({type:"start",alpha:i=t}),n=It(l.tick)),l):i},l.start=function(){function t(t,r){if(!n){for(n=new Array(i),l=0;l=0;)a.push(c=u[l]),c.parent=o,c.depth=o.depth+1;r&&(o.value=0),o.children=u}else r&&(o.value=+r.call(t,o,o.depth)||0),delete o.children;return Zr(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),s}var e=$r,n=Kr,r=Jr;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(Xr(e,function(t){t.children&&(t.value=0)}),Zr(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},Ho.layout.partition=function(){function t(e,n,r,i){var o=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,s,l,u=-1;for(r=e.value?r/e.value:0;++us&&(s=r),a.push(r)}for(n=0;n0)for(o=-1;++o=c[0]&&s<=c[1]&&((a=l[Ho.bisect(h,s,1,d)-1]).y+=p,a.push(t[o]));return l}var e=!0,n=Number,r=ci,i=li;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=St(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return ui(t,e)}:St(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},Ho.layout.pack=function(){function t(t,o){var a=n.call(this,t,o),s=a[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Zr(s,function(t){t.r=+c(t.value)}),Zr(s,mi),r){var h=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;Zr(s,function(t){t.r+=h}),Zr(s,mi),Zr(s,function(t){t.r-=h})}return yi(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),a}var e,n=Ho.layout.hierarchy().sort(hi),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Yr(t,n)},Ho.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),h=c[0],f=e(h);if(Zr(f,n),f.parent.m=-f.z,Xr(f,r),u)Xr(h,o);else{var d=h,p=h,m=h;Xr(h,function(t){t.xp.x&&(p=t),t.depth>m.depth&&(m=t)});var v=s(d,p)/2-d.x,g=l[0]/(p.x+s(p,d)/2+v),y=l[1]/(m.depth||1);Xr(h,function(t){t.x=(t.x+v)*g,t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,o=e.children,a=0,s=o.length;a0&&(Mi(Ti(a,t,n),t,r),u+=r,c+=r),h+=a.m,u+=i.m,f+=l.m,c+=o.m;a&&!wi(o)&&(o.t=a,o.m+=h-c),i&&!_i(l)&&(l.t=i,l.m+=u-f,n=t)}return n}function o(t){t.x*=l[0],t.y=t.depth*l[1]}var a=Ho.layout.hierarchy().sort(null).value(null),s=bi,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?o:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:o,t):u?l:null},Yr(t,a)},Ho.layout.cluster=function(){function t(t,o){var a,s=e.call(this,t,o),l=s[0],u=0;Zr(l,function(t){var e=t.children;e&&e.length?(t.x=Si(e),t.y=Ai(e)):(t.x=a?u+=n(t,a):0,t.y=0,a=t)});var c=Ei(l),h=Ci(l),f=c.x-n(c,h)/2,d=h.x+n(h,c)/2;return Zr(l,i?function(t){t.x=(t.x-l.x)*r[0],t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-f)/(d-f)*r[0],t.y=(1-(l.y?t.y/l.y:1))*r[1]}),s}var e=Ho.layout.hierarchy().sort(null).value(null),n=bi,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Yr(t,e)},Ho.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++i0;)c.push(a=f[l-1]),c.area+=a.area,"squarify"!==d||(s=r(c,m))<=p?(f.pop(),p=s):(c.area-=c.pop().area,i(c,m,u,!1),m=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,m,u,!0),c.length=c.area=0),o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=h(e),s=r.slice(),l=[];for(t(s,a.dx*a.dy/e.value),l.area=0;o=s.pop();)l.push(o),l.area+=o.area,null!=o.z&&(i(l,o.z?a.dx:a.dy,a,!s.length),l.length=l.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,s=t.length;++ai&&(i=n));return r*=r,e*=e,r?Math.max(e*i*p/r,r/(e*o*p)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,s=n.x,u=n.y,c=e?l(t.area/e):0;if(e==n.dx){for((r||c>n.dy)&&(c=n.dy);++on.dx)&&(c=n.dx);++o1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Ho.random.normal.apply(Ho,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=Ho.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;nh?0:1;if(u=ba)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,m,v,g,y,x,b,_,w,M,k,T,A=0,S=0,E=[];if((g=(+l.apply(this,arguments)||0)/2)&&(v=o===ul?Math.sqrt(t*t+u*u):+o.apply(this,arguments),d||(S*=-1),u&&(S=nt(v/u*Math.sin(g))),t&&(A=nt(v/t*Math.sin(g)))),u){y=u*Math.cos(c+S),x=u*Math.sin(c+S),b=u*Math.cos(h-S),_=u*Math.sin(h-S);var C=Math.abs(h-c-2*S)<=ya?0:1;if(S&&ao(y,x,b,_)===d^C){var L=(c+h)/2;y=u*Math.cos(L),x=u*Math.sin(L),b=_=null}}else y=x=0;if(t){w=t*Math.cos(h-A),M=t*Math.sin(h-A),k=t*Math.cos(c+A),T=t*Math.sin(c+A);var P=Math.abs(c-h+2*A)<=ya?0:1;if(A&&ao(w,M,k,T)===1-d^P){var I=(c+h)/2;w=t*Math.cos(I),M=t*Math.sin(I),k=T=null}}else w=M=0;if(f>va&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",r[0]),i.join("")},"step-before":ho,"step-after":fo,basis:vo,"basis-open":function(t){if(t.length<4)return uo(t);for(var e,n=[],r=-1,i=t.length,o=[0],a=[0];++r<3;)e=t[r],o.push(e[0]),a.push(e[1]);for(n.push(go(dl,o)+","+go(dl,a)),--r;++rya)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var o=vn,a=gn,s=ko,l=ro,u=io;return t.radius=function(e){return arguments.length?(s=St(e),t):s},t.source=function(e){return arguments.length?(o=St(e),t):o},t.target=function(e){return arguments.length?(a=St(e),t):a},t.startAngle=function(e){return arguments.length?(l=St(e),t):l},t.endAngle=function(e){return arguments.length?(u=St(e),t):u},t},Ho.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=n.call(this,t,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=vn,n=gn,r=To;return t.source=function(n){return arguments.length?(e=St(n),t):e},t.target=function(e){return arguments.length?(n=St(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},Ho.svg.diagonal.radial=function(){var t=Ho.svg.diagonal(),e=To,n=t.projection;return t.projection=function(t){return arguments.length?n(Ao(e=t)):e},t},Ho.svg.symbol=function(){function t(t,r){return(pl.get(e.call(this,t,r))||Co)(n.call(this,t,r))}var e=Eo,n=So;return t.type=function(n){return arguments.length?(e=St(n),t):e},t.size=function(e){return arguments.length?(n=St(e),t):n},t};var pl=Ho.map({circle:Co,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*vl)),n=e*vl;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ml),n=e*ml/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ml),n=e*ml/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});Ho.svg.symbolTypes=pl.keys();var ml=Math.sqrt(3),vl=Math.tan(30*wa);la.transition=function(t){for(var e,n,r=gl||++_l,i=Do(t),o=[],a=yl||{time:Date.now(),ease:_r,delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function o(){function o(){var t=Ho.mouse(x),n=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||(Ho.event.altKey?(g||(g=[(h[0]+h[1])/2,(f[0]+f[1])/2]),C[0]=h[+(t[0]=2)return!1;t[n]=r}return!0}):w.filter(function(t){for(var e=0;e<=l;++e){var n=y[t[e]];if(n<0)return!1;t[e]=n}return!0}),1&l)for(h=0;h>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var n=e.exports.lo(t),r=e.exports.hi(t),i=1048575&r;return 2146435072&r&&(i+=1<<20),[n,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t(51).Buffer)},{51:51}],101:[function(t,e,n){"use strict";function r(t,e,n){var i=0|t[n];if(i<=0)return[];var o,a=new Array(i);if(n===t.length-1)for(o=0;o0)return i(0|t,e);break;case"object":if("number"==typeof t.length)return r(t,e,0)}return[]}},{}],102:[function(t,e,n){"use strict";function r(t,e,n){n=n||2;var r=e&&e.length,o=r?e[0]*n:t.length,s=i(t,0,o,n,!0),l=[];if(!s)return l;var u,c,f,d,p,m,v;if(r&&(s=h(t,e,s,n)),t.length>80*n){u=f=t[0],c=d=t[1];for(var g=n;gf&&(f=p),m>d&&(d=m);v=Math.max(f-u,d-c)}return a(s,l,n,u,c,v),l}function i(t,e,n,r,i){var o,a;if(i===P(t,e,n,r)>0)for(o=e;o=e;o-=r)a=E(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(C(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!w(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(C(r),(r=e=r.prev)===r.next)return null;n=!0}}while(n||r!==e);return e}function a(t,e,n,r,i,h,f){if(t){!f&&h&&m(t,r,i,h);for(var d,p,v=t;t.prev!==t.next;)if(d=t.prev,p=t.next,h?l(t,r,i,h):s(t))e.push(d.i/n),e.push(t.i/n),e.push(p.i/n),C(t),t=p.next,v=p.next;else if((t=p)===v){f?1===f?a(t=u(t,e,n),e,n,r,i,h,2):2===f&&c(t,e,n,r,i,h):a(o(t),e,n,r,i,h,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(_(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(x(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,n,r){var i=t.prev,o=t,a=t.next;if(_(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=g(s,l,e,n,r),f=g(u,c,e,n,r),d=t.nextZ;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&x(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&x(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!w(i,o)&&M(i,r,r.next,o)&&T(i,o)&&T(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),C(r),C(r.next),r=t=o),r=r.next}while(r!==t);return r}function c(t,e,n,r,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&b(l,u)){var c=S(l,u);return l=o(l,l.next),c=o(c,c.next),a(l,e,n,r,i,s),void a(c,e,n,r,i,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e,n,r){var a,s,l,u=[];for(a=0,s=e.length;a=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=c&&x(on.x)&&T(r,t)&&(n=r,f=l),r=r.next;return n}function m(t,e,n,r){var i=t;do{null===i.z&&(i.z=g(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(t){var e,n,r,i,o,a,s,l,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||l>0&&r;)0===s?(i=r,r=r.nextZ,l--):0!==l&&r?n.z<=r.z?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--):(i=n,n=n.nextZ,s--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1);return t}function g(t,e,n,r,i){return t=32767*(t-n)/i,e=32767*(e-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,n=t;do{e.x=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function b(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!k(t,e)&&T(t,e)&&T(e,t)&&A(t,e)}function _(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,n,r){return!!(w(t,e)&&w(n,r)||w(t,r)&&w(n,e))||_(t,e,n)>0!=_(t,e,r)>0&&_(n,r,t)>0!=_(n,r,e)>0}function k(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&M(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function T(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function A(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}function S(t,e){var n=new L(t.i,t.x,t.y),r=new L(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function E(t,e,n,r){var i=new L(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function L(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(t,e,n,r){for(var i=0,o=e,a=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n}},{}],103:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.length;if("number"!=typeof e){for(e=0,a=0;a0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},r.prototype.removeListener=function(t,e){var n,r,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,r=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(n)){for(s=o;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},{}],106:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r=e||0,i=n||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[r*t[12]+t[8],r*t[13]+t[9],r*t[14]+t[10],r*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],107:[function(t,e,n){"use strict";function r(t){for(var e,n=t.length,r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0===(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}},{}],108:[function(t,e,n){"use strict";var r=t(115),i={listen:function(t,e,n){return t.addEventListener?(t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}}):t.attachEvent?(t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}):void 0},capture:function(t,e,n){return t.addEventListener?(t.addEventListener(e,n,!0),{remove:function(){t.removeEventListener(e,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=i},{115:115}],109:[function(t,e,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=i},{}],110:[function(t,e,n){"use strict";var r=/-(.)/g;e.exports=function(t){return t.replace(r,function(t,e){return e.toUpperCase()})}},{}],111:[function(t,e,n){"use strict";var r=t(110),i=/^-ms-/;e.exports=function(t){return r(t.replace(i,"ms-"))}},{110:110}],112:[function(t,e,n){"use strict";function r(t,e){return!(!t||!e)&&(t===e||!i(t)&&(i(e)?r(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}var i=t(125);e.exports=r},{125:125}],113:[function(t,e,n){"use strict";function r(t){var e=t.length;if((Array.isArray(t)||"object"!=typeof t&&"function"!=typeof t)&&o(!1),"number"!=typeof e&&o(!1),0===e||e-1 in t||o(!1),"function"==typeof t.callee&&o(!1),t.hasOwnProperty)try{return Array.prototype.slice.call(t)}catch(t){}for(var n=Array(e),r=0;r',""],l=[1,"","
"],u=[3,"","
"],c=[1,'',""],h={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:s,option:s,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:u,th:u};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(t){h[t]=c,a[t]=!0}),e.exports=function(t){return o||i(!1),h.hasOwnProperty(t)||(t="*"),a.hasOwnProperty(t)||(o.innerHTML="*"===t?"":"<"+t+">",a[t]=!o.firstChild),a[t]?h[t]:null}},{109:109,123:123}],120:[function(t,e,n){"use strict";e.exports=function(t){return t.Window&&t instanceof t.Window?{x:t.pageXOffset||t.document.documentElement.scrollLeft,y:t.pageYOffset||t.document.documentElement.scrollTop}:{x:t.scrollLeft,y:t.scrollTop}}},{}],121:[function(t,e,n){"use strict";var r=/([A-Z])/g;e.exports=function(t){return t.replace(r,"-$1").toLowerCase()}},{}],122:[function(t,e,n){"use strict";var r=t(121),i=/^ms-/;e.exports=function(t){return r(t).replace(i,"-ms-")}},{121:121}],123:[function(t,e,n){"use strict";var r=function(t){};e.exports=function(t,e,n,i,o,a,s,l){if(r(e),!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,i,o,a,s,l],h=0;(u=new Error(e.replace(/%s/g,function(){return c[h++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},{}],124:[function(t,e,n){"use strict";e.exports=function(t){var e=(t?t.ownerDocument||t:document).defaultView||window;return!(!t||!("function"==typeof e.Node?t instanceof e.Node:"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName))}},{}],125:[function(t,e,n){"use strict";var r=t(124);e.exports=function(t){return r(t)&&3==t.nodeType}},{124:124}],126:[function(t,e,n){"use strict";e.exports=function(t){var e={};return function(n){return e.hasOwnProperty(n)||(e[n]=t.call(this,n)),e[n]}}},{}],127:[function(t,e,n){"use strict";var r;t(109).canUseDOM&&(r=window.performance||window.msPerformance||window.webkitPerformance),e.exports=r||{}},{109:109}],128:[function(t,e,n){"use strict";var r,i=t(127);r=i.now?function(){return i.now()}:function(){return Date.now()},e.exports=r},{127:127}],129:[function(t,e,n){"use strict";function r(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!==t&&e!==e}var i=Object.prototype.hasOwnProperty;e.exports=function(t,e){if(r(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),o=Object.keys(e);if(n.length!==o.length)return!1;for(var a=0;a"===e||"<="===e||">="===e?o(t[1],t[2],e,!0):"any"===e?a(t.slice(1),"||"):"all"===e?a(t.slice(1),"&&"):"none"===e?u(a(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?u(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?u(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,n,r){var o=i(t),a="$type"===t?h.indexOf(e):JSON.stringify(e);return(r?"typeof "+o+"=== typeof "+a+"&&":"")+o+n+a}function a(t,e){return t.map(r).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var n=JSON.stringify(e.sort(c)),r=i(t);return e.length<=200?n+".indexOf("+r+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+r+", "+n+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function u(t){return"!("+t+")"}function c(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+r(t))};var h=["Unknown","Point","LineString","Polygon"]},{}],132:[function(t,e,n){"use strict";function r(t,e,n){return Math.min(e,Math.max(t,n))}function i(t,e,n){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var r=0;r=n-1)for(var f=l.length-1,p=t-e[n-1],d=0;d=n-1)for(var c=o.length-1,h=(e[n-1],0);h=0;--n)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),n=this.dimension;if(!(t0;--h)i.push(r(l[h-1],u[h-1],arguments[h])),o.push(0)}},l.push=function(t){var e=this.lastT(),n=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=n;f>0;--f){var d=r(u[f-1],c[f-1],arguments[f]);i.push(d),o.push((d-i[a++])*h)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)n.push(r(a[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),n=this.dimension;if(!(t<=e||arguments.length!==n+1)){var i=this._state,o=this._velocity,a=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=n;f>0;--f){var d=arguments[f];i.push(r(l[f-1],u[f-1],i[a++]+d)),o.push(d*h)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--h)i.push(r(l[h],u[h],i[a]+c*o[a])),o.push(0),a+=1}}},{39:39,85:85}],133:[function(t,e,n){"use strict";function r(t,e,n){if(a[e]&&a[e][t])return a[e][t];var r=o(t,{size:200,fontSize:200*n,fontFamily:e});a[e]||(a[e]={});var i={center:[r.center[0]/200,r.center[1]/200],bounds:r.bounds.map(function(t){return t/200}),radius:r.radius/200};return a[e][t]=i,i}var i=t(1265),o=t(471);e.exports=function(t){var e,n,o=(t=t||{}).canvas||document.createElement("canvas"),a=t.family||"sans-serif",s=t.shape||[512,512],l=t.step||[32,32],u=parseFloat(t.size)||16,c=t.chars||[32,126],h=Math.floor((l[0]-u)/2),f=t.radius||1.5*h,d=new i(u,h,f,0,a),p=null==t.align?"optical":t.align,m=null==t.fit||1==t.fit?.5:t.fit;if(Array.isArray(c)){if(2===c.length&&"number"==typeof c[0]&&"number"==typeof c[1]){var v=[];for(e=c[0],n=0;e<=c[1];e++)v[n++]=String.fromCharCode(e);c=v}}else c=String(c).split("");s=s.slice(),o.width=s[0],o.height=s[1];var g=o.getContext("2d");g.fillStyle="#000",g.fillRect(0,0,o.width,o.height),g.textBaseline="middle";var y=l[0],x=l[1],b=0,_=0,w=u/x,M=Math.min(c.length,Math.floor(s[0]/y)*Math.ceil(s[1]/x)),k=d.ctx.textAlign,T=d.buffer,A=d.middle;for(d.ctx.textAlign="center",d.buffer=d.size/2,e=0;es[0]-l[0]&&(b=0,_+=l[1])}return d.ctx.textAlign=k,d.buffer=T,d.middle=A,o};var a={}},{1265:1265,471:471}],134:[function(t,e,n){"use strict";function r(t,e,n,r,i,o){this._color=t,this.key=e,this.value=n,this.left=r,this.right=i,this._count=o}function i(t){return new r(t._color,t.key,t.value,t.left,t.right,t._count)}function o(t,e){return new r(t,e.key,e.value,e.left,e.right,e._count)}function a(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left&&(n=l(t,e.left)))return n;var n=t(e.key,e.value);return n||(e.right?l(t,e.right):void 0)}function u(t,e,n,r){if(e(t,r.key)<=0){if(r.left&&(i=u(t,e,n,r.left)))return i;var i=n(r.key,r.value);if(i)return i}if(r.right)return u(t,e,n,r.right)}function c(t,e,n,r,i){var o,a=n(t,i.key),s=n(e,i.key);if(a<=0){if(i.left&&(o=c(t,e,n,r,i.left)))return o;if(s>0&&(o=r(i.key,i.value)))return o}if(s>0&&i.right)return c(t,e,n,r,i.right)}function h(t,e){this.tree=t,this._stack=e}function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,n,r,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=v);if((n=t[l-1]).left===e){if((r=n.right).right&&r.right._color===m)return r=n.right=i(r),s=r.right=i(r.right),n.right=r.left,r.left=n,r.right=s,r._color=n._color,e._color=v,n._color=v,s._color=v,a(n),a(r),l>1&&((u=t[l-2]).left===n?u.left=r:u.right=r),void(t[l-1]=r);if(r.left&&r.left._color===m)return r=n.right=i(r),s=r.left=i(r.left),n.right=s.left,r.left=s.right,s.left=n,s.right=r,s._color=n._color,n._color=v,r._color=v,e._color=v,a(n),a(r),a(s),l>1&&((u=t[l-2]).left===n?u.left=s:u.right=s),void(t[l-1]=s);if(r._color===v){if(n._color===m)return n._color=v,void(n.right=o(m,r));n.right=o(m,r);continue}r=i(r),n.right=r.left,r.left=n,r._color=n._color,n._color=m,a(n),a(r),l>1&&((u=t[l-2]).left===n?u.left=r:u.right=r),t[l-1]=r,t[l]=n,l+11&&((u=t[l-2]).right===n?u.right=r:u.left=r),void(t[l-1]=r);if(r.right&&r.right._color===m)return r=n.left=i(r),s=r.right=i(r.right),n.left=s.right,r.right=s.left,s.right=n,s.left=r,s._color=n._color,n._color=v,r._color=v,e._color=v,a(n),a(r),a(s),l>1&&((u=t[l-2]).right===n?u.right=s:u.left=s),void(t[l-1]=s);if(r._color===v){if(n._color===m)return n._color=v,void(n.left=o(m,r));n.left=o(m,r);continue}if(r=i(r),n.left=r.right,r.right=n,r._color=n._color,n._color=m,a(n),a(r),l>1){var u=t[l-2];u.right===n?u.right=r:u.left=r}t[l-1]=r,t[l]=n,l+1e?1:0}e.exports=function(t){return new s(t||p,null)};var m=0,v=1,g=s.prototype;Object.defineProperty(g,"keys",{get:function(){var t=[];return this.forEach(function(e,n){t.push(e)}),t}}),Object.defineProperty(g,"values",{get:function(){var t=[];return this.forEach(function(e,n){t.push(n)}),t}}),Object.defineProperty(g,"length",{get:function(){return this.root?this.root._count:0}}),g.insert=function(t,e){for(var n=this._compare,i=this.root,l=[],u=[];i;){var c=n(t,i.key);l.push(i),u.push(c),i=c<=0?i.left:i.right}l.push(new r(m,t,e,null,null,1));for(h=l.length-2;h>=0;--h){i=l[h];u[h]<=0?l[h]=new r(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new r(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(var h=l.length-1;h>1;--h){var f=l[h-1],i=l[h];if(f._color===v||i._color===v)break;var d=l[h-2];if(d.left===f)if(f.left===i){if(!(p=d.right)||p._color!==m){d._color=m,d.left=f.right,f._color=v,f.right=d,l[h-2]=f,l[h-1]=i,a(d),a(f),h>=3&&((g=l[h-3]).left===d?g.left=f:g.right=f);break}f._color=v,d.right=o(v,p),d._color=m,h-=1}else{if(!(p=d.right)||p._color!==m){f.right=i.left,d._color=m,d.left=i.right,i._color=v,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,a(d),a(f),a(i),h>=3&&((g=l[h-3]).left===d?g.left=i:g.right=i);break}f._color=v,d.right=o(v,p),d._color=m,h-=1}else if(f.right===i){if(!(p=d.left)||p._color!==m){d._color=m,d.right=f.left,f._color=v,f.left=d,l[h-2]=f,l[h-1]=i,a(d),a(f),h>=3&&((g=l[h-3]).right===d?g.right=f:g.left=f);break}f._color=v,d.left=o(v,p),d._color=m,h-=1}else{var p=d.left;if(!p||p._color!==m){if(f.left=i.right,d._color=m,d.right=i.left,i._color=v,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,a(d),a(f),a(i),h>=3){var g=l[h-3];g.right===d?g.right=i:g.left=i}break}f._color=v,d.left=o(v,p),d._color=m,h-=1}}return l[0]._color=v,new s(n,l[0])},g.forEach=function(t,e,n){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,n)>=0)return;return c(e,n,this._compare,t,this.root)}},Object.defineProperty(g,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(g,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),g.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,n=[];;){if(n.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},g.ge=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o<=0&&(i=r.length),n=o<=0?n.left:n.right}return r.length=i,new h(this,r)},g.gt=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o<0&&(i=r.length),n=o<0?n.left:n.right}return r.length=i,new h(this,r)},g.lt=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o>0&&(i=r.length),n=o<=0?n.left:n.right}return r.length=i,new h(this,r)},g.le=function(t){for(var e=this._compare,n=this.root,r=[],i=0;n;){var o=e(t,n.key);r.push(n),o>=0&&(i=r.length),n=o<0?n.left:n.right}return r.length=i,new h(this,r)},g.find=function(t){for(var e=this._compare,n=this.root,r=[];n;){var i=e(t,n.key);if(r.push(n),0===i)return new h(this,r);n=i<=0?n.left:n.right}return new h(this,[])},g.remove=function(t){var e=this.find(t);return e?e.remove():this},g.get=function(t){for(var e=this._compare,n=this.root;n;){var r=e(t,n.key);if(0===r)return n.value;n=r<=0?n.left:n.right}};var y=h.prototype;Object.defineProperty(y,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(y,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),y.clone=function(){return new h(this.tree,this._stack.slice())},y.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),n=t[t.length-1];e[e.length-1]=new r(n._color,n.key,n.value,n.left,n.right,n._count);for(l=t.length-2;l>=0;--l)(n=t[l]).left===t[l+1]?e[l]=new r(n._color,n.key,n.value,e[l+1],n.right,n._count):e[l]=new r(n._color,n.key,n.value,n.left,e[l+1],n._count);if((n=e[e.length-1]).left&&n.right){var i=e.length;for(n=n.left;n.right;)e.push(n),n=n.right;var o=e[i-1];e.push(new r(n._color,o.key,o.value,n.left,n.right,n._count)),e[i-1].key=n.key,e[i-1].value=n.value;for(l=e.length-2;l>=i;--l)n=e[l],e[l]=new r(n._color,n.key,n.value,n.left,e[l+1],n._count);e[i-1].left=e[i]}if((n=e[e.length-1])._color===m){var a=e[e.length-2];a.left===n?a.left=null:a.right===n&&(a.right=null),e.pop();for(l=0;l0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(y,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(y,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var n=this.tree.root;return n?n._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var r=e.length-2;r>=0;--r)e[r+1]===e[r].right&&(++t,e[r].left&&(t+=e[r].left._count));return t},enumerable:!0}),y.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(y,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),y.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var n=new Array(e.length),i=e[e.length-1];n[n.length-1]=new r(i._color,i.key,t,i.left,i.right,i._count);for(var o=e.length-2;o>=0;--o)(i=e[o]).left===e[o+1]?n[o]=new r(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new r(i._color,i.key,i.value,i.left,n[o+1],i._count);return new s(this.tree._compare,n[0])},y.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(y,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],135:[function(t,e,n){function r(t){if(t<0)return Number("0/0");for(var e=a[0],n=a.length-1;n>0;--n)e+=a[n]/(t+n);var r=t+o+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(r)-r+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],o=607/128,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(r(e));e-=1;for(var n=i[0],o=1;o<9;o++)n+=i[o]/(e+o);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*n},e.exports.log=r},{}],136:[function(t,e,n){function r(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var n=1;n2){for(var n,r,i=0;i=0}var u=t(136);e.exports=r},{136:136}],138:[function(t,e,n){"use strict";function r(t,e,n,r){for(var i=[],o=0;o=e&&s<=n&&i.push(a)}return i}function i(t,e,n,r,i,a){for(var s=[],l=0;ln?(b.push(i(u,p,e),i(u,p,n)),a||(b=o(s,b,v,g,y))):d>=e&&b.push(i(u,p,e)):f>n?dn&&(b.push(i(u,p,n)),a||(b=o(s,b,v,g,y))));(f=(u=m[x-1])[r])>=e&&f<=n&&b.push(u),h=b[b.length-1],a&&h&&(b[0][0]!==h[0]||b[0][1]!==h[1])&&b.push(b[0]),o(s,b,v,g,y)}return s}function o(t,e,n,r,i){return e.length&&(e.area=n,e.dist=r,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,n,o,s,l,u,c){if(n/=e,o/=e,u>=n&&c<=o)return t;if(u>o||c=n&&p<=o)h.push(m);else if(!(d>o||p1?1:r,[n,r,0]}function a(t){for(var e,n,r=0,i=0,o=0;o1)return!1;var o=i.geometry[0].length;if(5!==o)return!1;for(var a=0;a1&&console.time("creation"),x=this.tiles[y]=d(t,g,n,r,b,e===p.maxZoom),this.tileCoords.push({z:e,x:n,y:r}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(x.source=t,s){if(e===p.maxZoom||e===s)continue;var w=1<1&&console.time("clipping");var M,k,T,A,S,E,C=.5*p.buffer/p.extent,L=.5-C,P=.5+C,I=1+C;M=k=T=A=null,S=h(t,g,n-C,n+P,0,o,x.min[0],x.max[0]),E=h(t,g,n+L,n+I,0,o,x.min[0],x.max[0]),S&&(M=h(S,g,r-C,r+P,1,a,x.min[1],x.max[1]),k=h(S,g,r+L,r+I,1,a,x.min[1],x.max[1])),E&&(T=h(E,g,r-C,r+P,1,a,x.min[1],x.max[1]),A=h(E,g,r+L,r+I,1,a,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(f.push(M||[],e+1,2*n,2*r),f.push(k||[],e+1,2*n,2*r+1),f.push(T||[],e+1,2*n+1,2*r),f.push(A||[],e+1,2*n+1,2*r+1))}else s&&(v=e)}return v},r.prototype.getTile=function(t,e,n){var r=this.options,o=r.extent,a=r.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var h,f=t,d=e,p=n;!h&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),h=this.tiles[i(f,d,p)];if(!h||!h.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",f,d,p),l(h,o,r.buffer))return c.tile(h,o);a>1&&console.time("drilling down");var m=this.splitTile(h.source,f,d,p,t,e,n);if(a>1&&console.timeEnd("drilling down"),null!==m){var v=1<1?(r=o,i=a):h>0&&(r+=u*h,i+=c*h)}return u=s-r,c=l-i,u*u+c*c}e.exports=function(t,e){var n,i,o,a,s=e*e,l=0,u=t.length-1,c=[];for(t[l][2]=1,t[u][2]=1;u;){for(i=0,n=l+1;ni&&(a=n,i=o);i>s?(t[a][2]=i,c.push(l),c.push(a),l=a):(u=c.pop(),l=c.pop())}}},{}],143:[function(t,e,n){"use strict";function r(t,e,n,r){var o,a,s,l,u=e.geometry,c=e.type,h=[],f=n*n;if(1===c)for(o=0;of)&&(d.push(l),t.numSimplified++),t.numPoints++;3===c&&i(d,s.outer),h.push(d)}else t.numPoints+=s.length;if(h.length){var p={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function i(t,e){o(t)<0===e&&t.reverse()}function o(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;is.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}},{}],144:[function(t,e,n){"use strict";function r(t,e,n,r,i){return[Math.round(e*(t[0]*n-r)),Math.round(e*(t[1]*n-i))]}n.tile=function(t,e){if(t.transformed)return t;var n,i,o,a=t.z2,s=t.x,l=t.y;for(n=0;n0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}e.exports=function(t,e){var n=new i(t);return n.update(e),n};var s=t(152),l=t(150),u=t(148),c=t(149),h=t(153),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,n,r){if(r in t){var i,o=t[r],a=this[r];(e?Array.isArray(o)&&Array.isArray(o[0]):Array.isArray(o))?this[r]=i=[n(o[0]),n(o[1]),n(o[2])]:this[r]=i=[n(o),n(o),n(o)];for(var s=0;s<3;++s)if(i[s]!==a[s])return!0}return!1}t=t||{};var n,r=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),o=e.bind(this,!1,String),a=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),u=!1,c=!1;if("bounds"in t)for(var f=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)f[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=f[d][p];if("ticks"in t){n=t.ticks,u=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else r("tickSpacing")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),c=!0,u=!0,this._firstInit=!1),c&&this.autoTicks&&(n=h.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)n[d].sort(function(t,e){return t.x-e.x});h.equal(n,this.ticks)?u=!1:this.ticks=n}i("tickEnable"),o("tickFont")&&(u=!0),r("tickSize"),r("tickAngle"),r("tickPad"),a("tickColor");var m=o("labels");o("labelFont")&&(m=!0),i("labelEnable"),r("labelSize"),r("labelPad"),a("labelColor"),i("lineEnable"),i("lineMirror"),r("lineWidth"),a("lineColor"),i("lineTickEnable"),i("lineTickMirror"),r("lineTickLength"),r("lineTickWidth"),a("lineTickColor"),i("gridEnable"),r("gridWidth"),a("gridColor"),i("zeroEnable"),a("zeroLineColor"),r("zeroLineWidth"),i("backgroundEnable"),a("backgroundColor"),this._text?this._text&&(m||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new o,new o,new o],m=[0,0,0],v={model:f,view:f,projection:f};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var g=[0,0,0],y=[0,0,0],x=[0,0,0];d.draw=function(t){t=t||v;for(var e=this.gl,n=t.model||f,i=t.view||f,o=t.projection||f,s=this.bounds,l=c(n,i,o,s),u=l.cubeEdges,h=l.axis,d=i[12],b=i[13],_=i[14],w=i[15],M=this.pixelRatio*(o[3]*d+o[7]*b+o[11]*_+o[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=h[k];for(var T=p,k=0;k<3;++k)a(p[k],k,this.bounds,u,h);for(var e=this.gl,A=m,k=0;k<3;++k)this.backgroundEnable[k]?A[k]=h[k]:A[k]=0;this._background.draw(n,i,o,s,A,this.backgroundColor),this._lines.bind(n,i,o,this);for(k=0;k<3;++k){var S=[0,0,0];h[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(O=0;O<2;++O){var E=(k+1+O)%3,C=(k+1+(1^O))%3;this.gridEnable[E]&&this._lines.drawGrid(E,C,this.bounds,S,this.gridColor[E],this.gridWidth[E]*this.pixelRatio)}for(O=0;O<2;++O){var E=(k+1+O)%3,C=(k+1+(1^O))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(E,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,T[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,T[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);for(var L=r(g,T[k].primalMinor),P=r(y,T[k].mirrorMinor),I=this.lineTickLength,O=0;O<3;++O){var D=M/n[5*O];L[O]*=I[O]*D,P[O]*=I[O]*D}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,T[k].primalOffset,L,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,T[k].mirrorOffset,P,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(n,i,o,this.pixelRatio);for(k=0;k<3;++k){for(var z=T[k].primalMinor,j=r(x,T[k].primalOffset),O=0;O<3;++O)this.lineTickEnable[k]&&(j[O]+=M*z[O]*Math.max(this.lineTickLength[O],0)/n[5*O]);if(this.tickEnable[k]){for(O=0;O<3;++O)j[O]+=M*z[O]*this.tickPad[O]/n[5*O];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],j,this.tickColor[k])}if(this.labelEnable[k]){for(O=0;O<3;++O)j[O]+=M*z[O]*this.labelPad[O]/n[5*O];j[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],j,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{148:148,149:149,150:150,152:152,153:153}],148:[function(t,e,n){"use strict";function r(t,e,n,r){this.gl=t,this.buffer=e,this.vao=n,this.shader=r}e.exports=function(t){for(var e=[],n=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){n.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[u]=p;for(var m=-1;m<=1;m+=2)h[c]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var v=u;u=c,c=v}var g=i(t,new Float32Array(e)),y=i(t,new Uint16Array(n),t.ELEMENT_ARRAY_BUFFER),x=o(t,[{buffer:g,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new r(t,g,x,b)};var i=t(155),o=t(261),a=t(151).bg,s=r.prototype;s.draw=function(t,e,n,r,i,o){for(var a=!1,s=0;s<3;++s)a=a||i[s];if(a){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:n,bounds:r,enable:i,colors:o},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{151:151,155:155,261:261}],149:[function(t,e,n){"use strict";function r(t,e,n){for(var r=0;r<4;++r){t[r]=n[12+r];for(var i=0;i<3;++i)t[r]+=e[i]*n[4*i+r]}}function i(t){for(o=0;oA&&(_|=1<A&&(_|=1<h[y][1]&&(D=y));for(var z=-1,y=0;y<3;++y)(N=D^1<h[j][0]&&(j=N))}var R=m;R[0]=R[1]=R[2]=0,R[o.log2(z^D)]=D&z,R[o.log2(D^j)]=D&j;var F=7^j;F===_||F===O?(F=7^z,R[o.log2(j^F)]=F&j):R[o.log2(z^F)]=F&z;for(var B=v,U=_,V=0;V<3;++V)B[V]=U&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}","precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{245:245}],152:[function(t,e,n){(function(n){"use strict";function r(t,e,n,r){this.gl=t,this.shader=e,this.buffer=n,this.vao=r,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return s(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}e.exports=function(t,e,n,i,s,u){var c=o(t),h=a(t,[{buffer:c,size:3}]),f=l(t);f.attributes.position.location=0;var d=new r(t,f,c,h);return d.update(e,n,i,s,u),d};var o=t(155),a=t(261),s=t(1286),l=t(151).text,u=window||n.global||{},c=u.__TEXT_CACHE||{};u.__TEXT_CACHE={};var h=r.prototype,f=[0,0];h.bind=function(t,e,n,r){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=n,i.pixelScale=r,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},h.update=function(t,e,n,r,o){function a(t,e,n,r){var o=c[n];o||(o=c[n]={});var a=o[e];a||(a=o[e]=i(e,{triangles:!0,font:n,textAlign:"center",textBaseline:"middle"}));for(var l=(r||12)/12,u=a.positions,h=a.cells,f=0,d=h.length;f=0;--m){var v=u[p[m]];s.push(l*v[0],-l*v[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],d=0;d<3;++d){h[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],n),f[d]=(s.length/3|0)-h[d],l[d]=s.length/3|0;for(var p=0;p=0&&(i=n.length-r-1);var o=Math.pow(10,i),a=Math.round(t*e*o),s=a+"";if(s.indexOf("e")>=0)return s;var l=a/o,u=a%o;a<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(a<0&&(c="-"+c),i){for(var h=""+u;h.length=t[0][i];--a)o.push({x:a*e[i],text:r(e[i],a)});n.push(o)}return n},n.equal=function(t,e){for(var n=0;n<3;++n){if(t[n].length!==e[n].length)return!1;for(var r=0;rn)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,o,i),n}function o(t,e){for(var n=s.malloc(t.length,e),r=t.length,i=0;i=0;--r){if(e[r]!==n)return!1;n*=t[r]}return!0}var s=t(1273),l=t(461),u=t(467),c=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],h=r.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)},h.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var n=t.dtype;if(c.indexOf(n)<0&&(n="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(n=gl.getExtension("OES_element_index_uint")&&"uint16"!==n?"uint32":"uint16"),n===t.dtype&&a(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var r=s.malloc(t.size,n),h=u(r,t.shape);l.assign(h,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,r,e):i(this.gl,this.type,this.length,this.usage,r.subarray(0,t.size),e),s.free(r)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?o(t,"uint16"):o(t,"float32"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,f,e):i(this.gl,this.type,this.length,this.usage,f.subarray(0,t.length),e),s.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,n,i){if(n=n||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,n!==t.ARRAY_BUFFER&&n!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var o=new r(t,n,t.createBuffer(),0,i);return o.update(e),o}},{1273:1273,461:461,467:467}],156:[function(t,e,n){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],157:[function(t,e,n){var r=t(156);e.exports=function(t){return r[t]}},{156:156}],158:[function(t,e,n){"use strict";function r(t,e,n,r){this.plot=t,this.shader=e,this.bufferHi=n,this.bufferLo=r,this.bounds=[1/0,1/0,-1/0,-1/0],this.numPoints=0,this.color=[0,0,0,1]}var i=t(245),o=t(155),a=t(1273),s=t(159);e.exports=function(t,e){var n=new r(t,i(t.gl,s.vertex,s.fragment),o(t.gl),o(t.gl));return n.update(e),t.addObject(n),n};var l=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],u=r.prototype;u.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),n=new Float32Array([0,0]),r=new Float32Array([0,0]),i=[1,1];return function(){var o=this.plot,a=this.shader,s=this.bounds,u=this.numPoints;if(u){var c=o.gl,h=o.dataBox,f=o.viewBox,d=o.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],v=h[2]-h[0],g=h[3]-h[1],y=2*p/v,x=2*m/g,b=(s[0]-h[0]-.5*v)/p,_=(s[1]-h[1]-.5*g)/m;t[0]=y,t[1]=x,e[0]=y-t[0],e[1]=x-t[1],n[0]=b,n[1]=_,r[0]=b-n[0],r[1]=_-n[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,a.bind(),a.uniforms.scaleHi=t,a.uniforms.scaleLo=e,a.uniforms.translateHi=n,a.uniforms.translateLo=r,a.uniforms.pixelScale=i,a.uniforms.color=this.color,this.bufferLo.bind(),a.attributes.positionLo.pointer(c.FLOAT,!1,16,0),this.bufferHi.bind(),a.attributes.positionHi.pointer(c.FLOAT,!1,16,0),a.attributes.pixelOffset.pointer(c.FLOAT,!1,16,8),c.drawArrays(c.TRIANGLES,0,u*l.length)}}}(),u.drawPick=function(t){return t},u.pick=function(){return null},u.update=function(t){var e,n,r,i=(t=t||{}).positions||[],o=t.errors||[],s=1;"lineWidth"in t&&(s=+t.lineWidth);var u=5;"capSize"in t&&(u=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var c=this.bounds=[1/0,1/0,-1/0,-1/0],h=this.numPoints=i.length>>1;for(e=0;e0&&(A*=_),S<0?S*=w:S>0&&(S*=M),v[x++]=f*(n-p+A),v[x++]=d*(r-m+S),v[x++]=s*T[2]+(u+s)*T[4],v[x++]=s*T[3]+(u+s)*T[5]}}for(e=0;e=1},c.isTransparent=function(){return this.opacity<1},c.drawTransparent=c.draw=function(t){var e=this.gl,n=this.shader.uniforms;this.shader.bind();var r=n.view=t.view||u,i=n.projection=t.projection||u;n.model=t.model||u,n.clipBounds=this.clipBounds,n.opacity=this.opacity;var o=r[12],a=r[13],s=r[14],l=r[15],c=this.pixelRatio*(i[3]*o+i[7]*a+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),n.capSize=this.capSize[h]*c,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var h=function(){for(var t=new Array(3),e=0;e<3;++e){for(var n=[],r=1;r<=2;++r)for(var i=-1;i<=1;i+=2){var o=[0,0,0];o[(r+e)%3]=i,n.push(o)}t[e]=n}return t}();c.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],n=t.position,r=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),n&&r){var a=[],s=n.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c0)){var m=h.slice();m[u]+=d[1][u],a.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+o(a,m,p,u)}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(a)}},c.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{155:155,162:162,261:261}],161:[function(t,e,n){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),n=[],r=0;r1&&f.drawBuffersWEBGL(g[h]);var v=n.getExtension("WEBGL_depth_texture");v?d?t.depth=s(n,u,c,v.UNSIGNED_INT_24_8_WEBGL,n.DEPTH_STENCIL,n.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(n,u,c,n.UNSIGNED_SHORT,n.DEPTH_COMPONENT,n.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(n,u,c,n.DEPTH_STENCIL,n.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(n,u,c,n.DEPTH_COMPONENT16,n.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(n,u,c,n.STENCIL_INDEX,n.STENCIL_ATTACHMENT));var y=n.checkFramebufferStatus(n.FRAMEBUFFER);if(y!==n.FRAMEBUFFER_COMPLETE){t._destroyed=!0,n.bindFramebuffer(n.FRAMEBUFFER,null),n.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(n.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var x=0;xs||n<0||n>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=n;for(var l=r(o),u=0;ua||n<0||n>a)throw new Error("gl-fbo: Parameters are too large for FBO");var s=1;if("color"in(r=r||{})){if((s=Math.max(0|r.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(r.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else r.preferFloat&&s>0&&u&&(l=t.FLOAT);var h=!0;"depth"in r&&(h=!!r.depth);var f=!1;return"stencil"in r&&(f=!!r.stencil),new c(t,e,n,l,s,h,f,i)};var d,p,m,v,g=null,y=c.prototype;Object.defineProperties(y,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],n=0|t[1];return h(this,e,n),[e,n]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,h(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t},enumerable:!1}}),y.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},y.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=n,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,a),n+this.shape[0]*this.shape[1]}}}(),c.pick=function(t,e,n){var r=this.pickOffset,i=this.shape[0]*this.shape[1];if(n=r+i)return null;var o=n-r,a=this.xData,s=this.yData;return{object:this,pointId:o,dataCoord:[a[o%this.shape[0]],s[o/this.shape[0]|0]]}},c.update=function(t){var e=(t=t||{}).shape||[0,0],n=t.x||o(e[0]),r=t.y||o(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=n,this.yData=r;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,f=this.bounds,d=f[0]=n[0],p=f[1]=r[0],m=1/((f[2]=n[n.length-1])-d),v=1/((f[3]=r[r.length-1])-p),g=e[0],y=e[1];this.shape=[g,y];var x=(g-1)*(y-1)*(h.length>>>1);this.numVertices=x;for(var b=a.mallocUint8(4*x),_=a.mallocFloat32(2*x),w=a.mallocUint8(2*x),M=a.mallocUint32(x),k=0,T=0;T2&&!this.usingDashes){var x=this.mitreShader;this.lineBufferLo.bind(),x.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),x.bind();var b=x.uniforms;this.setProjectionUniforms(b,o),b.color=c,b.radius=s*u,x.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),h.drawPick=function(){var t=[0,0,0,0];return function(e){var n=this.vertCount,r=this.numPoints;if(this.pickOffset=e,!n)return e+r;var i=this.setProjectionModel(),o=this.plot,a=this.width,s=o.gl,l=o.pickPixelRatio,u=this.pickShader,c=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,u.bind();var h=u.uniforms;this.setProjectionUniforms(h,i),h.width=a*l,h.pickOffset=t;var f=u.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),c.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,n),e+r}}(),h.pick=function(t,e,n){var r=this.pickOffset,i=this.numPoints;if(n=r+i)return null;var o=n-r,a=this.data;return{object:this,pointId:o,dataCoord:[a[2*o],a[2*o+1]]}},h.update=function(t){t=t||{};var e,n,r,o,a,c=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=t.dashes||[1],f=0;for(e=0;e1,this.dashPattern=s(c,l(d,[f,1,4],[1,0,0])),this.dashPattern.minFilter=c.NEAREST,this.dashPattern.magFilter=c.NEAREST,this.dashLength=f,u.free(d);var m=t.positions;this.data=m;var v=this.bounds;v[0]=v[1]=1/0,v[2]=v[3]=-1/0;var g=this.numPoints=m.length>>>1;if(0!==g){for(e=0;e1;){var T=--r;o=m[2*r],a=m[2*r+1];var A=T-1,S=m[2*A],E=m[2*A+1];if(!(isNaN(o)||isNaN(a)||isNaN(S)||isNaN(E))){k+=1,o=(o-v[0])/(v[2]-v[0]),a=(a-v[1])/(v[3]-v[1]);var C=(S=(S-v[0])/(v[2]-v[0]))-o,L=(E=(E-v[1])/(v[3]-v[1]))-a,P=T|1<<24,I=T-1,O=T,D=T-1|1<<24;y[--w]=-L,y[--w]=-C,y[--w]=a,y[--w]=o,_[--M]=P,_[--M]=I,y[--w]=L,y[--w]=C,y[--w]=E,y[--w]=S,_[--M]=O,_[--M]=D,y[--w]=-L,y[--w]=-C,y[--w]=E,y[--w]=S,_[--M]=O,_[--M]=D,y[--w]=L,y[--w]=C,y[--w]=E,y[--w]=S,_[--M]=O,_[--M]=D,y[--w]=-L,y[--w]=-C,y[--w]=a,y[--w]=o,_[--M]=P,_[--M]=I,y[--w]=L,y[--w]=C,y[--w]=a,y[--w]=o,_[--M]=P,_[--M]=I}}for(e=0;e FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,o)}},{245:245}],171:[function(t,e,n){"use strict";function r(t,e){for(var n=0,r=0;r<3;++r){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],n=0;n<3;++n)e[0][n]=Math.max(t[0][n],e[0][n]),e[1][n]=Math.min(t[1][n],e[1][n]);return e}function o(t,e,n,r){this.arcLength=t,this.position=e,this.index=n,this.dataCoordinate=r}function a(t,e,n,r,i,o){this.gl=t,this.shader=e,this.pickShader=n,this.buffer=r,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=o,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,n=p(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;var r=m(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;for(var i=s(e),o=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),c=f(new Array(1024),[256,1,4]),h=0;h<1024;++h)c.data[h]=255;var d=u(e,c);d.wrap=e.REPEAT;var v=new a(e,n,r,i,o,d);return v.update(t),v};var s=t(155),l=t(261),u=t(257),c=t(268),h=t(39),f=t(467),d=t(170),p=d.createShader,m=d.createPickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],g=a.prototype;g.isTransparent=function(){return this.opacity<1},g.isOpaque=function(){return this.opacity>=1},g.pickSlots=1,g.setPickBase=function(t){this.pickId=t},g.drawTransparent=g.draw=function(t){var e=this.gl,n=this.shader,r=this.vao;n.bind(),n.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},r.bind(),r.draw(e.TRIANGLE_STRIP,this.vertexCount)},g.drawPick=function(t){var e=this.gl,n=this.pickShader,r=this.vao;n.bind(),n.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},r.bind(),r.draw(e.TRIANGLE_STRIP,this.vertexCount)},g.update=function(t){var e,n;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var o=t.position||t.positions;if(o){var a=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],v=!1;t:for(e=1;e0){for(var x=0;x<24;++x)l.push(l[l.length-12]);p+=2,v=!0}continue t}m[0][n]=Math.min(m[0][n],g[n],y[n]),m[1][n]=Math.max(m[1][n],g[n],y[n])}var b,_;Array.isArray(a[0])?(b=a[e-1],_=a[e]):b=_=a,3===b.length&&(b=[b[0],b[1],b[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=r(g,y),v){for(n=0;n<2;++n)l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3]);p+=2,v=!1}l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3],g[0],g[1],g[2],y[0],y[1],y[2],M,-w,b[0],b[1],b[2],b[3],y[0],y[1],y[2],g[0],g[1],g[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],g[0],g[1],g[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(d),c.push(o[o.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=c,this.arcLength=u,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function d(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=r,e.clone=function(t){var e=new p.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},e.length=i,e.fromValues=o,e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},e.subtract=a,e.multiply=s,e.divide=l,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},e.distance=u,e.squaredDistance=c,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},e.normalize=f,e.dot=d,e.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=i*l-o*s,t[1]=o*a-r*l,t[2]=r*s-i*a,t},e.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t},e.hermite=function(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,l=a*(o-2)+o,u=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+n[0]*l+r[0]*u+i[0]*c,t[1]=e[1]*s+n[1]*l+r[1]*u+i[1]*c,t[2]=e[2]*s+n[2]*l+r[2]*u+i[2]*c,t},e.bezier=function(t,e,n,r,i,o){var a=1-o,s=a*a,l=o*o,u=s*a,c=3*o*s,h=3*l*a,f=l*o;return t[0]=e[0]*u+n[0]*c+r[0]*h+i[0]*f,t[1]=e[1]*u+n[1]*c+r[1]*h+i[1]*f,t[2]=e[2]*u+n[2]*c+r[2]*h+i[2]*f,t},e.random=function(t,e){e=e||1;var n=2*p.RANDOM()*Math.PI,r=2*p.RANDOM()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,f=u*o+a*i-s*r,d=-a*r-s*i-l*o;return t[0]=c*u+d*-a+h*-l-f*-s,t[1]=h*u+d*-s+f*-a-c*-l,t[2]=f*u+d*-l+c*-s-h*-a,t},e.rotateX=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.rotateY=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.rotateZ=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.angle=function(t,e){var n=o(t[0],t[1],t[2]),r=o(e[0],e[1],e[2]);f(n,n),f(r,r);var i=d(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=p.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=p.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=p.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))};var p=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));e.sub=a,e.mul=s,e.div=l,e.dist=u,e.sqrDist=c,e.len=i,e.sqrLen=h,e.forEach=function(){var t=r();return function(e,n,r,i,o,a){var s=void 0,l=void 0;for(n||(n=3),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a),t}Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=r,e.clone=function(t){var e=new d.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.fromValues=function(t,e,n,r){var i=new d.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=i,e.multiply=o,e.divide=a,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},e.scale=s,e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},e.distance=l,e.squaredDistance=u,e.length=c,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},e.normalize=f,e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t},e.random=function(t,e){return e=e||1,t[0]=d.RANDOM(),t[1]=d.RANDOM(),t[2]=d.RANDOM(),t[3]=d.RANDOM(),f(t,t),s(t,t,e),t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*i,h=u*i+l*r-a*o,f=u*o+a*i-s*r,d=-a*r-s*i-l*o;return t[0]=c*u+d*-a+h*-l-f*-s,t[1]=h*u+d*-s+f*-a-c*-l,t[2]=f*u+d*-l+c*-s-h*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(n-a)<=d.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=d.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=d.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-u)<=d.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))};var d=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));e.sub=i,e.mul=o,e.div=a,e.dist=l,e.sqrDist=u,e.len=c,e.sqrLen=h,e.forEach=function(){var t=r();return function(e,n,r,i,o,a){var s=void 0,l=void 0;for(n||(n=4),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},e.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],l=i+i,u=o+o,c=a+a,h=i*l,f=i*u,d=i*c,p=o*u,m=o*c,v=a*c,g=s*l,y=s*u,x=s*c,b=r[0],_=r[1],w=r[2];return t[0]=(1-(p+v))*b,t[1]=(f+x)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(f-x)*_,t[5]=(1-(h+v))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-g)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],l=e[3],u=o+o,c=a+a,h=s+s,f=o*u,d=o*c,p=o*h,m=a*c,v=a*h,g=s*h,y=l*u,x=l*c,b=l*h,_=r[0],w=r[1],M=r[2],k=i[0],T=i[1],A=i[2];return t[0]=(1-(m+g))*_,t[1]=(d+b)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(f+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(v-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=n[0]+k-(t[0]*k+t[4]*T+t[8]*A),t[13]=n[1]+T-(t[1]*k+t[5]*T+t[9]*A),t[14]=n[2]+A-(t[2]*k+t[6]*T+t[10]*A),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,l=i+i,u=n*a,c=r*a,h=r*s,f=i*a,d=i*s,p=i*l,m=o*a,v=o*s,g=o*l;return t[0]=1-h-p,t[1]=c+g,t[2]=f-v,t[3]=0,t[4]=c-g,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+v,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,r,i,o,a){var s=1/(n-e),l=1/(i-r),u=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(a+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*u,t[15]=0,t},e.perspective=function(t,e,n,r,i){var o=1/Math.tan(e/2),a=1/(r-i);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+r)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*r*a,t[15]=0,t},e.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),u=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(a-s)*l*.5,t[9]=(i-o)*u*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},e.ortho=function(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(a+o)*u,t[15]=1,t},e.lookAt=function(t,e,n,r){var i=void 0,a=void 0,s=void 0,l=void 0,u=void 0,c=void 0,h=void 0,f=void 0,d=void 0,p=void 0,m=e[0],v=e[1],g=e[2],y=r[0],x=r[1],b=r[2],_=n[0],w=n[1],M=n[2];return Math.abs(m-_)0&&(c*=d=1/Math.sqrt(d),h*=d,f*=d);var p=l*f-u*h,m=u*c-s*f,v=s*h-l*c;return t[0]=p,t[1]=m,t[2]=v,t[3]=0,t[4]=h*v-f*m,t[5]=f*p-c*v,t[6]=c*m-h*p,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=i,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],m=t[12],v=t[13],g=t[14],y=t[15],x=e[0],b=e[1],_=e[2],w=e[3],M=e[4],k=e[5],T=e[6],A=e[7],S=e[8],E=e[9],C=e[10],L=e[11],P=e[12],I=e[13],O=e[14],D=e[15];return Math.abs(n-x)<=o.EPSILON*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(r-b)<=o.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-_)<=o.EPSILON*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(a-w)<=o.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-M)<=o.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-k)<=o.EPSILON*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-T)<=o.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(c-A)<=o.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-S)<=o.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-E)<=o.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(d-C)<=o.EPSILON*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-L)<=o.EPSILON*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(m-P)<=o.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(v-I)<=o.EPSILON*Math.max(1,Math.abs(v),Math.abs(I))&&Math.abs(g-O)<=o.EPSILON*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(y-D)<=o.EPSILON*Math.max(1,Math.abs(y),Math.abs(D))};var o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));e.mul=r,e.sub=i},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(){var t=new u.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function o(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function a(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],u=n[2],c=n[3];return t[0]=r*c+a*s+i*u-o*l,t[1]=i*c+a*l+o*s-r*u,t[2]=o*c+a*u+r*l-i*s,t[3]=a*c-r*s-i*l-o*u,t}function s(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],l=n[0],u=n[1],c=n[2],h=n[3],f=void 0,d=void 0,p=void 0,m=void 0,v=void 0;return(d=i*l+o*u+a*c+s*h)<0&&(d=-d,l=-l,u=-u,c=-c,h=-h),1-d>1e-6?(f=Math.acos(d),p=Math.sin(f),m=Math.sin((1-r)*f)/p,v=Math.sin(r*f)/p):(m=1-r,v=r),t[0]=m*i+v*l,t[1]=m*o+v*u,t[2]=m*a+v*c,t[3]=m*s+v*h,t}function l(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}Object.defineProperty(e,"__esModule",{value:!0}),e.setAxes=e.sqlerp=e.rotationTo=e.equals=e.exactEquals=e.normalize=e.sqrLen=e.squaredLength=e.len=e.length=e.lerp=e.dot=e.scale=e.mul=e.add=e.set=e.copy=e.fromValues=e.clone=void 0,e.create=i,e.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},e.setAxisAngle=o,e.getAxisAngle=function(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return 0!=r?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=a,e.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l+a*s,t[1]=i*l+o*s,t[2]=o*l-i*s,t[3]=a*l-r*s,t},e.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l-o*s,t[1]=i*l+a*s,t[2]=o*l+r*s,t[3]=a*l-i*s,t},e.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l+i*s,t[1]=i*l-r*s,t[2]=o*l+a*s,t[3]=a*l-o*s,t},e.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},e.slerp=s,e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),l=Math.cos(n),u=Math.sin(r),c=Math.cos(r);return t[0]=o*l*c-a*s*u,t[1]=a*s*c+o*l*u,t[2]=a*l*u-o*s*c,t[3]=a*l*c+o*s*u,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var u=r(n(0)),c=r(n(1)),h=r(n(2)),f=r(n(3)),d=(e.clone=f.clone,e.fromValues=f.fromValues,e.copy=f.copy,e.set=f.set,e.add=f.add,e.mul=a,e.scale=f.scale,e.dot=f.dot,e.lerp=f.lerp,e.length=f.length),p=(e.len=d,e.squaredLength=f.squaredLength),m=(e.sqrLen=p,e.normalize=f.normalize);e.exactEquals=f.exactEquals,e.equals=f.equals,e.rotationTo=function(){var t=h.create(),e=h.fromValues(1,0,0),n=h.fromValues(0,1,0);return function(r,i,a){var s=h.dot(i,a);return s<-.999999?(h.cross(t,e,i),h.len(t)<1e-6&&h.cross(t,n,i),h.normalize(t,t),o(r,t,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(h.cross(t,i,a),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+s,m(r,r))}}(),e.sqlerp=function(){var t=i(),e=i();return function(n,r,i,o,a,l){return s(t,r,a,l),s(e,i,o,l),s(n,t,e,2*l*(1-l)),n}}(),e.setAxes=function(){var t=c.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],m(e,l(e,t))}}()},function(t,e,n){"use strict";function r(){var t=new h.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t}function i(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function o(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function a(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function s(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function l(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function u(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function c(t){var e=t[0],n=t[1];return e*e+n*n}Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=r,e.clone=function(t){var e=new h.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new h.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=i,e.multiply=o,e.divide=a,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=s,e.squaredDistance=l,e.length=u,e.squaredLength=c,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},e.random=function(t,e){e=e||1;var n=2*h.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=h.EPSILON*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=h.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))};var h=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));e.len=u,e.sub=i,e.mul=o,e.div=a,e.dist=s,e.sqrDist=l,e.sqrLen=c,e.forEach=function(){var t=r();return function(e,n,r,i,o,a){var s=void 0,l=void 0;for(n||(n=2),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s1.0001)return null;v+=m[c]}return Math.abs(v-1)>.001?null:[h,a(t,m),m]}},{1053:1053,21:21}],194:[function(t,e,n){var r="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}";n.meshShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},n.wireShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},n.pointShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},n.pickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",fragment:r,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},n.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",fragment:r,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},n.contourShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],195:[function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s,l,u,c,h,f,d,p,m,v,g,y,x,b,_,w,M,k,T,A){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=n,this.lineShader=r,this.pointShader=i,this.pickShader=o,this.pointPickShader=a,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=g,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=b,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=I,this._view=I,this._projection=I,this._resolution=[1,1]}function i(t){for(var e=_({colormap:t,nshades:256,format:"rgba"}),n=new Uint8Array(1024),r=0;r<256;++r){for(var i=e[r],o=0;o<3;++o)n[4*r+o]=i[o];n[4*r+3]=255*i[3]}return b(n,[256,256,4],[4,0,1])}function o(t,e,n){for(var r=new Array(e),i=0;i=1},O.isTransparent=function(){return this.opacity<1},O.pickSlots=1,O.setPickBase=function(t){this.pickId=t},O.highlight=function(t){if(t&&this.contourEnable){for(var e=w(this.cells,this.intensity,t.intensity),n=e.cells,r=e.vertexIds,i=e.vertexWeights,o=n.length,a=M.mallocFloat32(6*o),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var f=this.contourShader;f.bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},O.drawPick=function(t){t=t||{};for(var e=this.gl,n=t.model||I,r=t.view||I,i=t.projection||I,o=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],a=0;a<3;++a)o[0][a]=Math.max(o[0][a],this.clipBounds[0][a]),o[1][a]=Math.min(o[1][a],this.clipBounds[1][a]);this._model=[].slice.call(n),this._view=[].slice.call(r),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:n,view:r,projection:i,clipBounds:o,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},O.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],n=this.cells[e],r=this.positions,i=new Array(n.length),o=0;ol[k]&&(o.uniforms.dataAxis=t,o.uniforms.screenOffset=e,o.uniforms.color=v[r],o.uniforms.angle=g[r],u.drawArrays(u.TRIANGLES,l[k],l[T]-l[k]))),y[r]&&M&&(e[1^r]-=A*d*x[r],o.uniforms.dataAxis=n,o.uniforms.screenOffset=e,o.uniforms.color=b[r],o.uniforms.angle=_[r],u.drawArrays(u.TRIANGLES,w,M)),e[1^r]=A*c[2+(1^r)]-1,p[r+2]&&(e[1^r]+=A*d*m[r+2],kl[k]&&(o.uniforms.dataAxis=t,o.uniforms.screenOffset=e,o.uniforms.color=v[r+2],o.uniforms.angle=g[r+2],u.drawArrays(u.TRIANGLES,l[k],l[T]-l[k]))),y[r+2]&&M&&(e[1^r]+=A*d*x[r+2],o.uniforms.dataAxis=n,o.uniforms.screenOffset=e,o.uniforms.color=b[r+2],o.uniforms.angle=_[r+2],u.drawArrays(u.TRIANGLES,w,M))}}(),u.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var n=this.plot,r=this.shader,i=n.gl,o=n.screenBox,a=n.titleCenter,s=n.titleAngle,l=n.titleColor,u=n.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(a[c]*u-o[c])/(o[2+c]-o[c])-1;r.bind(),r.uniforms.dataAxis=t,r.uniforms.screenOffset=e,r.uniforms.angle=s,r.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),u.bind=function(){var t=[0,0],e=[0,0],n=[0,0];return function(){var r=this.plot,i=this.shader,o=r._tickBounds,a=r.dataBox,s=r.screenBox,l=r.viewBox;i.bind();for(var u=0;u<2;++u){var c=o[u],h=o[u+2]-c,f=.5*(a[u+2]+a[u]),d=a[u+2]-a[u],p=l[u],m=l[u+2]-p,v=s[u],g=s[u+2]-v;e[u]=2*h/d*m/g,t[u]=2*(c-f)/d*m/g}n[1]=2*r.pixelRatio/(s[3]-s[1]),n[0]=n[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=n,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),u.update=function(t){var e,n,r,i,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],h=[-1/0],f=l[o];for(e=0;en)for(t=n;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),T=new Array(k),A=0;A=0;)S+=1;w[x]=S}var E=new Array(n.length);h(),d._relink=h,d.types={uniforms:s(n),attributes:s(r)},d.attributes=a(p,d,b,w),Object.defineProperty(d,"uniforms",o(p,d,n,E))},e.exports=function(t,e,n,i,o){var a=new r(t);return a.update(e,n,i,o),a}},{203:203,204:204,205:205,206:206,207:207,208:208}],203:[function(t,e,n){function r(t,e,n){this.shortMessage=e||"",this.longMessage=n||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(n?"\n"+n:""),this.stack=(new Error).stack}(r.prototype=new Error).name="GLError",r.prototype.constructor=r,e.exports=r},{}],204:[function(t,e,n){"use strict";function r(t,e,n,r,i,o){this._gl=t,this._wrapper=e,this._index=n,this._locations=r,this._dimension=i,this._constFunc=o}function i(t,e,n,i,o,a,s){for(var l=["gl","v"],u=[],c=0;c=0){if((p=f.charCodeAt(f.length-1)-48)<2||p>4)throw new a("","Invalid data type for attribute "+h+": "+f);i(t,e,d[0],r,p,s,h)}else{if(!(f.indexOf("mat")>=0))throw new a("","Unknown data type for attribute "+h+": "+f);var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new a("","Invalid data type for attribute "+h+": "+f);o(t,e,d,r,p,s,h)}}}return s};var a=t(203),s=r.prototype;s.pointer=function(t,e,n,r){var i=this,o=i._gl,a=i._locations[i._index];o.vertexAttribPointer(a,i._dimension,t||o.FLOAT,!!e,n||0,r||0),o.enableVertexAttribArray(a)},s.set=function(t,e,n,r){return this._constFunc(this._locations[this._index],t,e,n,r)},Object.defineProperty(s,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{203:203}],205:[function(t,e,n){"use strict";function r(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var n=new Array(t),r=0;r4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+n);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new a("","Unknown uniform data type for "+name+": "+n)}if((i=n.charCodeAt(n.length-1)-48)<2||i>4)throw new a("","Invalid data type");switch(n.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new a("","Unrecognized data type for vector "+name+": "+n)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var n=[];for(var r in e){var i=e[r],o=t;parseInt(r)+""===r?o+="["+r+"]":o+="."+r,"object"==typeof i?n.push.apply(n,c(o,i)):n.push([o,i])}return n}function h(e){for(var r=["return function updateProperty(obj){"],i=c("",e),o=0;o4)throw new a("","Invalid data type");return"b"===t.charAt(0)?i(n,!1):i(n,0)}if(0===t.indexOf("mat")&&4===t.length){var n=t.charCodeAt(t.length-1)-48;if(n<2||n>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return i(n*n,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:r(o),set:h(i),enumerable:!0,configurable:!1})}else s[i]?Object.defineProperty(t,e,{get:l(i),set:h(i),enumerable:!0,configurable:!1}):t[e]=f(n[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var n=0;n1){s[0]in o||(o[s[0]]=[]),o=o[s[0]];for(var l=1;l1)for(var l=0;l=0){var p=e[x]-r[x]*(e[x+2]-e[x])/(r[x+2]-r[x]);0===x?a.drawLine(p,e[1],p,e[3],d[x],f[x]):a.drawLine(e[0],p,e[2],p,d[x],f[x])}}for(x=0;x=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},h.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},h.removeObject=function(t){for(var e=this.objects,n=0;n0){var n=Math.round(Math.pow(10,e));return Math.ceil(t/n)*n}return Math.ceil(t)}function a(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!w&&q.autoResize){var t=M.parentNode,e=1,n=1;t&&t!==document.body?(e=t.clientWidth,n=t.clientHeight):(e=window.innerWidth,n=window.innerHeight);var r=0|Math.ceil(e*q.pixelRatio),i=0|Math.ceil(n*q.pixelRatio);if(r!==M.width||i!==M.height){M.width=r,M.height=i;var o=M.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=e+"px",o.height=n+"px",R=!0}}}function n(){for(var t=D.length,e=N.length,n=0;n0&&0===j[e-1];)j.pop(),N.pop().dispose()}function y(){if(q.contextLost)return!0;k.isContextLost()&&(q.contextLost=!0,q.mouseListener.enabled=!1,q.selection.object=null,q.oncontextloss&&q.oncontextloss())}function x(){if(!y()){k.colorMask(!0,!0,!0,!0),k.depthMask(!0),k.disable(k.BLEND),k.enable(k.DEPTH_TEST);for(var t=D.length,e=N.length,n=0;nA.distance)continue;for(var u=0;u>>1;for(n=0;n=e[0]&&o<=e[2]&&a>=e[1]&&a<=e[3]&&r++}return r}var o=t(213),a=t(155),s=t(1273),l=t(212);e.exports=function(t,e){var n=t.gl,i=new r(t,a(n),a(n),o(n,l.pointVertex,l.pointFragment),o(n,l.pickVertex,l.pickFragment));return i.update(e),t.addObject(i),i};var u=r.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){function e(e,n){return e in t?t[e]:n}var n;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var r=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=r,a=t.positions,l=i?a:s.mallocFloat32(a.length),u=o?t.idToIndex:s.mallocInt32(r);if(i||l.set(a),!o)for(l.set(a),n=0;n>8&255,e[2]=n>>16&255,e[3]=n>>24&255,this.pickBuffer.bind(),o.attributes.pickId.pointer(a.UNSIGNED_BYTE),o.uniforms.pickOffset=e,this.pickOffset=n);var f=a.getParameter(a.BLEND),d=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),d&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),d&&a.enable(a.DITHER),n+this.pointCount}}(),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,n){var r=this.pickOffset,i=this.pointCount;if(n=r+i)return null;var o=n-r,a=this.points;return{object:this,pointId:o,dataCoord:[a[2*o],a[2*o+1]]}}},{1273:1273,155:155,212:212,213:213}],221:[function(t,e,n){e.exports=function(t,e,n,r){var i,o,a,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=n[0],p=n[1],m=n[2],v=n[3];return(o=u*d+c*p+h*m+f*v)<0&&(o=-o,d=-d,p=-p,m=-m,v=-v),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,l=Math.sin(r*i)/a):(s=1-r,l=r),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*v,t}},{}],222:[function(t,e,n){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],223:[function(t,e,n){arguments[4][57][0].apply(n,arguments)},{57:57}],224:[function(t,e,n){arguments[4][202][0].apply(n,arguments)},{202:202,225:225,226:226,227:227,228:228,229:229,230:230}],225:[function(t,e,n){arguments[4][203][0].apply(n,arguments)},{203:203}],226:[function(t,e,n){arguments[4][204][0].apply(n,arguments)},{204:204,225:225}],227:[function(t,e,n){arguments[4][205][0].apply(n,arguments)},{205:205,225:225,228:228}],228:[function(t,e,n){arguments[4][206][0].apply(n,arguments)},{206:206}],229:[function(t,e,n){arguments[4][207][0].apply(n,arguments)},{207:207}],230:[function(t,e,n){arguments[4][208][0].apply(n,arguments)},{1294:1294,164:164,208:208,225:225}],231:[function(t,e,n){"use strict";function r(t,e,n,r,i,o){for(var a=t+1;a<=e;++a){for(var s=n[a],l=r[2*a],u=r[2*a+1],c=i[a],h=o[a],f=a;f>t;){var d=n[f-1],p=r[2*(f-1)];if((d-s||l-p)>=0)break;n[f]=d,r[2*f]=p,r[2*f+1]=r[2*f-1],i[f]=i[f-1],o[f]=o[f-1],f-=1}n[f]=s,r[2*f]=l,r[2*f+1]=u,i[f]=c,o[f]=h}}function i(t,e,n,r,i,o){var a=n[t],s=r[2*t],l=r[2*t+1],u=i[t],c=o[t];n[t]=n[e],r[2*t]=r[2*e],r[2*t+1]=r[2*e+1],i[t]=i[e],o[t]=o[e],n[e]=a,r[2*e]=s,r[2*e+1]=l,i[e]=u,o[e]=c}function o(t,e,n,r,i,o){n[t]=n[e],r[2*t]=r[2*e],r[2*t+1]=r[2*e+1],i[t]=i[e],o[t]=o[e]}function a(t,e,n,r,i,o,a){var s=r[t],l=i[2*t],u=i[2*t+1],c=o[t],h=a[t];r[t]=r[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],o[t]=o[e],a[t]=a[e],r[e]=r[n],i[2*e]=i[2*n],i[2*e+1]=i[2*n+1],o[e]=o[n],a[e]=a[n],r[n]=s,i[2*n]=l,i[2*n+1]=u,o[n]=c,a[n]=h}function s(t,e,n,r,i,o,a,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=n,l[2*e]=r,l[2*e+1]=i,u[e]=o,c[e]=a}function l(t,e,n,r,i){return(n[t]-n[e]||r[2*e]-r[2*t]||i[t]-i[e])<0}function u(t,e,n,r,i,o,a,s){return(e-o[t]||a[2*t]-n||i-s[t])<0}function c(t,e,n,f,d,p){var m=(e-t+1)/6|0,v=t+m,g=e-m,y=t+e>>1,x=y-m,b=y+m,_=v,w=x,M=y,k=b,T=g,A=t+1,S=e-1,E=0;l(_,w,n,f,d,p)&&(E=_,_=w,w=E),l(k,T,n,f,d,p)&&(E=k,k=T,T=E),l(_,M,n,f,d,p)&&(E=_,_=M,M=E),l(w,M,n,f,d,p)&&(E=w,w=M,M=E),l(_,k,n,f,d,p)&&(E=_,_=k,k=E),l(M,k,n,f,d,p)&&(E=M,M=k,k=E),l(w,T,n,f,d,p)&&(E=w,w=T,T=E),l(w,M,n,f,d,p)&&(E=w,w=M,M=E),l(k,T,n,f,d,p)&&(E=k,k=T,T=E);var C=n[w],L=f[2*w],P=f[2*w+1],I=d[w],O=p[w],D=n[k],z=f[2*k],j=f[2*k+1],N=d[k],R=p[k],F=_,B=M,U=T,V=v,H=y,q=g,W=n[F],G=n[B],Y=n[U];n[V]=W,n[H]=G,n[q]=Y;for(var X=0;X<2;++X){var Z=f[2*F+X],K=f[2*B+X],J=f[2*U+X];f[2*V+X]=Z,f[2*H+X]=K,f[2*q+X]=J}var $=d[F],Q=d[B],tt=d[U];d[V]=$,d[H]=Q,d[q]=tt;var et=p[F],nt=p[B],rt=p[U];p[V]=et,p[H]=nt,p[q]=rt,o(x,t,n,f,d,p),o(b,e,n,f,d,p);for(var it=A;it<=S;++it)if(u(it,C,L,P,I,n,f,d))it!==A&&i(it,A,n,f,d,p),++A;else if(!u(it,D,z,j,N,n,f,d))for(;;){if(u(S,D,z,j,N,n,f,d)){u(S,C,L,P,I,n,f,d)?(a(it,A,S,n,f,d,p),++A,--S):(i(it,S,n,f,d,p),--S);break}if(--S=Math.max(.9*d,32)){var _=u+s>>>1;l(v,g,h,f,_,c+1),f=_}l(v,g,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(u<1)return[];e||(e=Array(u)),n||(n=Array(u)),s||(s=[]);for(var c=0;c=s[2]||s[1]>=s[3]){var h=a(t,2);h[0]===h[2]&&(h[2]+=1),h[1]===h[3]&&(h[3]+=1),s[0]=h[0],s[1]=h[1],s[2]=h[2],s[3]=h[3]}var f=s[0],d=s[1],p=s[2],m=s[3],v=1/(p-f),g=1/(m-d),y=Math.max(p-f,m-d),x=new Int32Array(u),b=0;l(f,d,y,0,u,0),o(x,t,e,n,u);for(var _=[],w=0,M=u,b=u-1;b>=0;--b){t[2*b]=(t[2*b]-f)*v,t[2*b+1]=(t[2*b+1]-d)*g;var k=x[b];k!==w&&(_.push(new i(y*Math.pow(.5,k),b+1,M-(b+1))),M=b+1,w=k)}return _.push(new i(y*Math.pow(.5,k+1),0,M)),_}},{17:17,231:231}],233:[function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){this.plot=t,this.shader=e,this.pickShader=n,this.positionBuffer=r,this.sizeBuffer=i,this.colorBuffer=o,this.idBuffer=a,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=p(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=p(this.plot.gl,[256,1])}function i(){var t=this.plot,e=t.viewBox,n=t.dataBox,r=t.pixelRatio,i=n[2]-n[0],l=n[3]-n[1],u=2/i,c=2/l,h=-n[0]-.5*i,f=-n[1]-.5*l;b[0]=u,_[0]=u-b[0],b[1]=c,_[1]=c-b[1],w[0]=h,M[0]=h-w[0],w[1]=f,M[1]=f-w[1];var d=e[2]-e[0],p=e[3]-e[1];o=Math.min(i/d,l/p),k[0]=2*r/d,k[1]=2*r/p,a=n[0],s=n[2]}e.exports=function(t,e){var n=t.gl,i=new r(t,l(n,h.vertex,h.fragment),l(n,h.pickVertex,h.pickFragment),u(n),u(n),u(n),u(n),u(n));return i.update(e),t.addObject(i),i};var o,a,s,l=t(224),u=t(155),c=t(1273),h=t(222),f=t(232),d=t(133),p=t(257),m=t(67),v=t(467),g=t(61),y=t(223),x=r.prototype,b=new Float32Array([0,0]),_=new Float32Array([0,0]),w=new Float32Array([0,0]),M=new Float32Array([0,0]),k=[0,0],T=[0,0,0,0];x.drawPick=function(t){var e=void 0!==t,n=this.plot,r=this.pointCount,l=r>this.snapThreshold;if(!r)return t;i.call(this);var u=n.gl,c=e?this.pickShader:this.shader,h=u.isEnabled(u.BLEND);if(c.bind(),e){this.pickOffset=t;for(var f=0;f<4;++f)T[f]=t>>8*f&255;c.uniforms.pickOffset=T,this.idBuffer.bind(),c.attributes.id.pointer(u.UNSIGNED_BYTE,!1)}else u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA),u.blendColor(0,0,0,1),h||u.enable(u.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(u.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(u.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(u.FLOAT,!1,8,0),e||c.attributes.border.pointer(u.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(u.FLOAT,!1,16,0),c.attributes.positionLo.pointer(u.FLOAT,!1,16,8),c.uniforms.pixelRatio=n.pixelRatio,c.uniforms.scaleHi=b,c.uniforms.scaleLo=_,c.uniforms.translateHi=w,c.uniforms.translateLo=M,c.uniforms.viewBox=n.viewBox;var d=this.scales;if(l)for(var p=d.length-1;p>=0;p--){var m=d[p];if(!(m.pixelSize&&m.pixelSize<1.25*o&&p>1)){var v=m.offset,g=m.count+v,x=y.ge(this.xCoords,a,v,g-1),k=y.lt(this.xCoords,s,x,g-1)+1;k>x&&u.drawArrays(u.POINTS,x,k-x)}}else u.drawArrays(u.POINTS,0,r);if(e)return t+r;h?u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA):u.disable(u.BLEND)},x.draw=x.drawPick,x.pick=function(t,e,n){var r=this.pickOffset,i=this.pointCount;if(n=r+i)return null;var o=n-r,a=this.points;return{object:this,pointId:o,dataCoord:[a[2*o],a[2*o+1]]}},x.update=function(t){var e=(t=t||{}).positions||[],n=t.colors||[],r=t.glyphs||[],i=t.sizes||[],o=t.borderWidths||[],a=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,u=(l=this.points.length/2)>this.snapThreshold;var h=c.mallocFloat32(2*l),p=c.mallocFloat64(2*l),y=c.mallocUint32(l),x=c.mallocFloat32(4*l);p.set(this.points),u&&(this.i2idx&&c.free(this.i2idx),this.i2idx=c.mallocInt32(l),this.scales=f(p,this.i2idx,h)),this.pointCount=l;for(L=0;Lz&&(z=i[L]);var j=this.charStep;this.charStep=g(Math.ceil(4*z),128,768);var N=Object.keys(D),R=this.charStep,F=Math.floor(R/2),B=s.getParameter(s.MAX_TEXTURE_SIZE),U=B/R*(B/R),V=Math.min(B,R*N.length),H=Math.min(B,R*Math.ceil(R*N.length/B)),q=Math.floor(V/R);N.length>U&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==N+""&&this.charStep==j||(this.charCanvas=d({canvas:this.charCanvas,family:"sans-serif",size:F,shape:[V,H],step:[R,R],chars:N,align:!0,fit:this.charFit}),this.chars=N);for(L=0;L>>1,r=l.mallocInt32(n),i=l.mallocFloat32(n),o=l.mallocFloat64(2*n);if(o.set(this.points),this.snapPoints)this.scales=s(o,r,i,this.bounds);else{this.bounds=h(o,2),c(o,2,this.bounds);for(d=0;d>8&255,g[2]=t>>16&255,g[3]=t>>24&255,r.uniforms.pickOffset=g,s.bind(),r.attributes.pickId.pointer(h.UNSIGNED_BYTE)):(r.uniforms.useWeight=1,this.weightBuffer.bind(),r.attributes.weight.pointer());var P=!0;if(this.snapPoints)for(var I=i.length-1;I>=0;I--){var O=i[I];if(!(O.pixelSize1)){var D=this.getVisibleRange(O),z=D[0],j=D[1];j>z&&h.drawArrays(h.POINTS,z,j-z),!e&&P&&(P=!1,r.uniforms.useWeight=0)}}else h.drawArrays(h.POINTS,0,this.pointCount);return t+this.pointCount},f.getVisibleRange=function(t){var e=this.plot.dataBox,n=this.bounds,r=this.pixelSize,i=this.size,o=this.plot.pixelRatio,s=n[2]-n[0];n[3],n[1];if(!t)for(var t,l=this.scales.length-1;l>=0&&((t=this.scales[l]).pixelSize1);l--);var u=this.xCoords,c=(e[0]-n[0]-r*i*o)/s,h=(e[2]-n[0]+r*i*o)/s,f=t.offset,d=t.count+f,p=a.ge(u,c,f,d-1);return[p,a.lt(u,h,p,d-1)+1]},f.drawPick=f.draw,f.pick=function(t,e,n){var r=n-this.pickOffset;return r<0||r>=this.pointCount?null:{object:this,pointId:r,dataCoord:[this.points[2*r],this.points[2*r+1]]}}},{1273:1273,155:155,17:17,18:18,234:234,235:235,237:237,245:245}],239:[function(t,e,n){"use strict";var r=t(1286);e.exports=function(t,e){var n=i[e];if(n||(n=i[e]={}),t in n)return n[t];for(var o=r(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),a=r(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(j[1])){var N=z;z=j,j=N,N=O,O=D,D=N;var R=P;P=I,I=R}z[0]<0&&(O[P]=-1),j[1]>0&&(D[I]=-1);for(var F=0,B=0,L=0;L<4;++L)F+=Math.pow(p[4*P+L],2),B+=Math.pow(p[4*I+L],2);O[P]/=Math.sqrt(F),D[I]/=Math.sqrt(B),d.axes[0]=O,d.axes[1]=D,d.fragClipBounds[0]=u(S,b[0],E,-1e8),d.fragClipBounds[1]=u(S,b[1],E,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,n,r,i,o){var a=n.gl;if(n.vao.bind(),i===n.opacity<1||o){t.bind();var s=t.uniforms;s.model=r.model||x,s.view=r.view||x,s.projection=r.projection||x,_[0]=2/a.drawingBufferWidth,_[1]=2/a.drawingBufferHeight,s.screenSize=_,s.highlightId=n.highlightId,s.highlightScale=n.highlightScale,s.fragClipBounds=C,s.clipBounds=n.axes.bounds,s.opacity=n.opacity,s.pickGroup=n.pickId/255,s.pixelRatio=n.pixelRatio,n.vao.draw(a.TRIANGLES,n.vertexCount),n.lineWidth>0&&(a.lineWidth(n.lineWidth),n.vao.draw(a.LINES,n.lineVertexCount,n.vertexCount))}h(e,n,r,i,o),n.vao.unbind()}var d=t(155),p=t(261),m=t(1273),v=t(182),g=t(240),y=t(239),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,n=g.createPerspective(e),r=g.createOrtho(e),i=g.createProject(e),o=g.createPickPerspective(e),s=g.createPickOrtho(e),l=g.createPickProject(e),u=d(e),c=d(e),h=d(e),f=d(e),m=new a(e,n,r,i,u,c,h,f,p(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return m.update(t),m};var b=a.prototype;b.pickSlots=1,b.setPickBase=function(t){this.pickId=t},b.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},b.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var _=[0,0],w=[0,0,0],M=[0,0,0],k=[0,0,0,1],T=[0,0,0,1],A=x.slice(),S=[0,0,0],E=[[0,0,0],[0,0,0]],C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];b.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},b.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},b.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},b.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var n=this.points[e],r=this._selectResult;r.index=e;for(var i=0;i<3;++i)r.position[i]=r.dataCoordinate[i]=n[i];return r},b.highlight=function(t){if(t){var e=t.index,n=255&e,r=e>>8&255,i=e>>16&255;this.highlightId=[n/255,r/255,i/255,0]}else this.highlightId=[1,1,1,1]},b.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{n=+t.projectScale;this.projectScale=[n,n,n]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var n=+t.projectOpacity;this.projectOpacity=[n,n,n]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var r=t.position;if(r){var i=t.font||"normal",o=t.alignment||[0,0],a=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,v=0,g=r.length;t:for(j=0;j0&&(C[0]=-o[0]*(1+M[0][0]));for(var H=_.cells,q=_.positions,b=0;b0){var g=n*c;a.drawBox(h-g,f-g,d+g,f+g,o),a.drawBox(h-g,p-g,d+g,p+g,o),a.drawBox(h-g,f-g,h+g,p+g,o),a.drawBox(d-g,f-g,d+g,p+g,o)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{155:155,242:242,245:245}],244:[function(t,e,n){"use strict";function r(t,e,n,r,i){this.coord=[t,e],this.id=n,this.value=r,this.distance=i}function i(t,e,n){this.gl=t,this.fbo=e,this.buffer=n,this._readTimeout=null;var r=this;this._readCallback=function(){r.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,r.buffer),r._readTimeout=null)}}e.exports=function(t,e){return new i(t,o(t,e),a.mallocUint8(e[0]*e[1]*4))};var o=t(163),a=t(1273),s=t(467),l=t(40).nextPow2,u=t(89)({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_16_arg0_<255||_inline_16_arg1_<255||_inline_16_arg2_<255||_inline_16_arg3_<255){var _inline_16_l=_inline_16_arg4_-_inline_16_arg6_[0],_inline_16_a=_inline_16_arg5_-_inline_16_arg6_[1],_inline_16_f=_inline_16_l*_inline_16_l+_inline_16_a*_inline_16_a;_inline_16_fthis.buffer.length){a.free(this.buffer);for(var r=this.buffer=a.mallocUint8(l(n*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),T=new Array(k),A=0;A=0;)S+=1;_[w]=S}var E=new Array(n.length);h(),d._relink=h,d.types={uniforms:s(n),attributes:s(r)},d.attributes=a(p,d,x,_),Object.defineProperty(d,"uniforms",o(p,d,n,E))},e.exports=function(t,e,n,i,o){var a=new r(t);return a.update(e,n,i,o),a}},{246:246,247:247,248:248,249:249,250:250,251:251}],246:[function(t,e,n){arguments[4][203][0].apply(n,arguments)},{203:203}],247:[function(t,e,n){arguments[4][204][0].apply(n,arguments)},{204:204,246:246}],248:[function(t,e,n){arguments[4][205][0].apply(n,arguments)},{205:205,246:246,249:249}],249:[function(t,e,n){arguments[4][206][0].apply(n,arguments)},{206:206}],250:[function(t,e,n){arguments[4][207][0].apply(n,arguments)},{207:207}],251:[function(t,e,n){arguments[4][208][0].apply(n,arguments)},{1294:1294,164:164,208:208,246:246}],252:[function(t,e,n){"use strict";function r(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var n=new r(t);return n.update(e),t.addOverlay(n),n};var i=r.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,n=this.color,r=this.center,i=this.plot,o=i.line,a=i.dataBox,s=i.viewBox;if(o.bind(),a[0]<=r[0]&&r[0]<=a[2]&&a[1]<=r[1]&&r[1]<=a[3]){var l=s[0]+(r[0]-a[0])/(a[2]-a[0])*(s[2]-s[0]),u=s[1]+(r[1]-a[1])/(a[3]-a[1])*(s[3]-s[1]);t[0]&&o.drawLine(l,u,s[0],u,e[0],n[0]),t[1]&&o.drawLine(l,u,l,s[1],e[1],n[1]),t[2]&&o.drawLine(l,u,s[2],u,e[2],n[2]),t[3]&&o.drawLine(l,u,l,s[3],e[3],n[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],253:[function(t,e,n){"use strict";var r=t(245);e.exports=function(t){return r(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{245:245}],254:[function(t,e,n){"use strict";function r(t,e,n,r){this.gl=t,this.buffer=e,this.vao=n,this.shader=r,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t(155),o=t(261),a=t(253);e.exports=function(t,e){function n(t,e,n,r,i,o){var a=[t,e,n,0,0,0,1];a[r+3]=1,a[r]=i,s.push.apply(s,a),a[6]=-1,s.push.apply(s,a),a[r]=o,s.push.apply(s,a),s.push.apply(s,a),a[6]=1,s.push.apply(s,a),a[r]=i,s.push.apply(s,a)}var s=[];n(0,0,0,0,0,1),n(0,0,0,1,0,1),n(0,0,0,2,0,1),n(1,0,0,1,-1,1),n(1,0,0,2,-1,1),n(0,1,0,0,-1,1),n(0,1,0,2,-1,1),n(0,0,1,0,-1,1),n(0,0,1,1,-1,1);var l=i(t,s),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=a(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new r(t,l,u,c);return h.update(e),h};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=r.prototype,u=[0,0,0],c=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,n=this.vao,r=this.shader;n.bind(),r.bind();var i,o=t.model||s,a=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var f=u,d=c,p=0;p<3;++p)i&&i[p]<0?(f[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(f[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,r.uniforms.model=o,r.uniforms.view=a,r.uniforms.projection=l,r.uniforms.coordinates=[this.position,f,d],r.uniforms.colors=this.colors,r.uniforms.screenShape=h;for(p=0;p<3;++p)r.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(n.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&n.draw(e.TRIANGLES,12,18+12*p));n.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{155:155,253:253,261:261}],255:[function(t,e,n){var r=t(245),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular_1_1(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";n.createShader=function(t){var e=r(t,i,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},n.createPickShader=function(t){var e=r(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},n.createContourShader=function(t){var e=r(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},n.createPickContourShader=function(t){var e=r(t,a,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{245:245}],256:[function(t,e,n){"use strict";function r(t,e,n,r,i){this.position=t,this.index=e,this.uv=n,this.level=r,this.dataCoordinate=i}function i(t){var e=x([g({colormap:t,nshades:z,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return y.divseq(e,255),e}function o(t,e,n,i,o,a,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=n,this.intensityBounds=[],this._shader=i,this._pickShader=o,this._coordinateBuffer=a,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new r([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[b(v.mallocFloat(1024),[0,0]),b(v.mallocFloat(1024),[0,0]),b(v.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function a(t,e){var n,r,i,o=e.axes&&e.axes.lastCubeProps.axis||N,a=e.showSurface,s=e.showContour;for(n=0;n<3;++n)for(a=a||e.surfaceProject[n],r=0;r<3;++r)s=s||e.contourProject[n][r];for(n=0;n<3;++n){var l=R.projections[n];for(r=0;r<16;++r)l[r]=0;for(r=0;r<4;++r)l[5*r]=1;l[5*n]=0,l[12+n]=e.axesBounds[+(o[n]>0)][n],w(l,t.model,l);var u=R.clipBounds[n];for(i=0;i<2;++i)for(r=0;r<3;++r)u[i][r]=t.clipBounds[i][r];u[0][n]=-1e8,u[1][n]=1e8}return R.showSurface=a,R.showContour=s,R}function s(t,e){t=t||{};var n=this.gl;n.disable(n.CULL_FACE),this._colorMap.bind(0);var r=F;r.model=t.model||I,r.view=t.view||I,r.projection=t.projection||I,r.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],r.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],r.contourColor=this.contourColor[0],r.inverseModel=M(r.inverseModel,r.model);for(var i=0;i<2;++i)for(var o=r.clipBounds[i],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);r.kambient=this.ambientLight,r.kdiffuse=this.diffuseLight,r.kspecular=this.specularLight,r.roughness=this.roughness,r.fresnel=this.fresnel,r.opacity=this.opacity,r.height=0,r.permutation=U,r.vertexColor=this.vertexColor;var l=B;for(w(l,r.view,r.model),w(l,r.projection,l),M(l,l),i=0;i<3;++i)r.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];r.lightPosition[i]=c/u}var h=a(r,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=r,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(n.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(n.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;r.kambient=1,r.kdiffuse=0,r.kspecular=0,r.opacity=1,f.bind(),f.uniforms=r;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=D[i],n.lineWidth(this.contourWidth[i]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},j.pickSlots=1,j.setPickBase=function(t){this.pickId=t};var N=[0,0,0],R={showSurface:!1,showContour:!1,projections:[I.slice(),I.slice(),I.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},F={model:I,view:I,projection:I,inverseModel:I.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},B=I.slice(),U=[1,0,0,0,1,0,0,0,1];j.draw=function(t){return s.call(this,t,!1)},j.drawTransparent=function(t){return s.call(this,t,!0)};var V={model:I,view:I,projection:I,inverseModel:I,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};j.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var n=V;n.model=t.model||I,n.view=t.view||I,n.projection=t.projection||I,n.shape=this._field[2].shape,n.pickId=this.pickId/255,n.lowerBound=this.bounds[0],n.upperBound=this.bounds[1],n.permutation=U;for(var r=0;r<2;++r)for(var i=n.clipBounds[r],o=0;o<3;++o)i[o]=Math.min(Math.max(this.clipBounds[r][o],-1e8),1e8);var s=a(n,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=n,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),r=0;r<3;++r)this.surfaceProject[r]&&(this._pickShader.uniforms.model=s.projections[r],this._pickShader.uniforms.clipBounds=s.clipBounds[r],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=n;var u=this._contourVAO;for(u.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=D[o],r=0;r>4)/16)/255,i=Math.floor(r),o=r-i,a=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(a),l=a-s;i+=1,s+=1;var u=n.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?o:1-o,f=0;f<2;++f)for(var d=i+c,p=s+f,m=h*(f?l:1-l),v=0;v<3;++v)u[v]+=this._field[v].get(d,p)*m;for(var g=this._pickResult.level,y=0;y<3;++y)if(g[y]=k.le(this.contourLevels[y],u[y]),g[y]<0)this.contourLevels[y].length>0&&(g[y]=0);else if(g[y]Math.abs(b-u[y])&&(g[y]+=1)}for(n.index[0]=o<.5?i:i+1,n.index[1]=l<.5?s:s+1,n.uv[0]=r/e[0],n.uv[1]=a/e[1],v=0;v<3;++v)n.dataCoordinate[v]=this._field[v].get(n.index[0],n.index[1]);return n},j.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=h(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=h(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,n=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var r=(e.shape[0]+2)*(e.shape[1]+2);r>this._field[2].data.length&&(v.freeFloat(this._field[2].data),this._field[2].data=v.mallocFloat(f.nextPow2(r))),this._field[2]=b(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var o=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(v.freeFloat(this._field[a].data),this._field[a].data=v.mallocFloat(this._field[2].size)),this._field[a]=b(this._field[a].data,[o[0]+2,o[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(a=0;a<2;++a){var c=s[a];for(y=0;y<2;++y)if(c.shape[y]!==o[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[a],c)}}else if(t.ticks){var d=t.ticks;if(!Array.isArray(d)||2!==d.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var p=d[a];if((Array.isArray(p)||p.length)&&(p=b(p)),p.shape[0]!==o[a])throw new Error("gl-surface: invalid tick length");var m=b(p.data,o);m.stride[a]=p.stride[0],m.stride[1^a]=0,l(this._field[a],m)}}else{for(a=0;a<2;++a){var g=[0,0];g[a]=1,this._field[a]=b(this._field[a].data,[o[0]+2,o[1]+2],g,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var bt=0;bt<5;++bt)tt.pop();H-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),H+=1}}rt.push(H)}this._contourOffsets[et]=nt,this._contourCounts[et]=rt}var _t=v.mallocFloat(tt.length);for(a=0;ai||n<0||n>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,n],t.bind(),r.texImage2D(r.TEXTURE_2D,0,t.format,e,n,0,t.format,t.type,null),t._mipLevels=[0],t}function a(t,e,n,r,i,o){this.gl=t,this.handle=e,this.format=i,this.type=o,this._shape=[n,r],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var a=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return a._wrapS},set:function(t){return a.wrapS=t}},{get:function(){return a._wrapT},set:function(t){return a.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return a._shape[0]},set:function(t){return a.width=t}},{get:function(){return a._shape[1]},set:function(t){return a.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,n,r,i,o,a,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var h=0,f=0,v=s(c,l.stride.slice());"float32"===u?h=t.FLOAT:"float64"===u?(h=t.FLOAT,v=!1,u="float32"):"uint8"===u?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,v=!1,u="uint8");if(2===c.length)f=t.LUMINANCE,c=[c[0],c[1],1],l=d(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])f=t.ALPHA;else if(2===c[2])f=t.LUMINANCE_ALPHA;else if(3===c[2])f=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");f=t.RGBA}c[2]}if(f!==t.LUMINANCE&&f!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(f=i),f!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var g=l.size,y=a.indexOf(r)<0;if(y&&a.push(r),h===o&&v)0===l.offset&&l.data.length===g?y?t.texImage2D(t.TEXTURE_2D,r,i,c[0],c[1],0,i,o,l.data):t.texSubImage2D(t.TEXTURE_2D,r,e,n,c[0],c[1],i,o,l.data):y?t.texImage2D(t.TEXTURE_2D,r,i,c[0],c[1],0,i,o,l.data.subarray(l.offset,l.offset+g)):t.texSubImage2D(t.TEXTURE_2D,r,e,n,c[0],c[1],i,o,l.data.subarray(l.offset,l.offset+g));else{var b;b=o===t.FLOAT?m.mallocFloat32(g):m.mallocUint8(g);var _=d(b,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&o===t.UNSIGNED_BYTE?x(_,l):p.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,r,i,c[0],c[1],0,i,o,b.subarray(0,g)):t.texSubImage2D(t.TEXTURE_2D,r,e,n,c[0],c[1],i,o,b.subarray(0,g)),o===t.FLOAT?m.freeFloat32(b):m.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,n,r,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||n<0||n>o)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,r,e,n,0,r,i,null),new a(t,s,e,n,r,i)}function h(t,e,n,r,i,o){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,s,n,r,i,o)}function f(t,e){var n=e.dtype,r=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(r[0]<0||r[0]>i||r[1]<0||r[1]>i)throw new Error("gl-texture2d: Invalid texture size");var o=s(r,e.stride.slice()),l=0;"float32"===n?l=t.FLOAT:"float64"===n?(l=t.FLOAT,o=!1,n="float32"):"uint8"===n?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,o=!1,n="uint8");var c=0;if(2===r.length)c=t.LUMINANCE,r=[r[0],r[1],1],e=d(e.data,r,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==r.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===r[2])c=t.ALPHA;else if(2===r[2])c=t.LUMINANCE_ALPHA;else if(3===r[2])c=t.RGB;else{if(4!==r[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,o=!1);var h,f,v=e.size;if(o)h=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var g=[r[2],r[2]*r[0],1];f=m.malloc(v,n);var y=d(f,r,g,0);"float32"!==n&&"float64"!==n||l!==t.UNSIGNED_BYTE?p.assign(y,e):x(y,e),h=f.subarray(0,v)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,r[0],r[1],0,c,l,h),o||m.free(f),new a(t,b,r[0],r[1],c,l)}var d=t(467),p=t(461),m=t(1273);e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(v||r(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],n=i(e)?e:e.raw;if(n)return h(t,n,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var v=null,g=null,y=null,x=function(t,e){p.muls(t,e,255)},b=a.prototype;Object.defineProperties(b,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),g.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),g.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var n=this.gl.getExtension("EXT_texture_filter_anisotropic");n&&this.gl.texParameterf(this.gl.TEXTURE_2D,n.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(y.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var n=this.gl;return this.bind(),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,this._wrapS),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return o(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,o(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,o(this,this._shape[0],t),t}}}),b.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},b.dispose=function(){this.gl.deleteTexture(this.handle)},b.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},b.setPixels=function(t,e,n,r){var o=this.gl;this.bind(),Array.isArray(e)?(r=n,n=0|e[1],e=0|e[0]):(e=e||0,n=n||0),r=r||0;var a=i(t)?t:t.raw;if(a)this._mipLevels.indexOf(r)<0?(o.texImage2D(o.TEXTURE_2D,0,this.format,this.format,this.type,a),this._mipLevels.push(r)):o.texSubImage2D(o.TEXTURE_2D,r,e,n,this.format,this.type,a);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>r||n+t.shape[0]>this._shape[0]>>>r||e<0||n<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(o,e,n,r,this.format,this.type,this._mipLevels,t)}}},{1273:1273,461:461,467:467}],258:[function(t,e,n){"use strict";e.exports=function(t,e,n){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var r=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(n){if(n.length>r)throw new Error("gl-vao: Too many vertex attributes");for(h=0;h0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}},{}],267:[function(t,e,n){e.exports=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}},{}],268:[function(t,e,n){e.exports=function(t,e,n,o){return r[0]=o,r[1]=n,r[2]=e,r[3]=t,i[0]};var r=new Uint8Array(4),i=new Float32Array(r.buffer)},{}],269:[function(t,e,n){var r=t(276),i=t(20);e.exports=function(t){for(var e=Array.isArray(t)?t:r(t),n=0;n0)continue;r=t.slice(0,1).join("")}return e(r),W+=r.length,(U=U.slice(r.length)).length}}function P(){return/[^a-fA-F0-9]/.test(z)?(e(U.join("")),B=l,R):(U.push(z),j=z,R+1)}function I(){return"."===z?(U.push(z),B=m,j=z,R+1):/[eE]/.test(z)?(U.push(z),B=m,j=z,R+1):"x"===z&&1===U.length&&"0"===U[0]?(B=_,U.push(z),j=z,R+1):/[^\d]/.test(z)?(e(U.join("")),B=l,R):(U.push(z),j=z,R+1)}function O(){return"f"===z&&(U.push(z),j=z,R+=1),/[eE]/.test(z)?(U.push(z),j=z,R+1):"-"===z&&/[eE]/.test(j)?(U.push(z),j=z,R+1):/[^\d]/.test(z)?(e(U.join("")),B=l,R):(U.push(z),j=z,R+1)}function D(){if(/[^\d\w_]/.test(z)){var t=U.join("");return B=K.indexOf(t)>-1?y:Z.indexOf(t)>-1?g:v,e(U.join("")),B=l,R}return U.push(z),j=z,R+1}var z,j,N,R=0,F=0,B=l,U=[],V=[],H=1,q=0,W=0,G=!1,Y=!1,X="",Z=o,K=r;return"300 es"===(t=t||{}).version&&(Z=s,K=a),function(t){return V=[],null!==t?n(t.replace?t.replace(/\r\n/g,"\n"):t):M()}};var r=t(274),i=t(275),o=t(272),a=t(273),s=t(271),l=999,u=9999,c=0,h=1,f=2,d=3,p=4,m=5,v=6,g=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{271:271,272:272,273:273,274:274,275:275}],271:[function(t,e,n){var r=t(272);r=r.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=r.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{272:272}],272:[function(t,e,n){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],273:[function(t,e,n){var r=t(274);e.exports=r.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{274:274}],274:[function(t,e,n){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],275:[function(t,e,n){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],276:[function(t,e,n){var r=t(270);e.exports=function(t,e){var n=r(e),i=[];return i=i.concat(n(t)),i=i.concat(n(null))}},{270:270}],277:[function(t,e,n){"use strict";function r(t,e,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],e=o[1],n=o[2],this.d=e+2*n;for(var a=0;a=u[f+0]&&r>=u[f+1]?(a[h]=!0,o.push(l[h])):a[h]=!1}}},r.prototype._forEachCell=function(t,e,n,r,i,o,a){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(n),c=this._convertToCellCoord(r),h=s;h<=u;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if(i.call(this,t,e,n,r,d,o,a))return}},r.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},r.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,n=0,r=0;r>1,c=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=u}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[n+d]=255&a,d+=p,a/=256,u-=8);t[n+d-p]|=128*m}},{}],280:[function(t,e,n){"use strict";function r(t,e,n){this.vertices=t,this.adjacent=e,this.boundary=n,this.lastVisited=-1}function i(t,e,n){this.vertices=t,this.cell=e,this.index=n}function o(t,e){return u(t.vertices,e.vertices)}function a(t){for(var e=["function orient(){var tuple=this.tuple;return test("],n=0;n<=t;++n)n>0&&e.push(","),e.push("tuple[",n,"]");e.push(")}return orient");var r=new Function("test",e.join("")),i=l[t+1];return i||(i=l),r(i)}function s(t,e,n){this.dimension=t,this.vertices=e,this.simplices=n,this.interior=n.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var r=0;r<=t;++r)this.tuple[r]=this.vertices[r];var i=c[t];i||(i=c[t]=a(t)),this.orient=i}e.exports=function(t,e){var n=t.length;if(0===n)throw new Error("Must have at least d+1 points");var i=t[0].length;if(n<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),a=l.apply(void 0,o);if(0===a)throw new Error("Input not in general position");for(var u=new Array(i+1),c=0;c<=i;++c)u[c]=c;a<0&&(u[0]=1,u[1]=0);for(var h=new r(u,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=u.slice(),m=0;m<=i;++m)m===c&&(p[m]=-1);var v=p[0];p[0]=p[1],p[1]=v;var g=new r(p,new Array(i+1),!0);f[c]=g,d[c]=g}d[i+1]=h;for(c=0;c<=i;++c)for(var p=f[c].vertices,y=f[c].adjacent,m=0;m<=i;++m){var x=p[m];if(x<0)y[m]=h;else for(var b=0;b<=i;++b)f[b].vertices.indexOf(x)<0&&(y[m]=f[b])}for(var _=new s(i,o,d),w=!!e,c=i+1;c0;){(t=a.pop()).vertices;for(var s=t.adjacent,l=0;l<=n;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-r)){for(var c=u.vertices,h=0;h<=n;++h){var f=c[h];i[h]=f<0?e:o[f]}var d=this.orient();if(d>0)return u;u.lastVisited=-r,0===d&&a.push(u)}}}return null},h.walk=function(t,e){var n=this.vertices.length-1,r=this.dimension,i=this.vertices,o=this.tuple,a=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[a];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=r;++c)o[c]=i[l[c]];s.lastVisited=n;for(c=0;c<=r;++c){var h=u[c];if(!(h.lastVisited>=n)){var f=o[c];o[c]=t;var d=this.orient();if(o[c]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-n:h.lastVisited=n}}return}return s},h.addPeaks=function(t,e){var n=this.vertices.length-1,a=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=n,e.vertices[e.vertices.indexOf(-1)]=n,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var d=(e=h.pop()).vertices,p=e.adjacent,m=d.indexOf(n);if(!(m<0))for(L=0;L<=a;++L)if(L!==m){var v=p[L];if(v.boundary&&!(v.lastVisited>=n)){var g=v.vertices;if(v.lastVisited!==-n){for(var y=0,x=0;x<=a;++x)g[x]<0?(y=x,l[x]=t):l[x]=s[g[x]];if(this.orient()>0){g[y]=n,v.boundary=!1,u.push(v),h.push(v),v.lastVisited=n;continue}v.lastVisited=-n}var b=v.adjacent,_=d.slice(),w=p.slice(),M=new r(_,w,!0);c.push(M);var k=b.indexOf(e);if(!(k<0)){b[k]=M,w[m]=v,_[L]=-1,w[L]=e,p[L]=M,M.flip();for(x=0;x<=a;++x){var T=_[x];if(!(T<0||T===n)){for(var A=new Array(a-1),S=0,E=0;E<=a;++E){var C=_[E];C<0||E===x||(A[S++]=C)}f.push(new i(A,M,x))}}}}}}f.sort(o);for(var L=0;L+1=0?a[l++]=s[c]:u=1&c;if(u===(1&t)){var h=a[0];a[0]=a[1],a[1]=h}e.push(a)}}return e}},{1240:1240,1251:1251}],281:[function(t,e,n){function r(t,e){if(e=e||{},void 0===t)throw new Error(s);var n=!0===e.prepend?"prepend":"append",r=void 0!==e.container?e.container:document.querySelector("head"),l=o.indexOf(r);-1===l&&(l=o.push(r)-1,a[l]={});var u;return void 0!==a[l]&&void 0!==a[l][n]?u=a[l][n]:(u=a[l][n]=i(),"prepend"===n?r.insertBefore(u,r.childNodes[0]):r.appendChild(u)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),u.styleSheet?u.styleSheet.cssText+=t:u.textContent+=t,u}function i(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}var o=[],a=[],s="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";e.exports=r,e.exports.insertCss=r},{}],282:[function(t,e,n){"use strict";function r(t,e,n,r,i){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(e?e.count:0)+(n?n.count:0)+r.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function o(t,e){var n=p(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function a(t,e){var n=t.intervals([]);n.push(e),o(t,n)}function s(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?g:(n.splice(r,1),o(t,n),y)}function l(t,e,n){for(var r=0;r=0&&t[r][1]>=e;--r){var i=n(t[r]);if(i)return i}}function c(t,e){for(var n=0;n>1],o=[],a=[],s=[],n=0;n3*(e+1)?a(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?a(this,t):this.right.insert(t):this.right=p([t]);else{var n=v.ge(this.leftPoints,t,f),r=v.ge(this.rightPoints,t,d);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?s(this,t):2===(a=this.left.remove(t))?(this.left=null,this.count-=1,y):(a===y&&(this.count-=1),a):g;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?s(this,t):2===(a=this.right.remove(t))?(this.right=null,this.count-=1,y):(a===y&&(this.count-=1),a):g;if(1===this.count)return this.leftPoints[0]===t?2:g;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,r=this.left;r.right;)n=r,r=r.right;if(n===this)r.right=this.right;else{var o=this.left,a=this.right;n.count-=r.count,n.right=r.left,r.left=o,r.right=a}i(this,r),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(o=v.ge(this.leftPoints,t,f);othis.mid){if(this.right){var n=this.right.queryPoint(t,e);if(n)return n}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,n){if(tthis.mid&&this.right){var r=this.right.queryInterval(t,e,n);if(r)return r}return ethis.mid?u(this.rightPoints,t,n):c(this.leftPoints,n)};var b=m.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new r(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==g}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{39:39}],283:[function(t,e,n){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var n=0;nn?"[\n"+o+f.join(",\n"+o)+"\n"+d+"]":"[ "+f.join(", ")+" ]":"["+f.join(",")+"]",o=d,c}if(s&&"object"==typeof s)for(h=s.length,l=0;ln?"{\n"+o+f.join(",\n"+o)+"\n"+d+"}":"{ "+f.join(", ")+" }":"{"+f.join(",")+"}",o=d,c}}var o,a,s,l=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};e.exports=function(t,e,n,r){var l;if(o="",a="",r||(r=0),"number"!=typeof r)throw new Error("beaufifier: limit must be a number");if("number"==typeof n)for(l=0;l=n&&s<=i&&l>=r&&l<=o&&c.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=n&&s<=i&&l>=r&&l<=o&&c.push(t[m]);var v=(h+1)%2;(0===h?n<=s:r<=l)&&(u.push(d),u.push(m-1),u.push(v)),(0===h?i>=s:o>=l)&&(u.push(m+1),u.push(f),u.push(v))}}return c}},{}],292:[function(t,e,n){"use strict";function r(t,e,n,o,a,s){if(!(a-o<=n)){var l=Math.floor((o+a)/2);i(t,e,l,o,a,s%2),r(t,e,n,o,l-1,s+1),r(t,e,n,l+1,a,s+1)}}function i(t,e,n,r,a,s){for(;a>r;){if(a-r>600){var l=a-r+1,u=n-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);i(t,e,n,Math.max(r,Math.floor(n-u*h/l+f)),Math.min(a,Math.floor(n+(l-u)*h/l+f)),s)}var d=e[2*n+s],p=r,m=a;for(o(t,e,r,n),e[2*a+s]>d&&o(t,e,r,a);pd;)m--}e[2*r+s]===d?o(t,e,r,m):o(t,e,++m,a),m<=n&&(r=m+1),n<=m&&(a=m-1)}}function o(t,e,n,r){a(t,n,r),a(e,2*n,2*r),a(e,2*n+1,2*r+1)}function a(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}e.exports=r},{}],293:[function(t,e,n){"use strict";function r(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}e.exports=function(t,e,n,i,o,a){for(var s=[0,t.length-1,0],l=[],u=o*o;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(h-f<=a)for(var d=f;d<=h;d++)r(e[2*d],e[2*d+1],n,i)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],v=e[2*p+1];r(m,v,n,i)<=u&&l.push(t[p]);var g=(c+1)%2;(0===c?n-o<=m:i-o<=v)&&(s.push(f),s.push(p-1),s.push(g)),(0===c?n+o>=m:i+o>=v)&&(s.push(p+1),s.push(h),s.push(g))}}return l}},{}],294:[function(t,e,n){e.exports=function(t,e,n){return t*(1-n)+e*n}},{}],295:[function(t,e,n){function r(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function o(t){return!!t&&"object"==typeof t}function a(t){return"symbol"==typeof t||o(t)&&m.call(t)==u}function s(t){if("number"==typeof t)return t;if(a(t))return l;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(c,"");var n=f.test(t);return n||d.test(t)?p(t.slice(2),n?2:8):h.test(t)?l:+t}var l=NaN,u="[object Symbol]",c=/^\s+|\s+$/g,h=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,d=/^0o[0-7]+$/i,p=parseInt,m=Object.prototype.toString;e.exports=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=s(n))===n?n:0),void 0!==e&&(e=(e=s(e))===e?e:0),r(s(t),e,n)}},{}],296:[function(t,e,n){(function(t){function r(t,e){return t.set(e[0],e[1]),t}function i(t,e){return t.add(e),t}function o(t,e){for(var n=-1,r=t?t.length:0;++n-1&&t%1==0&&t-1&&t%1==0&&t<=at}function et(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function nt(t){return!!t&&"object"==typeof t}function rt(t){return J(t)?y(t):A(t)}var it=200,ot="__lodash_hash_undefined__",at=9007199254740991,st="[object Arguments]",lt="[object Boolean]",ut="[object Date]",ct="[object Function]",ht="[object GeneratorFunction]",ft="[object Map]",dt="[object Number]",pt="[object Object]",mt="[object RegExp]",vt="[object Set]",gt="[object String]",yt="[object Symbol]",xt="[object ArrayBuffer]",bt="[object DataView]",_t="[object Float32Array]",wt="[object Float64Array]",Mt="[object Int8Array]",kt="[object Int16Array]",Tt="[object Int32Array]",At="[object Uint8Array]",St="[object Uint8ClampedArray]",Et="[object Uint16Array]",Ct="[object Uint32Array]",Lt=/[\\^$.*+?()[\]{}|]/g,Pt=/\w*$/,It=/^\[object .+?Constructor\]$/,Ot=/^(?:0|[1-9]\d*)$/,Dt={};Dt[st]=Dt["[object Array]"]=Dt[xt]=Dt[bt]=Dt[lt]=Dt[ut]=Dt[_t]=Dt[wt]=Dt[Mt]=Dt[kt]=Dt[Tt]=Dt[ft]=Dt[dt]=Dt[pt]=Dt[mt]=Dt[vt]=Dt[gt]=Dt[yt]=Dt[At]=Dt[St]=Dt[Et]=Dt[Ct]=!0,Dt["[object Error]"]=Dt[ct]=Dt["[object WeakMap]"]=!1;var zt="object"==typeof t&&t&&t.Object===Object&&t,jt="object"==typeof self&&self&&self.Object===Object&&self,Nt=zt||jt||Function("return this")(),Rt="object"==typeof n&&n&&!n.nodeType&&n,Ft=Rt&&"object"==typeof e&&e&&!e.nodeType&&e,Bt=Ft&&Ft.exports===Rt,Ut=Array.prototype,Vt=Function.prototype,Ht=Object.prototype,qt=Nt["__core-js_shared__"],Wt=function(){var t=/[^.]+$/.exec(qt&&qt.keys&&qt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Gt=Vt.toString,Yt=Ht.hasOwnProperty,Xt=Ht.toString,Zt=RegExp("^"+Gt.call(Yt).replace(Lt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kt=Bt?Nt.Buffer:void 0,Jt=Nt.Symbol,$t=Nt.Uint8Array,Qt=f(Object.getPrototypeOf,Object),te=Object.create,ee=Ht.propertyIsEnumerable,ne=Ut.splice,re=Object.getOwnPropertySymbols,ie=Kt?Kt.isBuffer:void 0,oe=f(Object.keys,Object),ae=B(Nt,"DataView"),se=B(Nt,"Map"),le=B(Nt,"Promise"),ue=B(Nt,"Set"),ce=B(Nt,"WeakMap"),he=B(Object,"create"),fe=X(ae),de=X(se),pe=X(le),me=X(ue),ve=X(ce),ge=Jt?Jt.prototype:void 0,ye=ge?ge.valueOf:void 0;p.prototype.clear=function(){this.__data__=he?he(null):{}},p.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},p.prototype.get=function(t){var e=this.__data__;if(he){var n=e[t];return n===ot?void 0:n}return Yt.call(e,t)?e[t]:void 0},p.prototype.has=function(t){var e=this.__data__;return he?void 0!==e[t]:Yt.call(e,t)},p.prototype.set=function(t,e){return this.__data__[t]=he&&void 0===e?ot:e,this},m.prototype.clear=function(){this.__data__=[]},m.prototype.delete=function(t){var e=this.__data__,n=b(e,t);return!(n<0||(n==e.length-1?e.pop():ne.call(e,n,1),0))},m.prototype.get=function(t){var e=this.__data__,n=b(e,t);return n<0?void 0:e[n][1]},m.prototype.has=function(t){return b(this.__data__,t)>-1},m.prototype.set=function(t,e){var n=this.__data__,r=b(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},v.prototype.clear=function(){this.__data__={hash:new p,map:new(se||m),string:new p}},v.prototype.delete=function(t){return F(this,t).delete(t)},v.prototype.get=function(t){return F(this,t).get(t)},v.prototype.has=function(t){return F(this,t).has(t)},v.prototype.set=function(t,e){return F(this,t).set(t,e),this},g.prototype.clear=function(){this.__data__=new m},g.prototype.delete=function(t){return this.__data__.delete(t)},g.prototype.get=function(t){return this.__data__.get(t)},g.prototype.has=function(t){return this.__data__.has(t)},g.prototype.set=function(t,e){var n=this.__data__;if(n instanceof m){var r=n.__data__;if(!se||r.length-1},o.prototype.set=function(t,e){var n=this.__data__,r=s(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},a.prototype.clear=function(){this.__data__={hash:new i,map:new($||o),string:new i}},a.prototype.delete=function(t){return h(this,t).delete(t)},a.prototype.get=function(t){return h(this,t).get(t)},a.prototype.has=function(t){return h(this,t).has(t)},a.prototype.set=function(t,e){return h(this,t).set(t,e),this};var nt=y(function(t){t=k(t);var e=[];return O.test(t)&&e.push(""),t.replace(D,function(t,n,r,i){e.push(r?i.replace(j,"$1"):n||t)}),e});y.Cache=a;var rt=Array.isArray;e.exports=function(t,e,n){var r=-1,i=(e=d(e,t)?[e]:c(e)).length;for(i||(t=void 0,i=1);++r-1&&t%1==0&&t-1},o.prototype.set=function(t,e){var n=this.__data__,r=l(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},a.prototype.clear=function(){this.__data__={hash:new i,map:new(rt||o),string:new i}},a.prototype.delete=function(t){return d(this,t).delete(t)},a.prototype.get=function(t){return d(this,t).get(t)},a.prototype.has=function(t){return d(this,t).has(t)},a.prototype.set=function(t,e){return d(this,t).set(t,e),this};var st=_(function(t){t=S(t);var e=[];return N.test(t)&&e.push(""),t.replace(R,function(t,n,r,i){e.push(r?i.replace(B,"$1"):n||t)}),e});_.Cache=a;var lt=Array.isArray;e.exports=function(t,e,n){return null==t?t:c(t,e,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],302:[function(t,e,n){"use strict";function r(t,e){var n;if(h(t)){var l,u=t.stops&&"object"==typeof t.stops[0][0],c=u||void 0!==t.property,f=u||!c,d=t.type||e||"exponential";if("exponential"===d)l=a;else if("interval"===d)l=o;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(u){for(var p={},m=[],v=0;v=t.stops.length)break;if(e<=t.stops[r][0])break;r++}return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:l(e,n,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}function s(t,e){return e}function l(t,e,n,r,i,o){return"function"==typeof i?function(){var a=i.apply(void 0,arguments),s=o.apply(void 0,arguments);return l(t,e,n,r,a,s)}:i.length?c(t,e,n,r,i,o):u(t,e,n,r,i,o)}function u(t,e,n,r,i,o){var a,s=r-n,l=t-n;return a=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-a)+o*a}function c(t,e,n,r,i,o){for(var a=[],s=0;s -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 mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / 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_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\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 vec2 v_linewidth;\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) * v_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 - (v_linewidth.t - blur), v_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 * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\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 mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / 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_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\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) * v_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 - (v_linewidth.t - blur), v_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 * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\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 - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\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 mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / 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_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\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"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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;\nvarying vec2 v_pos;\n\nvoid main() {\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 // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\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 vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\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"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{475:475}],304:[function(t,e,n){"use strict";var r=t(1281).format;e.exports=function(t,e){this.message=(t?t+": ":"")+r.apply(r,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{1281:1281}],305:[function(t,e,n){"use strict";e.exports=function(t){for(var e=1;e7)return[new r(c,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new r(c,l,'constant "%s" not found',l)];e=o({},e,{value:f.constants[l]})}return u.function&&"object"===i(l)?n(e):u.type&&s[u.type]?s[u.type](e):a(o({},e,{valueSpec:u.type?h[u.type]:u}))}},{304:304,305:305,306:306,309:309,310:310,311:311,312:312,313:313,314:314,315:315,317:317,319:319,320:320,322:322,323:323}],309:[function(t,e,n){"use strict";var r=t(306),i=t(308),o=t(304);e.exports=function(t){var e=t.value,n=t.valueSpec,a=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if("array"!==r(e))return[new o(l,e,"array expected, %s found",r(e))];if(n.length&&e.length!==n.length)return[new o(l,e,"array length %d expected, length %d found",n.length,e.length)];if(n["min-length"]&&e.length7)return n?[new r(e,n,"constants have been deprecated as of v8")]:[];var o=i(n);if("object"!==o)return[new r(e,n,"object expected, %s found",o)];var a=[];for(var s in n)"@"!==s[0]&&a.push(new r(e+"."+s,n[s],'constants must start with "@"'));return a}},{304:304,306:306}],313:[function(t,e,n){"use strict";var r=t(304),i=t(307);e.exports=function(t){var e=t.key,n=t.value,o=t.valueSpec,a=[];return-1===o.values.indexOf(i(n))&&a.push(new r(e,n,"expected one of [%s], %s found",o.values.join(", "),n)),a}},{304:304,307:307}],314:[function(t,e,n){"use strict";var r=t(304),i=t(313),o=t(306),a=t(307);e.exports=function t(e){var n,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==o(s))return[new r(l,s,"array expected, %s found",o(s))];if(s.length<1)return[new r(l,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new r(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new r(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(n=o(s[1]))?c.push(new r(l+"[1]",s[1],"string expected, %s found",n)):"@"===s[1][0]&&c.push(new r(l+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;h=8&&(h&&!t.valueSpec["property-function"]?d.push(new r(t.key,t.value,"property functions not supported")):f&&!t.valueSpec["zoom-function"]&&d.push(new r(t.key,t.value,"zoom functions not supported"))),d}},{304:304,306:306,308:308,309:309,319:319,320:320}],316:[function(t,e,n){"use strict";var r=t(304),i=t(323);e.exports=function(t){var e=t.value,n=t.key,o=i(t);return o.length?o:(-1===e.indexOf("{fontstack}")&&o.push(new r(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&o.push(new r(n,e,'"glyphs" url must include a "{range}" token')),o)}},{304:304,323:323}],317:[function(t,e,n){"use strict";var r=t(304),i=t(307),o=t(320),a=t(314),s=t(321),l=t(318),u=t(305);e.exports=function(t){var e=[],n=t.value,c=t.key,h=t.style,f=t.styleSpec;n.type||n.ref||e.push(new r(c,n,'either "type" or "ref" is required'));var d=i(n.type),p=i(n.ref);if(n.id)for(var m=0;mo.maximum?[new i(e,n,"%s is greater than the maximum value %s",n,o.maximum)]:[]}},{304:304,306:306}],320:[function(t,e,n){"use strict";var r=t(304),i=t(306),o=t(308);e.exports=function(t){var e=t.key,n=t.value,a=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],h=i(n);if("object"!==h)return[new r(e,n,"object expected, %s found",h)];for(var f in n){var d=f.split(".")[0],p=a&&(a[d]||a["*"]),m=s[d]||s["*"];p||m?c=c.concat((m||o)({key:(e?e+".":e)+f,value:n[f],valueSpec:p,style:l,styleSpec:u,object:n,objectKey:f})):""!==e&&1!==e.split(".").length&&c.push(new r(e,n[f],'unknown property "%s"',f))}for(d in a)a[d].required&&void 0===a[d].default&&void 0===n[d]&&c.push(new r(e,n,'missing required property "%s"',d));return c}},{304:304,306:306,308:308}],321:[function(t,e,n){"use strict";var r=t(308),i=t(304);e.exports=function(t){var e=t.key,n=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o["paint_"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?r({key:e,value:a,valueSpec:o.transition,style:n,styleSpec:o}):t.valueSpec||l[s]?r({key:t.key,value:a,valueSpec:t.valueSpec||l[s],style:n,styleSpec:o}):[new i(e,a,'unknown property "%s"',s)]}},{304:304,308:308}],322:[function(t,e,n){"use strict";var r=t(304),i=t(307),o=t(320),a=t(313);e.exports=function(t){var e=t.value,n=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new r(n,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var u=[];if(u=u.concat(o({key:n,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var c in e)["type","url","tileSize"].indexOf(c)<0&&u.push(new r(n+"."+c,e[c],'a source with a "url" property may not include a "%s" property',c));return u;case"geojson":return o({key:n,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return o({key:n,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return o({key:n,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return a({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{304:304,307:307,313:313,320:320}],323:[function(t,e,n){"use strict";var r=t(306),i=t(304);e.exports=function(t){var e=t.value,n=t.key,o=r(e);return"string"!==o?[new i(n,e,"string expected, %s found",o)]:[]}},{304:304,306:306}],324:[function(t,e,n){"use strict";function r(t,e){e=e||l;var n=[];return n=n.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(n=n.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(n)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return i(t.apply(this,arguments))}}var a=t(312),s=t(308),l=t(325),u=t(316);r.source=o(t(322)),r.layer=o(t(317)),r.filter=o(t(314)),r.paintProperty=o(t(321)),r.layoutProperty=o(t(318)),e.exports=r},{308:308,312:312,314:314,316:316,317:317,318:318,321:321,322:322,325:325}],325:[function(t,e,n){e.exports=t(326)},{326:326}],326:[function(t,e,n){e.exports={$version:8,$root:{version:{required:!0,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:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,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:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},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:!1},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","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,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","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},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","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],327:[function(t,e,n){"use strict";function r(t){return!!(i()&&o()&&a()&&s()&&l()&&u()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){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 a(){return Function.prototype&&Function.prototype.bind}function s(){return 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 l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function h(t){return void 0===d[t]&&(d[t]=f(t)),d[t]}function f(t){var e=document.createElement("canvas"),n=Object.create(r.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",n)||e.probablySupportsContext("experimental-webgl",n):e.supportsContext?e.supportsContext("webgl",n)||e.supportsContext("experimental-webgl",n):e.getContext("webgl",n)||e.getContext("experimental-webgl",n)}void 0!==e&&e.exports?e.exports=r:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=r);var d={};r.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],328:[function(t,e,n){"use strict";function r(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var n=t.elementArrayType;n&&(this.elementArray=new n);var r=t.elementArrayType2;r&&(this.elementArray2=new r),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t(442);e.exports=r,r.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,r.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=r.MAX_VERTEX_ARRAY_LENGTH},r.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},r.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},r.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},r.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{442:442}],329:[function(t,e,n){"use strict";function r(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=c.mapObject(t.arrays,function(n,r){var i=e[r],o=t.paintVertexArrayTypes[r];return n.map(function(t){return new u(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:o})})})}}function i(t){var e={};for(var n in t.programInterfaces){for(var r=e[n]={},i=0;i1?p.name+b:p.name]=m[b]*v}},r.VertexArrayType=function(t){return new h({members:t,alignment:4})},r.ElementArrayType=function(t){return new h({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{131:131,19:19,328:328,330:330,331:331,332:332,333:333,335:335,440:440,442:442}],330:[function(t,e,n){"use strict";function r(){i.apply(this,arguments)}var i=t(329),o=t(442),a=t(337),s=i.EXTENT;e.exports=r,(r.prototype=o.inherit(i,{})).addCircleVertex=function(t,e,n,r,i){return t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)},r.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,n){return t.getPaintValue("circle-color",e,n)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,n){return[t.getPaintValue("circle-radius",e,n)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,n){return[t.getPaintValue("circle-blur",e,n)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,n){return[t.getPaintValue("circle-opacity",e,n)]},multiplier:255,paintProperty:"circle-opacity"}]}},r.prototype.addFeature=function(t){for(var e={zoom:this.zoom},n=a(t),r=this.prepareArrayGroup("circle",0),i=r.layoutVertexArray.length,o=0;o=s||c<0||c>=s)){var h=this.prepareArrayGroup("circle",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,u,c,-1,-1);this.addCircleVertex(f,u,c,1,-1),this.addCircleVertex(f,u,c,1,1),this.addCircleVertex(f,u,c,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,r,i)}},{329:329,337:337,442:442}],331:[function(t,e,n){"use strict";function r(){i.apply(this,arguments)}var i=t(329),o=t(442),a=t(337),s=t(102),l=t(430);e.exports=r,(r.prototype=o.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,n){return t.getPaintValue("fill-color",e,n)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,n){return t.getPaintValue("fill-outline-color",e,n)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,n){return[t.getPaintValue("fill-opacity",e,n)]},multiplier:255,paintProperty:"fill-opacity"}]}},r.prototype.addFeature=function(t){for(var e=a(t),n=l(e,500),r=this.prepareArrayGroup("fill",0),i=r.layoutVertexArray.length,o=0;o0&&o.push(i.length/2);for(var c=0;c=1&&r.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,o),p=0;p>6)},r.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},r.prototype.addFeature=function(t){for(var e=a(t,15),n=0;n2&&t[o-1].equals(t[o-2]);)o--;if(!(t.length<2)){"bevel"===e&&(r=1.05);var a=s/(512*this.overscaling)*15,u=t[0],c=t[o-1],h=u.equals(c);if(this.prepareArrayGroup("line",10*o),2!==o||!h){this.distance=0;var f,d,p,m,v,g,y,x=n,b=h?"butt":n,_=!0;this.e1=this.e2=this.e3=-1,h&&(f=t[o-2],v=u.sub(f)._unit()._perp());for(var w=0;w0){var S=f.dist(d);if(S>2*a){var E=f.sub(f.sub(d)._mult(a/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var C=d&&p,L=C?e:p?x:b;if(C&&"round"===L&&(Tr&&(L="bevel"),"bevel"===L&&(T>2&&(L="flipbevel"),T100)M=v.clone();else{var P=m.x*v.y-m.y*v.x>0?-1:1,I=T*m.add(v).mag()/m.sub(v).mag();M._perp()._mult(I*P)}this.addCurrentVertex(f,this.distance,M,0,0,!1),this.addCurrentVertex(f,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===L||"fakeround"===L){var O=m.x*v.y-m.y*v.x>0,D=-Math.sqrt(T*T-1);if(O?(y=0,g=D):(g=0,y=D),_||this.addCurrentVertex(f,this.distance,m,g,y,!1),"fakeround"===L){for(var z,j=Math.floor(8*(.5-(k-.5))),N=0;N=0;R--)z=m.mult((R+1)/(j+1))._add(v)._unit(),this.addPieSliceVertex(f,this.distance,z,O)}p&&this.addCurrentVertex(f,this.distance,v,-g,-y,!1)}else"butt"===L?(_||this.addCurrentVertex(f,this.distance,m,0,0,!1),p&&this.addCurrentVertex(f,this.distance,v,0,0,!1)):"square"===L?(_||(this.addCurrentVertex(f,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(f,this.distance,v,-1,-1,!1)):"round"===L&&(_||(this.addCurrentVertex(f,this.distance,m,0,0,!1),this.addCurrentVertex(f,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(f,this.distance,v,-1,-1,!0),this.addCurrentVertex(f,this.distance,v,0,0,!1)));if(A&&w2*a){var B=f.add(p.sub(f)._mult(a/F)._round());this.distance+=B.dist(f),this.addCurrentVertex(B,this.distance,v.mult(1),0,0,!1),f=B}}_=!1}}}},r.prototype.addCurrentVertex=function(t,e,n,r,i,o){var a,s=o?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],c=l.layoutVertexArray,h=l.elementArray;a=n.clone(),r&&a._sub(n.perp()._mult(r)),this.e3=this.addLineVertex(c,t,a,s,0,r,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,a=n.mult(-1),i&&a._sub(n.perp()._mult(i)),this.e3=this.addLineVertex(c,t,a,s,1,-i,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>u/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,n,r,i,o))},r.prototype.addPieSliceVertex=function(t,e,n,r){var i=r?1:0;n=n.mult(r?-1:1);var o=this.arrayGroups.line[this.arrayGroups.line.length-1],a=o.layoutVertexArray,s=o.elementArray;this.e3=this.addLineVertex(a,t,n,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),r?this.e2=this.e3:this.e1=this.e3}},{329:329,337:337,442:442}],333:[function(t,e,n){"use strict";function r(t){a.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,n,r,i,o,a,s,l,u,c){return t.emplaceBack(e,n,Math.round(64*r),Math.round(64*i),o/4,a/4,10*(u||0),c,10*(s||0),10*Math.min(l||25,25))}var o=t(1051),a=t(329),s=t(391),l=t(397),u=t(441),c=t(401),h=t(403),f=t(402),d=t(400),p=t(393),m=t(442),v=t(337),g=t(395),y=h.shapeText,x=h.shapeIcon,b=c.getGlyphQuads,_=c.getIconQuads,w=a.EXTENT;e.exports=r,r.MAX_QUADS=65535,(r.prototype=m.inherit(a,{})).serialize=function(){var t=a.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new a.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new a.ElementArrayType;r.prototype.addCollisionBoxVertex=function(t,e,n,r,i){return t.emplaceBack(e.x,e.y,Math.round(n.x),Math.round(n.y),10*r,10*i)},r.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new a.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},r.prototype.populateArrays=function(t,e,n){var r={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:r}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:r}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:r}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:r});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var o=this.layer.layout,a=this.features,s=this.textFeatures,l=.5,c=.5;switch(o["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(o["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":c=1;break;case"top":case"top-right":case"top-left":c=0}for(var h="right"===o["text-justify"]?1:"left"===o["text-justify"]?0:.5,f=24*o["text-line-height"],p="line"!==o["symbol-placement"]?24*o["text-max-width"]:0,g=24*o["text-letter-spacing"],b=[24*o["text-offset"][0],24*o["text-offset"][1]],_=this.fontstack=o["text-font"].join(","),M=[],k=0;kw||C.y<0||C.y>w);if(!d||L){var P=L||b;this.addSymbolInstance(C,A,e,n,this.layer,P,this.symbolInstancesArray.length,this.collisionBoxArray,r.index,this.sourceLayerIndex,this.index,u,m,y,h,v,x,{zoom:this.zoom},r.properties)}}}},r.prototype.anchorIsTooClose=function(t,e,n){var r=this.compareText;if(t in r){for(var i=r[t],o=i.length-1;o>=0;o--)if(n.dist(i[o])3*Math.PI/2))){var v=p.tl,g=p.tr,y=p.bl,x=p.br,b=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),T=i(c,_.x,_.y,v.x,v.y,b.x,b.y,w,M,f,k);i(c,_.x,_.y,g.x,g.y,b.x+b.w,b.y,w,M,f,k),i(c,_.x,_.y,y.x,y.y,b.x,b.y+b.h,w,M,f,k),i(c,_.x,_.y,x.x,x.y,b.x+b.w,b.y+b.h,w,M,f,k),u.emplaceBack(T,T+1,T+2),u.emplaceBack(T+1,T+2,T+3)}}}},r.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var n=0;nr.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),T>r.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(O,D,z,j,k,T,A,S,t.x,t.y,s)},r.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{1051:1051,329:329,337:337,391:391,393:393,395:395,397:397,400:400,401:401,402:402,403:403,441:441,442:442}],334:[function(t,e,n){"use strict";function r(t,e,n){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=n,this.arrayType=e}e.exports=r,r.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};r.prototype.setVertexAttribPointers=function(t,e){for(var n=0;n0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,n,r,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===n&&e._rotate(-r);for(var o=[],a=0;an.max||f.yn.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{19:19,329:329,442:442}],338:[function(t,e,n){"use strict";function r(t,e,n){this.column=t,this.row=e,this.zoom=n}e.exports=r,r.prototype={clone:function(){return new r(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],339:[function(t,e,n){"use strict";function r(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=r;var i=t(442).wrap;r.prototype.wrap=function(){return new r(i(this.lng,-180,180),this.lat)},r.prototype.toArray=function(){return[this.lng,this.lat]},r.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},r.convert=function(t){return t instanceof r?t:Array.isArray(t)?new r(t[0],t[1]):t}},{442:442}],340:[function(t,e,n){"use strict";function r(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=r;var i=t(339);r.prototype={extend:function(t){var e,n,o=this._sw,a=this._ne;if(t instanceof i)e=t,n=t;else{if(!(t instanceof r))return t?this.extend(i.convert(t)||r.convert(t)):this;if(e=t._sw,n=t._ne,!e||!n)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(n.lng,a.lng),a.lat=Math.max(n.lat,a.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(n.lng,n.lat)),this},getCenter:function(){return new i((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 i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(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()+")"}},r.convert=function(t){return!t||t instanceof r?t:new r(t)}},{339:339}],341:[function(t,e,n){"use strict";function r(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t(339),o=t(1051),a=t(338),s=t(442).wrap,l=t(436),u=t(369),c=t(329).EXTENT,h=t(192),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=r,r.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 o(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),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._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),n=e;if(et.maxzoom&&(e=t.maxzoom);var r=this,i=r.locationCoordinate(r.center)._zoomTo(e),a=new o(i.column-.5,i.row-.5);return u.cover(e,[r.pointCoordinate(new o(0,0))._zoomTo(e),r.pointCoordinate(new o(r.width,0))._zoomTo(e),r.pointCoordinate(new o(r.width,r.height))._zoomTo(e),r.pointCoordinate(new o(0,r.height))._zoomTo(e)],t.reparseOverscaled?n:e).sort(function(t,e){return a.dist(t)-a.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),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,e){return new o(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new o(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var n=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var n=this.locationCoordinate(t),r=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),o=r._sub(n);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(o))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,n=i.convert(t);return new a(this.lngX(n.lng)*e,this.latY(n.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],n=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(n,n,this.pixelMatrixInverse);var r=e[3],i=n[3],o=e[0]/r,s=n[0]/i,u=e[1]/r,c=n[1]/i,h=e[2]/r,d=n[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new a(l(o,s,p)/m,l(u,c,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),n=[t.column*e,t.row*e,0,1];return f.transformMat4(n,n,this.pixelMatrix),new o(n[0]/n[3],n[1]/n[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var n=Math.min(t.zoom,e),r=this.worldSize/Math.pow(2,n),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*r,t.row*r,0]),d.scale(i,i,[r/c,r/c,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,n,r,i,a,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;p-mr&&(s=r-m)}void 0===s&&void 0===l||(this.center=this.unproject(new o(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),n=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,r=new Float64Array(16);if(d.perspective(r,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,n),d.translate(r,r,[0,0,-this.altitude]),d.scale(r,r,[1,-1,1/this.height]),d.rotateX(r,r,this._pitch),d.rotateZ(r,r,this.angle),d.translate(r,r,[-this.x,-this.y,0]),this.projMatrix=r,r=d.create(),d.scale(r,r,[this.width/2,-this.height/2,1]),d.translate(r,r,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),r,this.projMatrix),!(r=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=r}}}},{1051:1051,192:192,329:329,338:338,339:339,369:369,436:436,442:442}],342:[function(t,e,n){"use strict";var r={" ":[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]]};e.exports=function(t,e,n,i){i=i||1;var o,a,s,l,u,c,h,f,d=[];for(o=0,a=t.length;o>16,_>>16),s.uniform2f(a.u_pixel_coord_lower,65535&b,65535&_)}s.uniformMatrix4fv(a.u_matrix,!1,t.transform.calculatePosMatrix(g)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{344:344,363:363}],346:[function(t,e,n){"use strict";var r=t(426);e.exports=function(t,e,n,i){if(!t.isOpaquePass){var o=t.gl;t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.STENCIL_TEST);for(var a=0;a>16,f>>16),s.uniform2f(o.u_pixel_coord_lower,65535&h,65535&f),s.activeTexture(s.TEXTURE0),i.spriteAtlas.bind(s,!0)}}var a=t(363);e.exports=function(t,e,n,o){var a=t.gl;a.enable(a.STENCIL_TEST);var s;if(s=!n.paint["fill-pattern"]&&n.isPaintValueFeatureConstant("fill-color")&&n.isPaintValueFeatureConstant("fill-opacity")&&1===n.paint["fill-color"][3]&&1===n.paint["fill-opacity"],t.isOpaquePass===s){t.setDepthSublayer(1);for(var l=0;l0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,n,r){var i=[1,0],o=n.paint["raster-fade-duration"];if(t.source&&o>0){var a=(new Date).getTime(),s=(a-t.timeAdded)/o,l=e?(a-e.timeAdded)/o:-1,c=r.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c);!e||h?(i[0]=u.clamp(s,0,1),i[1]=1-i[0]):(i[0]=u.clamp(1-l,0,1),i[1]=1-i[0])}var f=n.paint["raster-opacity"];return i[0]*=f,i[1]*=f,i}var u=t(442),c=t(440);e.exports=r,r.RasterBoundsArray=new c({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{440:440,442:442}],352:[function(t,e,n){"use strict";function r(t,e,n,r,o,a,s,l,u,c,h,f,d,p,m){for(var v=0;vthis.previousZoom;n--)this.changeTimes[n]=e,this.changeOpacities[n]=this.opacities[n];for(n=0;n<256;n++){var r=(e-this.changeTimes[n])/this.fadeDuration*255;this.opacities[n]=n<=t?this.changeOpacities[n]+r:this.changeOpacities[n]-r}this.changed=!0,this.previousZoom=t},r.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],354:[function(t,e,n){"use strict";function r(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t(442);e.exports=r,r.prototype.setSprite=function(t){this.sprite=t},r.prototype.getDash=function(t,e){var n=t.join(",")+e;return this.positions[n]||(this.positions[n]=this.addDash(t,e)),this.positions[n]},r.prototype.addDash=function(t,e){var n=e?7:0,r=2*n+1;if(this.nextRow+r>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a0?e.pop():null},r.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},r.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{192:192,329:329,334:334,344:344,345:345,346:346,348:348,349:349,350:350,351:351,352:352,353:353,356:356,357:357,363:363,367:367,426:426,440:440,442:442}],356:[function(t,e,n){"use strict";function r(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,n,r,i,o){return e[n][o].replace(/{type}/g,i).replace(/{precision}/g,r)})}var i=t(19),o=t(442),a=t(303),s=a.util;e.exports._createProgram=function(t,e,n,l){for(var u=this.gl,c=u.createProgram(),h=a[t],f="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,r={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",r,function(n,r){if(t.unloadVectorData(this.map.painter),!t.aborted)return n?e(n):(t.loadVectorData(r,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{1233:1233,329:329,434:434,442:442}],359:[function(t,e,n){"use strict";function r(t,e,n){n&&(this.loadGeoJSON=n),h.call(this,t,e)}var i=t(442),o=t(425),a=t(137),s=t(360),l=t(1288),u=t(1261),c=t(141),h=t(371);e.exports=r,r.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var n=t.source,r=t.coord;if(!this._geoJSONIndexes[n])return e(null,null);var i=this._geoJSONIndexes[n].getTile(Math.min(r.z,t.maxZoom),r.x,r.y);if(!i)return e(null,null);var o=new s(i.features);o.name="_geojsonTileLayer";var a=l({layers:{_geojsonTileLayer:o}});0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{tile:o,rawTileData:a.buffer})},loadData:function(t,e){var n=function(n,r){return n?e(n):"object"!=typeof r?e(new Error("Input data is not a valid GeoJSON object.")):(a(r,!0),void this._indexData(r,t,function(n,r){if(n)return e(n);this._geoJSONIndexes[t.source]=r,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,n)},loadGeoJSON:function(t,e){if(t.url)o.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,n){try{e.cluster?n(null,u(e.superclusterOptions).load(t.features)):n(null,c(t,e.geojsonVtOptions))}catch(t){return n(t)}}})},{1261:1261,1288:1288,137:137,141:141,360:360,371:371,425:425,442:442}],360:[function(t,e,n){"use strict";function r(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var a=Math.pow(2,Math.min(o.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(o.coord.x/a)===t.x&&Math.floor(o.coord.y/a)===t.y)for(n[i]=!0,r=!0;o&&o.coord.z-1>t.z;){var s=o.coord.parent(this.maxzoom).id;(o=this._tiles[s])&&o.isRenderable()&&(delete n[i],n[s]=!0)}}}return r},findLoadedParent:function(t,e,n){for(var r=t.z-1;r>=e;r--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return n[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),n[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var n,i,o;this.updateCacheSize(t);var a=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(a-r.maxOverzooming,this.minzoom),l=Math.max(a+r.maxUnderzooming,this.minzoom),c={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(n=0;nh-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[g]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)c[y]||(this._coveredTiles[y]=!0);for(y in p)c[y]=!0;var x=f.keysDifference(this._tiles,c);for(n=0;nthis.maxzoom?Math.pow(2,r-this.maxzoom):1;e=new s(n,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},n=this.getIds(),r=1/0,o=1/0,a=-1/0,s=-1/0,l=t[0].zoom,c=0;c=0&&g[1].y>=0){for(var y=[],x=0;x=0&&t%1==0),l(!isNaN(e)&&e>=0&&e%1==0),l(!isNaN(n)&&n>=0&&n%1==0),isNaN(r)&&(r=0),this.z=+t,this.x=+e,this.y=+n,this.w=+r,(r*=2)<0&&(r=-1*r-1);var i=1<0;o--)i+=(e&(r=1<e.row){var n=t;t=e,e=n}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,n,r,i){var o=Math.max(n,Math.floor(e.y0)),a=Math.min(r,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,f=o;fc.dy&&(l=u,u=c,c=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy&&a(h,u,r,i,s),c.dy&&a(h,c,r,i,s)}var l=t(19),u=t(1298),c=t(338);e.exports=r,r.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},r.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),n=Math.pow(2,e),r=this.y,i=this.x+n*this.w;return new c(i,r,e)},r.fromID=function(t){var e=t%32,n=1<t?new r(this.z-1,this.x,this.y,this.w):new r(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},r.prototype.wrapped=function(){return new r(this.z,this.x,this.y,0)},r.prototype.children=function(t){if(this.z>=t)return[new r(this.z+1,this.x,this.y,this.w)];var e=this.z+1,n=2*this.x,i=2*this.y;return[new r(e,n,i,this.w),new r(e,n+1,i,this.w),new r(e,n,i+1,this.w),new r(e,n+1,i+1,this.w)]},r.cover=function(t,e,n){function i(t,e,i){var s,l;if(i>=0&&i<=o)for(s=t;sthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*r,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,n.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,n.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{362:362,434:434,439:439,442:442}],371:[function(t,e,n){"use strict";function r(t,e,n){this.actor=t,this.styleLayers=e,n&&(this.loadVectorData=n),this.loading={},this.loaded={}}var i=t(425),o=t(1282),a=t(477),s=t(374);e.exports=r,r.prototype={loadTile:function(t,e){var n=t.source,r=t.uid;this.loading[n]||(this.loading[n]={});var i=this.loading[n][r]=new s(t);i.abort=this.loadVectorData(t,function(t,o){return delete this.loading[n][r],t?e(t):o?(i.data=o.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,o.rawTileData,e),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][r]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var n=this.loaded[t.source],r=t.uid;if(n&&n[r]){var i=n[r];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],n=t.uid;e&&e[n]&&e[n].abort&&(e[n].abort(),delete e[n])},removeTile:function(t){var e=this.loaded[t.source],n=t.uid;e&&e[n]&&delete e[n]},loadVectorData:function(t,e){var n=i.getArrayBuffer(t.url,function(t,n){if(t)return e(t);var r=new o.VectorTile(new a(new Uint8Array(n)));e(t,{tile:r,rawTileData:n})}.bind(this));return function(){n.abort()}},redoPlacement:function(t,e){var n=this.loaded[t.source],r=this.loading[t.source],i=t.uid;if(n&&n[i]){var o=n[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);o.result&&e(null,o.result,o.transferables)}else r&&r[i]&&(r[i].angle=t.angle)}}},{1282:1282,374:374,425:425,477:477}],372:[function(t,e,n){"use strict";function r(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,u.getVideo(e.urls,function(t,n){if(t)return this.fire("error",{error:t});this.video=n,this.video.loop=!0;var r;this.video.addEventListener("playing",function(){r=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(r)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t(442),o=t(369),a=t(339),s=t(1051),l=t(434),u=t(425),c=t(329).EXTENT,h=t(351).RasterBoundsArray,f=t(334),d=t(357);e.exports=r,r.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,n=t.map(function(t){return e.transform.locationCoordinate(a.convert(t)).zoomTo(0)}),r=this.centerCoord=i.getCoordinatesCenter(n);return r.column=Math.round(r.column),r.row=Math.round(r.row),this.minzoom=this.maxzoom=r.zoom,this._coord=new o(r.zoom,r.column,r.row),this._tileCoords=n.map(function(t){var e=t.zoomTo(r.zoom);return new s(Math.round((e.column-r.column)*c),Math.round((e.row-r.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),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,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{1051:1051,329:329,334:334,339:339,351:351,357:357,369:369,425:425,434:434,442:442}],373:[function(t,e,n){"use strict";function r(t){this.self=t,this.actor=new o(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new u(this.actor,e)},this.self.registerWorkerSource=function(t,n){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new n(this.actor,e)}.bind(this)}function i(t){var e={};for(var n in t){var r=t[n],i=r.ref||r.id,o=t[i];o.layout&&"none"===o.layout.visibility||(e[i]=e[i]||[],n===i?e[i].unshift(r):e[i].push(r))}return e}var o=t(424),a=t(381),s=t(442),l=t(371),u=t(359);e.exports=function(t){return new r(t)},s.extend(r.prototype,{"set layers":function(t){function e(t){var e=a.create(t,t.ref&&n.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),n.layers[e.id]=e}this.layers={};for(var n=this,r=[],o=0;o=0;e--)x(E,D[e]);b()}}function x(t,e){if(e.populateArrays(T,R,N),"symbol"!==e.type)for(var n=0;n=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=c.create({layer:w,index:P++,childLayers:e[I],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),C[w.id]=k,t.layers&&(L[M=w.sourceLayer]=L[M]||{},L[M][w.id]=k)));if(t.layers)for(M in L)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&g(w,L[M]);else g(t,C);var O=[],D=this.symbolBuckets=[],z=[];A.bucketLayerIDs={};for(var j in C)0!==(k=C[j]).features.length&&(A.bucketLayerIDs[k.index]=k.childLayers.map(s),O.push(k),"symbol"===k.type?D.push(k):z.push(k));var N={},R={},F=0;if(D.length>0){for(_=D.length-1;_>=0;_--)D[_].updateIcons(N),D[_].updateFont(R);for(var B in R)R[B]=Object.keys(R[B]).map(Number);N=Object.keys(N),n.send("get glyphs",{uid:this.uid,stacks:R},function(t,e){R=e,y(t)}),N.length?n.send("get icons",{icons:N},function(t,e){N=e,y(t)}):y()}for(_=z.length-1;_>=0;_--)x(0,z[_]);if(0===D.length)return b()},r.prototype.redoPlacement=function(t,e,n){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var r=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(r,n);var c=r.serialize(),h=s.filter(i);return{result:{buckets:h.map(o),collisionTile:c.data},transferables:a(h).concat(c.transferables)}}},{329:329,336:336,394:394,396:396,405:405,406:406,432:432,442:442}],375:[function(t,e,n){"use strict";function r(){this.n=0,this.times=[]}e.exports=r,r.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},r.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},r.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],376:[function(t,e,n){"use strict";function r(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";a.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),a.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var n=e.getData(),r=e.data=new Uint8Array(n.length),i=0;i1!==this.retina){var t=new r(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},r.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{425:425,426:426,434:434,439:439}],377:[function(t,e,n){"use strict";var r=t(84).parseCSSColor,i=t(442),o=t(380),a={};e.exports=function t(e){if(o.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!a[e]){var n=r(e);if(!n)throw new Error("Invalid color "+e);a[e]=[n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3]]}return a[e]}throw new Error("Invalid color "+e)}},{380:380,442:442,84:84}],378:[function(t,e,n){"use strict";function r(t,e,n){this.animationLoop=e||new m,this.dispatcher=new p(n||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var r=function(t,e){if(t)this.fire("error",{error:t});else if(!v.emitErrors(this,v(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var n=e.sources;for(var r in n)this.addSource(r,n[r]);e.sprite&&(this.sprite=new a(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),r):d.frame(r.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var n in this._layers){var r=this._layers[n];r.source===e.id&&this._validateLayer(r)}})}var i=t(434),o=t(381),a=t(376),s=t(399),l=t(404),u=t(354),c=t(442),h=t(425),f=t(439).normalizeStyleURL,d=t(426),p=t(433),m=t(375),v=t(390),g=t(366),y=t(364),x=t(367),b=t(388),_=t(380);e.exports=r,r.prototype=c.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var n=0;nMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var n=Object.keys(this._updates.layers);n.length&&this._updateWorkerLayers(n)}var r,i=Object.keys(this._updates.sources);for(r=0;r=0&&this._handleErrors(v.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof o)){if(this._handleErrors(v.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var n=t.ref&&this.getLayer(t.ref);t=o.create(t,n)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var n in this._layers)this._layers[n].ref===t&&this.removeLayer(n);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,n){this._checkLoaded();var r=this.getReferentLayer(t);return r.minzoom===e&&r.maxzoom===n?this:(null!=e&&(r.minzoom=e),null!=n&&(r.maxzoom=n),this._updateLayer(r))},setFilter:function(t,e){this._checkLoaded();var n=this.getReferentLayer(t);return null!==e&&this._handleErrors(v.filter,"layers."+n.id+".filter",e)?this:c.deepEqual(n.filter,e)?this:(n.filter=c.clone(e),this._updateLayer(n))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,n){this._checkLoaded();var r=this.getReferentLayer(t);return c.deepEqual(r.getLayoutProperty(e),n)?this:(r.setLayoutProperty(e,n),this._updateLayer(r))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,n,r){this._checkLoaded();var i=this.getLayer(t);if(c.deepEqual(i.getPaintProperty(e,r),n))return this;var o=i.isPaintValueFeatureConstant(e);return i.setPaintProperty(e,n,r),!(n&&_.isFunctionDefinition(n)&&"$zoom"!==n.property&&void 0!==n.property)&&o||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,n){return this.getLayer(t).getPaintProperty(e,n)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var n=this._updates.paintProps;n[t]||(n[t]={}),n[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],n=this._order.length-1;n>=0;n--)for(var r=this._order[n],i=0;is.lastIntegerZoom?(r=u+(1-u)*c,h*=2,i=t({zoom:a-1},n),o=t({zoom:a},n)):(r=1-(1-c)*u,o=t({zoom:a},n),i=t({zoom:a+1},n),h/=2),void 0===i||void 0===o?void 0:{from:i,fromScale:h,to:o,toScale:1,t:r}}}var i=t(380),o=t(377),a=t(442);e.exports=function(t,e){this.value=a.clone(e),this.isFunction=i.isFunctionDefinition(e),this.json=JSON.stringify(this.value);var n="color"===t.type&&this.value?o(this.value):e;if(this.calculate=i[t.function||"piecewise-constant"](n),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,"piecewise-constant"===t.function&&t.transition&&(this.calculate=r(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var s=[],l=this.value.stops,u=0;u=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,n,r){for(var i=o.extend({},this._paintDeclarations[""]),a=0;a-n/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;sr;)u-=l.shift().angleDelta;if(u>i)return!1;a++,s+=h.dist(f)}return!0}},{}],393:[function(t,e,n){"use strict";var r=t(1051);e.exports=function(t,e,n,i,o){for(var a=[],s=0;s=i&&f.x>=i||(h.x>=i?h=new r(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round():f.x>=i&&(f=new r(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round()),h.y>=o&&f.y>=o||(h.y>=o?h=new r(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round():f.y>=o&&(f=new r(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round()),l&&h.equals(l[l.length-1])||(l=[h],a.push(l)),l.push(f)))))}return a}},{1051:1051}],394:[function(t,e,n){"use strict";var r=t(440),i=t(442),o=t(1051),a=e.exports=new r({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(a.prototype.StructType.prototype,{get anchorPoint(){return new o(this.anchorPointX,this.anchorPointY)}})},{1051:1051,440:440,442:442}],395:[function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s,l,u,c){var h=a.top*s-l,f=a.bottom*s+l,d=a.left*s-l,p=a.right*s+l;if(this.boxStartIndex=t.length,u){var m=f-h,v=p-d;if(m>0)if(m=Math.max(10*s,m),c){var g=e[n.segment+1].sub(e[n.segment])._unit()._mult(v),y=[n.sub(g),n.add(g)];this._addLineCollisionBoxes(t,y,n,0,v,m,r,i,o)}else this._addLineCollisionBoxes(t,e,n,n.segment,v,m,r,i,o)}else t.emplaceBack(n.x,n.y,d,h,p,f,1/0,r,i,o,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=r,r.prototype._addLineCollisionBoxes=function(t,e,n,r,i,o,a,s,l){var u=o/2,c=Math.floor(i/u),h=-o/2,f=this.boxes,d=n,p=r+1,m=h;do{if(--p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var v=e[p].dist(e[p+1]),g=0;g=e.length)return f;v=e[p].dist(e[p+1])}var x=y-m,b=e[p],_=e[p+1].sub(b)._unit()._mult(x)._add(b)._round(),w=i/2/Math.max(Math.abs(y-h)-u/2,0);t.emplaceBack(_.x,_.y,-o/2,-o/2,o/2,o/2,w,a,s,l,0,0,0,0,0)}return f}},{}],396:[function(t,e,n){"use strict";function r(t,e,n){if("object"==typeof t){var r=t;n=e,t=r.angle,e=r.pitch,this.grid=new a(r.grid),this.ignoredGrid=new a(r.ignoredGrid)}else this.grid=new a(o,12,6),this.ignoredGrid=new a(o,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=n,0===n.length){n.emplaceBack();n.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),n.emplaceBack(o,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),n.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),n.emplaceBack(0,o,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=n.get(0),this.edges=[n.get(1),n.get(2),n.get(3),n.get(4)]}var i=t(1051),o=t(329).EXTENT,a=t(277);e.exports=r,r.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},r.prototype.minScale=.25,r.prototype.maxScale=2,r.prototype.placeCollisionFeature=function(t,e,n){for(var r=this.collisionBoxArray,o=this.minScale,a=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return o}if(n){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(u.x1,u.y1).matMult(w),k=new i(u.x2,u.y1).matMult(w),T=new i(u.x1,u.y2).matMult(w),A=new i(u.x2,u.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=u.anchorPoint.x,_.anchorPointY=u.anchorPoint.y,_.x1=Math.min(M.x,k.x,T.x,A.x),_.y1=Math.min(M.y,k.x,T.x,A.x),_.x2=Math.max(M.x,k.x,T.x,A.x),_.y2=Math.max(M.y,k.x,T.x,A.x),_.maxScale=u.maxScale}else _=u;for(var S=0;S=this.maxScale)return o}}}return o},r.prototype.queryRenderedSymbols=function(t,e,n,r,o){var a={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new i(t,e)._matMult(u),h=this.tempCollisionBox;h.anchorX=c.x,h.anchorY=c.y,h.x1=0,h.y1=0,h.x2=n-t,h.y2=r-e,h.maxScale=o,o=h.maxScale;for(var f=[c.x+h.x1/o,c.y+h.y1/o*this.yStretch,c.x+h.x2/o,c.y+h.y2/o*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m=o&&(a[y][x]=!0,s.push(d[v]))}}return s},r.prototype.getPlacementScale=function(t,e,n,r,i){var o=e.x-r.x,a=e.y-r.y,s=(i.x1-n.x2)/o,l=(i.x2-n.x1)/o,u=(i.y1-n.y2)*this.yStretch/a,c=(i.y2-n.y1)*this.yStretch/a;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var h=Math.min(Math.max(s,l),Math.max(u,c)),f=i.maxScale,d=n.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},r.prototype.insertCollisionFeature=function(t,e,n){for(var r=n?this.ignoredGrid:this.grid,i=this.collisionBoxArray,o=t.boxStartIndex;o=0&&T=0&&A=0&&g+d<=p){var S=new o(T,A,M,x)._round();s&&!a(t,S,u,s,l)||y.push(S)}}v+=w}return h||y.length||c||(y=r(t,v/2,n,s,l,u,c,!0,f)),y}var i=t(436),o=t(391),a=t(392);e.exports=function(t,e,n,i,o,a,s,l,u){var c=i?.6*a*s:0,h=Math.max(i?i.right-i.left:0,o?o.right-o.left:0),f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e-h*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var n=new ArrayBuffer(this.width*this.height),r=0;r65535)return n("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var r=this.loading[t];if(r[e])r[e].push(n);else{r[e]=[n];var i=o(t,256*e+"-"+(256*e+255),this.url);s(i,function(t,n){for(var i=!t&&new l(new c(new Uint8Array(n))),o=0;or&&null!==f){var b=g[f+1].x;v=Math.max(b,v);for(var _=f+1;_<=y;_++)g[_].y+=n,g[_].x-=b;if(l){var w=f;u[g[f].codePoint]&&w--,a(g,e,p,w,l)}p=f+1,f=null,d+=b,m++}c[x.codePoint]&&(f=y)}var M=g[g.length-1],k=M.x+e[M.codePoint].advance;v=Math.max(v,k);var T=(m+1)*n;a(g,e,p,g.length-1,l),s(g,l,i,o,v,n,m,h),t.top+=-o*T,t.bottom=t.top+T,t.left+=-i*v,t.right=t.left+v}function a(t,e,n,r,i){for(var o=e[t[r].codePoint].advance,a=(t[r].x+o)*i,s=n;s<=r;s++)t[s].x-=a}function s(t,e,n,r,i,o,a,s){for(var l=(e-n)*i+s[0],u=(-r*(a+1)+.5)*o+s[1],c=0;c1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},r.prototype.addIcons=function(t,e){for(var n=0;n1||(h?(clearTimeout(h),h=null,a("dblclick",e)):h=setTimeout(n,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){r.mousePos(l,t).equals(c)&&a("click",t)},!1),l.addEventListener("dblclick",function(t){a("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){u=t,t.preventDefault()},!1)}},{1051:1051,413:413,414:414,415:415,416:416,417:417,418:418,419:419,428:428}],408:[function(t,e,n){"use strict";var r=t(442),i=t(436),o=t(426),a=t(339),s=t(340),l=t(1051),u=e.exports=function(){};r.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,n){return this.panTo(this.transform.center,r.extend({offset:l.convert(t).mult(-1)},e),n),this},panTo:function(t,e,n){return this.easeTo(r.extend({center:t},e),n)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,n){return this.easeTo(r.extend({zoom:t},e),n)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,n){return this.easeTo(r.extend({bearing:t},e),n)},resetNorth:function(t,e){return this.rotateTo(0,r.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var x=c.zoomScale(v-f),b=c.point,_="center"in t?c.project(m).sub(h.div(x)):b,w=c.worldSize,M=t.curve,k=Math.max(c.width,c.height),T=k/x,A=_.sub(b).mag();if("minZoom"in t){var S=r.clamp(Math.min(t.minZoom,f,v),c.minZoom,c.maxZoom),E=k/c.zoomScale(S-f);M=Math.sqrt(E/A*2)}var C=M*M,L=n(0),P=function(t){return s(L)/s(L+M*t)},I=function(t){return k*((s(L)*u(L+M*t)-o(L))/C)/A},O=(n(1)-L)/M;if(Math.abs(A)<1e-6){if(Math.abs(k-T)<1e-6)return this.easeTo(t);var D=T=0)return!1;return!0})).join(" | ")},r.prototype=a.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=r.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{410:410,428:428,442:442}],410:[function(t,e,n){"use strict";function r(){}var i=t(442),o=t(434);e.exports=r,r.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var n=this.options.position,r=t._controlCorners[n];e.className+=" mapboxgl-ctrl",-1!==n.indexOf("bottom")?r.insertBefore(e,r.firstChild):r.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(r.prototype,o)},{434:434,442:442}],411:[function(t,e,n){"use strict";function r(t){s.setOptions(this,t)}var i=t(410),o=t(426),a=t(428),s=t(442);e.exports=r;var l={enableHighAccuracy:!1,timeout:6e3};r.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-group",t.getContainer());return o.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=a.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{410:410,426:426,428:428,442:442}],412:[function(t,e,n){"use strict";function r(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var o=t(410),a=t(428),s=t(442);e.exports=r,r.prototype=s.inherit(o,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",n=this._container=a.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=a.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),n},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(a.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),a.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var n=a.create("button",t,this._container);return n.type="button",n.addEventListener("click",function(){e()}),n},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{410:410,428:428,442:442}],413:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),a.bindHandlers(this)}var i=t(428),o=t(340),a=t(442);e.exports=r,r.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,n=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var r=Math.min(e.x,n.x),o=Math.max(e.x,n.x),a=Math.min(e.y,n.y),s=Math.max(e.y,n.y);i.setTransform(this._box,"translate("+r+"px,"+a+"px)"),this._box.style.width=o-r+"px",this._box.style.height=s-a+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,n=i.mousePos(this._el,t),r=new o(this._map.unproject(e),this._map.unproject(n));this._finish(),e.x===n.x&&e.y===n.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(r,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:r})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_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),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{340:340,428:428,442:442}],414:[function(t,e,n){"use strict";function r(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=r,r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],415:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t(428),o=t(442);e.exports=r;var a=o.bezier(0,0,.3,1);r.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),n=this._map;n.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),n.transform.setLocationAtPoint(n.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),n=this._inertia;if(n.length<2)e();else{var r=n[n.length-1],i=n[0],o=r[1].sub(i[1]),s=(r[0]-i[0])/1e3;if(0===s||r[1].equals(i[1]))e();else{var l=o.mult(.3/s),u=l.mag();u>1400&&(u=1400,l._unit()._mult(u));var c=u/750,h=l.mult(-c/2);this._map.panBy(h,{duration:1e3*c,easing:a,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{428:428,442:442}],416:[function(t,e,n){"use strict";function r(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,a.bindHandlers(this)}var i=t(428),o=t(1051),a=t(442);e.exports=r;var s=a.bezier(0,0,.25,1);r.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new o(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var n=this._pos,r=i.mousePos(this._el,t),o=this._center,a=n.sub(o).angleWith(r.sub(o))/Math.PI*180,s=e.getBearing()-a,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=r}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,n=e.getBearing(),r=this._inertia,i=function(){Math.abs(n)180&&(d=180);var p=d/180;u+=h*d*(p/2),Math.abs(e._normalizeBearing(u,0))1;var n=t.ctrlKey?1:2,r=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===n:t.button!==r},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{1051:1051,428:428,442:442}],417:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=r;r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,n={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),n);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),n);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},n):(t.preventDefault(),e.panBy([-80,0],n));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},n):(t.preventDefault(),e.panBy([80,0],n));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},n):(t.preventDefault(),e.panBy([0,-80],n));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},n):(t.preventDefault(),e.panBy([0,80],n))}}}}},{}],418:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t(428),o=t(426),a=t(442);e.exports=r;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),u=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var n=o.now(),r=n-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=n,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var n=this._map,r=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==r&&(r=1/r);var i=n.ease?n.ease.to:n.transform.scale,o=n.transform.scaleZoom(i*r);n.zoomTo(o,{duration:0,around:n.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{426:426,428:428,442:442}],419:[function(t,e,n){"use strict";function r(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t(428),o=t(442);e.exports=r;var a=o.bezier(0,0,.15,1);r.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),n=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(n),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),n=i.mousePos(this._el,t.touches[1]),r=e.add(n).div(2),o=e.sub(n),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(r)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*a)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,r]),l.easeTo(u,{originalEvent:t})}else{var c=Math.abs(1-a)>.15;Math.abs(s)>4?this._gestureIntent="rotate":c&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,n=this._map;if(e.length<2)n.snapToNorth({},{originalEvent:t});else{var r=e[e.length-1],i=e[0],o=n.transform.scaleZoom(this._startScale*r[1]),s=n.transform.scaleZoom(this._startScale*i[1]),l=o-s,u=(r[0]-i[0])/1e3,c=r[2];if(0!==u&&o!==s){var h=.15*l/u;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=o+h*f/2e3;d<0&&(d=0),n.easeTo({zoom:d,duration:f,easing:a,around:n.unproject(c)},{originalEvent:t})}else n.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{428:428,442:442}],420:[function(t,e,n){"use strict";function r(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=r;var i=t(442);r.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)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),n=this._map.getBearing(),r=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(r)+"/"+t.lng.toFixed(r)+(n?"/"+Math.round(10*n)/10:"");window.history.replaceState("","",i)}}},{442:442}],421:[function(t,e,n){"use strict";function r(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t(427),o=t(442),a=t(426),s=t(426).window,l=t(434),u=t(428),c=t(378),h=t(375),f=t(355),d=t(341),p=t(420),m=t(407),v=t(408),g=t(339),y=t(340),x=t(1051),b=t(409),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(a.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=o.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),o.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new b(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};o.extend(w.prototype,l),o.extend(w.prototype,v.prototype),o.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var n=this._classes.indexOf(t);return n<0||""===t?this:(this._classes.splice(n,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var n={},r=0;r=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(g.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof x||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof x||"number"==typeof t[0])e=[x.convert(t)];else{var n=[x.convert(t[0]),x.convert(t[1])];e=[n[0],new x(n[1].x,n[0].y),n[1],new x(n[0].x,n[1].y),n[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof c?t:new c(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,n){return this.style.addSourceType(t,e,n)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,n){return this.style.setLayerZoomRange(t,e,n),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,n,r){return this.style.setPaintProperty(t,e,n,r),this._update(!0),this},getPaintProperty:function(t,e,n){return this.style.getPaintProperty(t,e,n)},setLayoutProperty:function(t,e,n){return this.style.setLayoutProperty(t,e,n),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=u.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var n=this._controlContainer=u.create("div","mapboxgl-control-container",t),r=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){r[t]=u.create("div","mapboxgl-ctrl-"+t,n)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new f(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&a.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),a.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),r(this._canvasContainer),r(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=a.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,o.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,o.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,o.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,o.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),o.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{1051:1051,339:339,340:340,341:341,355:355,375:375,378:378,407:407,408:408,409:409,420:420,426:426,427:427,428:428,434:434,442:442}],422:[function(t,e,n){"use strict";function r(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=a.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=r;var i=t(428),o=t(339),a=t(1051);r.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=o.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{1051:1051,339:339,428:428}],423:[function(t,e,n){"use strict";function r(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=r;var i=t(442),o=t(434),a=t(428),s=t(339);r.prototype=i.inherit(o,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,n=document.createDocumentFragment(),r=document.createElement("body");for(r.innerHTML=t;;){if(!(e=r.firstChild))break;n.appendChild(e)}return this.setDOMContent(n)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=a.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var n=this._container.offsetWidth,r=this._container.offsetHeight;e=t.ythis._map.transform.height-r?["bottom"]:[],t.xthis._map.transform.width-n/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={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%)"},o=this._container.classList;for(var s in i)o.remove("mapboxgl-popup-anchor-"+s);o.add("mapboxgl-popup-anchor-"+e),a.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{339:339,428:428,434:434,442:442}],424:[function(t,e,n){"use strict";function r(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)}e.exports=r,r.prototype.receive=function(t){function e(t,e,n){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},n)}var n,r=t.data,i=r.id;if(""===r.type)n=this.callbacks[r.id],delete this.callbacks[r.id],n&&n(r.error||null,r.data);else if(void 0!==r.id&&this.parent[r.type])this.parent[r.type](r.data,e.bind(this));else if(void 0!==r.id&&this.parent.workerSources){var o=r.type.split(".");this.parent.workerSources[o[0]][o[1]](r.data,e.bind(this))}else this.parent[r.type](r.data)},r.prototype.send=function(t,e,n,r){var i=null;n&&(this.callbacks[i=this.callbackID++]=n),this.postMessage({type:t,id:String(i),data:e},r)},r.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],425:[function(t,e,n){"use strict";function r(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}n.getJSON=function(t,e){var n=new XMLHttpRequest;return n.open("GET",t,!0),n.setRequestHeader("Accept","application/json"),n.onerror=function(t){e(t)},n.onload=function(){if(n.status>=200&&n.status<300&&n.response){var t;try{t=JSON.parse(n.response)}catch(t){return e(t)}e(null,t)}else e(new Error(n.statusText))},n.send(),n},n.getArrayBuffer=function(t,e){var n=new XMLHttpRequest;return n.open("GET",t,!0),n.responseType="arraybuffer",n.onerror=function(t){e(t)},n.onload=function(){n.status>=200&&n.status<300&&n.response?e(null,n.response):e(new Error(n.statusText))},n.send(),n},n.getImage=function(t,e){return n.getArrayBuffer(t,function(t,n){if(t)return e(t);var r=new Image;r.onload=function(){e(null,r),(window.URL||window.webkitURL).revokeObjectURL(r.src)};var i=new Blob([new Uint8Array(n)],{type:"image/png"});return r.src=(window.URL||window.webkitURL).createObjectURL(i),r.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=r.width,t.height=r.height,e.drawImage(r,0,0),e.getImageData(0,0,r.width,r.height).data},r})},n.getVideo=function(t,e){var n=document.createElement("video");n.onloadstart=function(){e(null,n)};for(var i=0;i=s+r?t.call(i,1):(t.call(i,(l-s)/r),n.frame(o)))}if(!r)return t.call(i,1),null;var a=!1,s=e.exports.now();return n.frame(o),function(){a=!0}},n.supported=t(327),n.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(n,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),n.supportsWebp=!1;var o=document.createElement("img");o.onload=function(){n.supportsWebp=!0},o.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",n.supportsGeolocation=!!navigator.geolocation},{327:327}],427:[function(t,e,n){"use strict";function r(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t(442),o=t(327);e.exports=r,r.prototype.resize=function(t,e){var n=window.devicePixelRatio||1;this.canvas.width=n*t,this.canvas.height=n*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},r.prototype.getWebGLContext=function(t){return t=i.extend({},t,o.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},r.prototype.getElement=function(){return this.canvas}},{327:327,442:442}],428:[function(t,e,n){"use strict";function r(t){for(var e=0;e1)for(var h=0;h=0&&this._events[t].splice(n,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var n=function(r){this.off(t,n),e.call(this,r)}.bind(this);return this.on(t,n),this},fire:function(t,e){if(!this.listens(t))return r.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=r.extend({},e),r.extend(e,{type:t,target:this});for(var n=this._events[t].slice(),i=0;i1){if(i(t,e))return!0;for(var r=0;r(e.y-t.y)*(n.x-t.x)}function a(t,e,n,r){return o(t,n,r)!==o(e,n,r)&&o(t,e,n)!==o(t,e,r)}function s(t,e,n){var r=n*n;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(n):t.distSqr(n.sub(e)._mult(i)._add(e))}function u(t,e){for(var n,r,i,o=!1,a=0;ae.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function c(t,e){for(var n=!1,r=0,i=t.length-1;re.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,n){for(var r=0;r=3)for(var l=0;lthis.max){var n=this.get(this.order[0]);n&&this.onRemove(n)}return this},r.prototype.has=function(t){return t in this.data},r.prototype.keys=function(){return this.order},r.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},r.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],439:[function(t,e,n){"use strict";function r(t,e,n){if(!(n=n||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===n[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=n}return t}function i(t){return t?"?"+t:""}function o(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:a.ACCESS_TOKEN}):t}var a=t(431),s=t(426),l=t(1277),u=t(442);e.exports.normalizeStyleURL=function(t,e){var n=l.parse(t);return"mapbox:"!==n.protocol?t:r("mapbox:/"+n.pathname+i(n.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==l.parse(t).protocol?t:r(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var n=l.parse(t);return"mapbox:"!==n.protocol?t:r("mapbox://"+n.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(n.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,n,o){var a=l.parse(t);return"mapbox:"!==a.protocol?(a.pathname+=e+n,l.format(a)):r("mapbox:/"+a.pathname+"/sprite"+e+n+i(a.query),"/styles/v1/",o)},e.exports.normalizeTileURL=function(t,e,n){var r=l.parse(t,!0);if(!e)return t;if("mapbox:"!==l.parse(e).protocol)return t;var i=s.supportsWebp?".webp":"$1",a=s.devicePixelRatio>=2||512===n?"@2x":"";return l.format({protocol:r.protocol,hostname:r.hostname,pathname:r.pathname.replace(/(\.(?:png|jpg)\d*)/,a+i),query:o(r.query)})}},{1277:1277,426:426,431:431,442:442}],440:[function(t,e,n){"use strict";function r(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function o(t){return p[t].BYTES_PER_ELEMENT}function a(t){return t.toLowerCase()}function s(t,e){for(var n=[],r=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",s=0;sthis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},f.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},n.bezier=function(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}},n.ease=n.bezier(.25,.1,.25,1),n.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},n.wrap=function(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i},n.coalesce=function(){for(var t=0;t=0)return!0;return!1};var a={};n.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)}},{1276:1276,338:338}],443:[function(t,e,n){"use strict";function r(t,e,n,r){this._vectorTileFeature=t,t._z=e,t._x=n,t._y=r,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=r,r.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],444:[function(t,e,n){e.exports={_from:"mapbox-gl@^0.22.0",_id:"mapbox-gl@0.22.1",_inBundle:!1,_integrity:"sha1-kqllVH1MLyTCLLxIfu2khpTLYno=",_location:"/mapbox-gl",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"mapbox-gl@^0.22.0",name:"mapbox-gl",escapedName:"mapbox-gl",rawSpec:"^0.22.0",saveSpec:null,fetchSpec:"^0.22.0"},_requiredBy:["/plotly.js"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_spec:"mapbox-gl@^0.22.0",_where:"/Users/rreusser/plotly/react-plotly.js/node_modules/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},bundleDependencies:!1,dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},deprecated:!1,description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},engines:{node:">=4.0.0"},homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",name:"mapbox-gl",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],445:[function(t,e,n){"use strict";function r(t,e,n){for(var r=new Array(t),i=0;iv[1][2]&&(x[0]=-x[0]),v[0][2]>v[2][0]&&(x[1]=-x[1]),v[1][0]>v[0][1]&&(x[2]=-x[2]),!0}},{174:174,175:175,176:176,180:180,190:190,262:262,263:263,264:264,266:266,447:447}],447:[function(t,e,n){e.exports=function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}},{}],448:[function(t,e,n){function r(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var o=t(265),a=t(449),s=t(446),l=t(176),u=t(1062),c=r(),h=r(),f=r();e.exports=function(t,e,n,r){if(0===l(e)||0===l(n))return!1;var i=s(e,c.translate,c.scale,c.skew,c.perspective,c.quaternion),d=s(n,h.translate,h.scale,h.skew,h.perspective,h.quaternion);return!(!i||!d||(o(f.translate,c.translate,h.translate,r),o(f.skew,c.skew,h.skew,r),o(f.scale,c.scale,h.scale,r),o(f.perspective,c.perspective,h.perspective,r),u(f.quaternion,c.quaternion,h.quaternion,r),a(t,f.translate,f.scale,f.skew,f.perspective,f.quaternion),0))}},{1062:1062,176:176,265:265,446:446,449:449}],449:[function(t,e,n){var r={identity:t(179),translate:t(189),multiply:t(182),create:t(175),scale:t(188),fromRotationTranslation:t(178)},i=(r.create(),r.create());e.exports=function(t,e,n,o,a,s){return r.identity(t),r.fromRotationTranslation(t,s,e),t[3]=a[0],t[7]=a[1],t[11]=a[2],t[15]=a[3],r.identity(i),0!==o[2]&&(i[9]=o[2],r.multiply(t,t,i)),0!==o[1]&&(i[9]=0,i[8]=o[1],r.multiply(t,t,i)),0!==o[0]&&(i[8]=0,i[4]=o[0],r.multiply(t,t,i)),r.scale(t,t,n),t}},{175:175,178:178,179:179,182:182,188:188,189:189}],450:[function(t,e,n){"use strict";function r(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var i=t(39),o=t(448),a=t(180),s=t(185),l=t(186),u=t(187),c=t(181),h=t(189),f=(t(188),t(266)),d=[0,0,0];e.exports=function(t){return new r((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=r.prototype;p.recalcMatrix=function(t){var e=this._time,n=i.le(e,t),r=this.computedMatrix;if(!(n<0)){var s=this._components;if(n===e.length-1)for(var l=16*n,u=0;u<16;++u)r[u]=s[l++];else{for(var c=e[n+1]-e[n],l=16*n,h=this.prevMatrix,d=!0,u=0;u<16;++u)h[u]=s[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=s[l++],d=d&&h[u]===p[u];if(c<1e-6||d)for(u=0;u<16;++u)r[u]=h[u];else o(r,h,p,(t-e[n])/c)}var m=this.computedUp;m[0]=r[1],m[1]=r[5],m[2]=r[9],f(m,m);var v=this.computedInverse;a(v,r);var g=this.computedEye,y=v[15];g[0]=v[12]/y,g[1]=v[13]/y,g[2]=v[14]/y;for(var x=this.computedCenter,b=Math.exp(this.computedRadius[0]),u=0;u<3;++u)x[u]=g[u]-r[2+4*u]*b}},p.idle=function(t){if(!(t1&&r(t[a[c-2]],t[a[c-1]],u)<=0;)c-=1,a.pop();for(a.push(l),c=s.length;c>1&&r(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var n=new Array(s.length+a.length-2),h=0,i=0,f=a.length;i0;--d)n[h++]=s[d];return n};var r=t(1240)[3]},{1240:1240}],452:[function(t,e,n){"use strict";e.exports=function(t,e){function n(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==v.alt,v.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==v.shift,v.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==v.control,v.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==v.meta,v.meta=!!t.metaKey),e}function i(t,i){var o=r.x(i),a=r.y(i);"buttons"in i&&(t=0|i.buttons),(t!==d||o!==p||a!==m||n(i))&&(d=0|t,p=o||0,m=a||0,e&&e(d,p,m,v))}function o(t){i(0,t)}function a(){(d||p||m||v.shift||v.alt||v.meta||v.control)&&(p=m=0,d=0,v.shift=v.alt=v.control=v.meta=!1,e&&e(0,0,0,v))}function s(t){n(t)&&e&&e(d,p,m,v)}function l(t){0===r.buttons(t)?i(0,t):i(d,t)}function u(t){i(d|r.buttons(t),t)}function c(t){i(d&~r.buttons(t),t)}function h(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",o),t.addEventListener("mouseenter",o),t.addEventListener("mouseout",o),t.addEventListener("mouseover",o),t.addEventListener("blur",a),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",a),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function f(){g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",u),t.removeEventListener("mouseup",c),t.removeEventListener("mouseleave",o),t.removeEventListener("mouseenter",o),t.removeEventListener("mouseout",o),t.removeEventListener("mouseover",o),t.removeEventListener("blur",a),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",a),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,m=0,v={shift:!1,alt:!1,control:!1,meta:!1},g=!1;h();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return g},set:function(t){t?h():f()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),y};var r=t(454)},{454:454}],453:[function(t,e,n){function r(t){return t===window||t===document||t===document.body?i:t.getBoundingClientRect()}var i={left:0,top:0};e.exports=function(t,e,n){e=e||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i=t.clientX||0,o=t.clientY||0,a=r(e);return n[0]=i-a.left,n[1]=o-a.top,n}},{}],454:[function(t,e,n){"use strict";function r(t){return t.target||t.srcElement||window}n.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<=0;--n)C(n,0);for(var e=[],n=0;n0;k=k-1&m)b.push(_+"["+T+"+"+v(k)+"]");b.push(g(0));for(k=0;k0){",f(S[t]),"=1;"),D(t-1,e|1<0&&q.push(s(U,S[G-1])+"*"+a(S[G-1])),F.push(d(U,S[G])+"=("+q.join("-")+")|0")}for(U=0;U=0;--U)W.push(a(S[U]));F.push(k+"=("+W.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",T+"=0"),F.push(p(0)+"=0");for(var G=1;G<1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var o=t.getters||[],a=new Array(r),s=0;s=0?a[s]=!0:a[s]=!1;return x(t.vertex,t.cell,t.phase,i,n,a)};var _="V",w="P",M="N",k="Q",T="X",A="T"},{1273:1273}],457:[function(t,e,n){"use strict";var r=t(89)({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return r(t,e),t}},{89:89}],458:[function(t,e,n){"use strict";function r(t){if(t in s)return s[t];for(var e=[],n=0;n=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),o.push("1"),a.push("s["+l+"]-2"));var u=".lo("+o.join()+").hi("+a.join()+")";if(0===o.length&&(u=""),r>0){for(i.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||i.push("&&s[",l,"]>2");for(i.push("){grad",r,"(src.pick(",s.join(),")",u),l=0;l=0||e.indexOf(-(l+1))>=0||i.push(",dst.pick(",s.join(),",",l,")",u);i.push(");")}for(l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):i.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?i.push("dst.set(",s.join(),",",c,",0);"):i.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?i.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):i.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&i.push("};")}(d)}}i.push("return dst;};return gradient");for(var p=["diff","zero"],m=[c,h],o=1;o<=n;++o)p.push("grad"+o),m.push(r(o));p.push(i.join(""));var v=Function.apply(void 0,p).apply(void 0,m);return s[e]=v,v}e.exports=function(t,e,n){if(Array.isArray(n)){if(n.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else n="string"==typeof n?o(e.dimension,n):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var r=0;r>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];n[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),n[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),n[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),n[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];n[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),n[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];n[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),n[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),n[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),n[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),n.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),n.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),n.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),n.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),n.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),n.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),n.equals=a({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{86:86}],462:[function(t,e,n){"use strict";var r=t(467),i=t(463);e.exports=function(t,e){for(var n=[],o=t,a=1;Array.isArray(o);)n.push(o.length),a*=o.length,o=o[0];return 0===n.length?r():(e||(e=r(new Float64Array(a),n)),i(e,t),e)}},{463:463,467:467}],463:[function(t,e,n){e.exports=t(86)({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{86:86}],464:[function(t,e,n){"use strict";function r(t){switch(t){case"uint8":return[s.mallocUint8,s.freeUint8];case"uint16":return[s.mallocUint16,s.freeUint16];case"uint32":return[s.mallocUint32,s.freeUint32];case"int8":return[s.mallocInt8,s.freeInt8];case"int16":return[s.mallocInt16,s.freeInt16];case"int32":return[s.mallocInt32,s.freeInt32];case"float32":return[s.mallocFloat,s.freeFloat];case"float64":return[s.mallocDouble,s.freeDouble];default:return null}}function i(t){for(var e=[],n=0;n1){for(var h=[],f=1;f1){a.push("dptr=0;sptr=ptr");for(f=t.length-1;f>=0;--f)0!==(d=t[f])&&a.push(["for(i",d,"=0;i",d,"b){break __l}"].join(""));for(f=t.length-1;f>=1;--f)a.push("sptr+=e"+f,"dptr+=f"+f,"}");a.push("dptr=cptr;sptr=cptr-s0");for(f=t.length-1;f>=0;--f)0!==(d=t[f])&&a.push(["for(i",d,"=0;i",d,"=0;--f)0!==(d=t[f])&&a.push(["for(i",d,"=0;i",d,"scratch)){",o("cptr",n("cptr-s0")),"cptr-=s0","}",o("cptr","scratch"));if(a.push("}"),t.length>1&&u&&a.push("free(scratch)"),a.push("} return "+s),u)return(p=new Function("malloc","free",a.join("\n")))(u[0],u[1]);var p=new Function(a.join("\n"));return p()}function a(t,e,n){function o(t){return["(offset+",t,"*s0)"].join("")}function a(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,n){return"generic"===e?["data.set(",t,",",n,")"].join(""):["data[",t,"]=",n].join("")}function u(e,n,r){if(1===e.length)_.push("ptr0="+o(e[0]));else for(i=0;i=0;--i)0!==(a=t[i])&&_.push(["for(i",a,"=0;i",a,"1)for(i=0;i1?_.push("ptr_shift+=d"+a):_.push("ptr0+=d"+a),_.push("}"))}}function c(e,n,r,i){if(1===n.length)_.push("ptr0="+o(n[0]));else{for(a=0;a1)for(a=0;a=1;--a)r&&_.push("pivot_ptr+=f"+a),n.length>1?_.push("ptr_shift+=e"+a):_.push("ptr0+=e"+a),_.push("}")}function h(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function f(e,n){var r="el"+e,i="el"+n;if(t.length>1){var s="__l"+ ++T;c(s,[r,i],!1,["comp=",a("ptr0"),"-",a("ptr1"),"\n","if(comp>0){tmp0=",r,";",r,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",a(o(r)),">",a(o(i)),"){tmp0=",r,";",r,"=",i,";",i,"=tmp0}"].join(""))}function d(e,n){t.length>1?u([e,n],!1,s("ptr0",a("ptr1"))):_.push(s(o(e),a(o(n))))}function p(e,n,r){if(t.length>1){var i="__l"+ ++T;c(i,[n],!0,[e,"=",a("ptr0"),"-pivot",r,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",a(o(n)),"-pivot",r].join(""))}function m(e,n){t.length>1?u([e,n],!1,["tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",o(e),"\n","ptr1=",o(n),"\n","tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1","tmp")].join(""))}function v(e,n,r){t.length>1?(u([e,n,r],!1,["tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1",a("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+n,"--"+r)):_.push(["ptr0=",o(e),"\n","ptr1=",o(n),"\n","ptr2=",o(r),"\n","++",n,"\n","--",r,"\n","tmp=",a("ptr0"),"\n",s("ptr0",a("ptr1")),"\n",s("ptr1",a("ptr2")),"\n",s("ptr2","tmp")].join(""))}function g(t,e){m(t,e),_.push("--"+e)}function y(e,n,r){t.length>1?u([e,n],!0,[s("ptr0",a("ptr1")),"\n",s("ptr1",["pivot",r,"[pivot_ptr]"].join(""))].join("")):_.push(s(o(e),a(o(n))),s(o(n),"pivot"+r))}function x(e,n){_.push(["if((",n,"-",e,")<=",l,"){\n","insertionSort(",e,",",n,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",n,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function b(e,n,r){t.length>1?(_.push(["__l",++T,":while(true){"].join("")),u([e],!0,["if(",a("ptr0"),"!==pivot",n,"[pivot_ptr]){break __l",T,"}"].join("")),_.push(r,"}")):_.push(["while(",a(o(e)),"===pivot",n,"){",r,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=r(e),T=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var A=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?u(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",a("ptr1"),"\n","pivot2[pivot_ptr]=",a("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",a("ptr0"),"\n","y=",a("ptr2"),"\n","z=",a("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",a(o("el2")),"\n","pivot2=",a(o("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",a(o("el1")),"\n","y=",a(o("el3")),"\n","z=",a(o("el5")),"\n",s(o("index1"),"x"),"\n",s(o("index3"),"y"),"\n",s(o("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),v("k","less","great"),_.push("break"),_.push("}else{"),g("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),b("less",1,"++less"),b("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k)return(C=new Function("insertionSort","malloc","free",_.join("\n")))(n,k[0],k[1]);var C=new Function("insertionSort",_.join("\n"));return C(n)}var s=t(1273),l=32;e.exports=function(t,e){var n=["'use strict'"],r=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];n.push(["function ",r,"(",s.join(","),"){"].join(""));for(var u=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c0?u.push(["d",m,"=s",m,"-d",d,"*n",d].join("")):u.push(["d",m,"=s",m].join("")),d=m);var v=t.length-1-c;0!==v&&(p>0?u.push(["e",v,"=s",v,"-e",p,"*n",p,",f",v,"=",h[v],"-f",p,"*n",p].join("")):u.push(["e",v,"=s",v,",f",v,"=",h[v]].join("")),p=v)}n.push("var "+u.join(","));var g=["0","n0-1","data","offset"].concat(i(t.length));n.push(["if(n0<=",l,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),n.push("}return "+r);var y=new Function("insertionSort","quickSort",n.join("\n")),x=o(t,e);return y(x,a(t,e,x))}},{1273:1273}],465:[function(t,e,n){"use strict";var r=t(464),i={};e.exports=function(t){var e=t.order,n=t.dtype,o=[e,n].join(":"),a=i[o];return a||(i[o]=a=r(e,n)),a(t),t}},{464:464}],466:[function(t,e,n){"use strict";var r=t(460),i=t(89)({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_3_arg4_)}",args:[{name:"_inline_3_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_4_arg2_(this_warped,_inline_4_arg0_),_inline_4_arg1_=_inline_4_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),o=t(89)({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_(_inline_7_arg4_,this_warped[0])}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),a=t(89)({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t(89)({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,n){switch(e.shape.length){case 1:o(t,n,r.d1,e);break;case 2:a(t,n,r.d2,e);break;case 3:s(t,n,r.d3,e);break;default:i(t,n,r.bind(void 0,e),e.shape.length)}return t}},{460:460,89:89}],467:[function(t,e,n){function r(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,n=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+n+"_set("+l.join(",")+",v){"),r?o.push("return this.data.set("+u+",v)}"):o.push("return this.data["+u+"]=v}"),o.push("proto.get=function "+n+"_get("+l.join(",")+"){"),r?o.push("return this.data.get("+u+")}"):o.push("return this.data["+u+"]}"),o.push("proto.index=function "+n+"_index(",l.join(),"){return "+u+"}"),o.push("proto.hi=function "+n+"_hi("+l.join(",")+"){return new "+n+"(this.data,"+a.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+a.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=a.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=a.map(function(t){return"c"+t+"=this.stride["+t+"]"});o.push("proto.lo=function "+n+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");o.push("return new "+n+"(this.data,"+a.map(function(t){return"a"+t}).join(",")+","+a.map(function(t){return"c"+t}).join(",")+",b)}"),o.push("proto.step=function "+n+"_step("+l.join(",")+"){var "+a.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+a.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+a.map(function(t){return"shape["+t+"]"}).join(",")+","+a.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var y=new Function("CTOR_LIST","ORDER",o.join("\n"));return y(c[t],i)}function a(t){if(l(t))return"buffer";if(u)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}var s=t(284),l=t(286),u="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,n,r){if(void 0===t)return(f=c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===n){n=new Array(i);for(var s=i-1,l=1;s>=0;--s)n[s]=l,l*=e[s]}if(void 0===r)for(r=0,s=0;s>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var n=r.hi(t),a=r.lo(t);return e>t==t>0?a===o?(n+=1,a=0):a+=1:0===a?(a=o,n-=1):a-=1,r.pack(a,n)}},{100:100}],469:[function(t,e,n){n.vertexNormals=function(t,e,n){for(var r=e.length,i=new Array(r),o=void 0===n?1e-6:n,a=0;ao)for(var b=i[u],_=1/Math.sqrt(v*y),x=0;x<3;++x){var w=(x+1)%3,M=(x+2)%3;b[x]+=_*(g[w]*m[M]-g[M]*m[w])}}for(a=0;ao)for(var _=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},n.faceNormals=function(t,e,n){for(var r=t.length,i=new Array(r),o=void 0===n?1e-6:n,a=0;ao?1/Math.sqrt(d):0;for(u=0;u<3;++u)f[u]*=d;i[a]=f}return i}},{}],470:[function(t,e,n){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,s,l=r(t),u=1;uM&&(M=f[1]),T[n]=f}for(o=0,u=0,l=0,n=0;nk&&(k=p);return{center:[c,h],bounds:[w,b,M,_+1],radius:Math.sqrt(k)}}function a(t,e){var n=0,r=t.length,i=0;for(e||(e=4);!t[i]&&in;)i-=e;return r=i,[n/e,r/e]}function s(t,e){return t*t+e*e}e.exports=r;var l=document.createElement("canvas"),u=l.getContext("2d");l.width=200,l.height=200,r.canvas=l},{}],472:[function(t,e,n){"use strict";e.exports=function(t,e,n,r,i,o,a,s,l,u){var c=e+o+u;if(f>0)f=Math.sqrt(c+1),t[0]=.5*(a-l)/f,t[1]=.5*(s-r)/f,t[2]=.5*(n-o)/f,t[3]=.5*f;else{var h=Math.max(e,o,u),f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+n)/f,t[2]=.5*(s+r)/f,t[3]=.5*(a-l)/f):o>=h?(t[0]=.5*(n+i)/f,t[1]=.5*f,t[2]=.5*(l+a)/f,t[3]=.5*(s-r)/f):(t[0]=.5*(r+s)/f,t[1]=.5*(a+l)/f,t[2]=.5*f,t[3]=.5*(n-i)/f)}return t}},{}],473:[function(t,e,n){"use strict";function r(t,e,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(n,2))}function i(t,e,n,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(n,2)+Math.pow(r,2))}function o(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],s=i(n,r,o,a);s>1e-6?(t[0]=n/s,t[1]=r/s,t[2]=o/s,t[3]=a/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function a(t,e,n){this.radius=s([n]),this.center=s(e),this.rotation=s(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],n=t.rotation||[0,0,0,1],r=t.radius||1;e=[].slice.call(e,0,3),o(n=[].slice.call(n,0,4),n);var i=new a(n,e,Math.log(r));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var s=t(132),l=t(181),u=t(177),c=t(180),h=t(472),f=a.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;o(e,e);var n=this.computedMatrix;u(n,e);var r=this.computedCenter,i=this.computedEye,a=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=r[0]+s*n[2],i[1]=r[1]+s*n[6],i[2]=r[2]+s*n[10],a[0]=n[1],a[1]=n[5],a[2]=n[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=n[l+4*h]*i[h];n[12+l]=-c}},f.getMatrix=function(t,e){this.recalcMatrix(t);var n=this.computedMatrix;if(e){for(var r=0;r<16;++r)e[r]=n[r];return e}return n},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,n,i){e=e||0,n=n||0,i=i||0,this.recalcMatrix(t);var o=this.computedMatrix,a=o[1],s=o[5],l=o[9],u=r(a,s,l);a/=u,s/=u,l/=u;var c=o[0],h=o[4],f=o[8],d=c*a+h*s+f*l,p=r(c-=a*d,h-=s*d,f-=l*d);c/=p,h/=p,f/=p;var m=o[2],v=o[6],g=o[10],y=m*a+v*s+g*l,x=m*c+v*h+g*f,b=r(m-=y*a+x*c,v-=y*s+x*h,g-=y*l+x*f);m/=b,v/=b,g/=b;var _=c*e+a*n,w=h*e+s*n,M=f*e+l*n;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},f.rotate=function(t,e,n,o){this.recalcMatrix(t),e=e||0,n=n||0;var a=this.computedMatrix,s=a[0],l=a[4],u=a[8],c=a[1],h=a[5],f=a[9],d=a[2],p=a[6],m=a[10],v=e*s+n*c,g=e*l+n*h,y=e*u+n*f,x=-(p*y-m*g),b=-(m*v-d*y),_=-(d*g-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=i(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var k=this.computedRotation,T=k[0],A=k[1],S=k[2],E=k[3],C=T*w+E*x+A*_-S*b,L=A*w+E*b+S*x-T*_,P=S*w+E*_+T*b-A*x,I=E*w-T*x-A*b-S*_;if(o){x=d,b=p,_=m;var O=Math.sin(o)/r(x,b,_);x*=O,b*=O,_*=O,I=I*(w=Math.cos(e))-(C=C*w+I*x+L*_-P*b)*x-(L=L*w+I*b+P*x-C*_)*b-(P=P*w+I*_+C*b-L*x)*_}var D=i(C,L,P,I);D>1e-6?(C/=D,L/=D,P/=D,I/=D):(C=L=P=0,I=1),this.rotation.set(t,C,L,P,I)},f.lookAt=function(t,e,n,r){this.recalcMatrix(t),n=n||this.computedCenter,e=e||this.computedEye,r=r||this.computedUp;var i=this.computedMatrix;l(i,e,n,r);var a=this.computedRotation;h(a,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),o(a,a),this.rotation.set(t,a[0],a[1],a[2],a[3]);for(var s=0,u=0;u<3;++u)s+=Math.pow(n[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,n[0],n[1],n[2])},f.translate=function(t,e,n,r){this.center.move(t,e||0,n||0,r||0)},f.setMatrix=function(t,e){var n=this.computedRotation;h(n,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),o(n,n),this.rotation.set(t,n[0],n[1],n[2],n[3]);var r=this.computedMatrix;c(r,e);var i=r[15];if(Math.abs(i)>1e-6){var a=r[12]/i,s=r[13]/i,l=r[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,a-r[2]*u,s-r[6]*u,l-r[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},f.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},f.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},f.fromJSON=function(t){var e=this.lastT(),n=t.center;n&&this.center.set(e,n[0],n[1],n[2]);var r=t.rotation;r&&this.rotation.set(e,r[0],r[1],r[2],r[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{132:132,177:177,180:180,181:181,472:472}],474:[function(t,e,n){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var n=parseFloat(t,10);return e[0]=n,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],475:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),o="/"===a(t,-1);return(t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),s=a,l=0;l55295&&e<57344){if(!n){e>56319||o+1===r?i.push(239,191,189):n=e;continue}if(e<56320){i.push(239,191,189),n=e;continue}e=n-55296<<10|e-56320|65536,n=null}else n&&(i.push(239,191,189),n=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?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}e.exports=r;var o,a,s,l=t(279);(o={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 l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,n){var r="",i="";e=e||0,n=Math.min(this.length,n||this.length);for(var o=e;o=1;){if(e.pos>=n)throw new Error("Given varint doesn't fit into 10 bytes");var r=255&t;e.buf[e.pos++]=r|(t>=128?128:0),t/=128}}function a(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function s(t,e){for(var n=0;n>3,o=this.pos;t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,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)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);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,e,n=this.buf;return e=n[this.pos++],t=127&e,e<128?t:(e=n[this.pos++],t|=(127&e)<<7,e<128?t:(e=n[this.pos++],t|=(127&e)<<14,e<128?t:(e=n[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===r.Bytes)this.pos=this.readVarint()+this.pos;else if(e===r.Fixed32)this.pos+=4;else{if(e!==r.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?o(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=v.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},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 e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n=128&&a(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,r.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,r.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,r.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,r.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,r.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{476:476}],478:[function(t,e,n){"use strict";e.exports=function(t){var e=t.length;if(e0;--a)o=l[a],n=s[a],s[a]=s[o],s[o]=n,l[a]=l[n],l[n]=o,u=(u+n)*a;return r.freeUint32(l),r.freeUint32(s),u},n.unrank=function(t,e,n){switch(t){case 0:return n||[];case 1:return n?(n[0]=0,n):[0];case 2:return n?(e?(n[0]=0,n[1]=1):(n[0]=1,n[1]=0),n):e?[0,1]:[1,0]}var r,i,o,a=1;for((n=n||new Array(t))[0]=0,o=1;o0;--o)e=e-(r=e/a|0)*a|0,a=a/o|0,i=0|n[o],n[o]=0|n[r],n[r]=0|i;return n}},{1273:1273,283:283}],480:[function(t,e,n){"use strict";e.exports=function(t,e){function n(t,e){var n=s[e][t[e]];n.splice(n.indexOf(t),1)}function i(t,i,o){for(var a,l,u,c=0;c<2;++c)if(s[c][i].length>0){a=s[c][i][0],u=c;break}l=a[1^u];for(var h=0;h<2;++h)for(var f=s[h][i],d=0;d0&&(a=p,l=m,u=h)}return o?l:(a&&n(a,u),l)}for(var o=0|e.length,a=t.length,s=[new Array(o),new Array(o)],l=0;l0;){s[0][l].length;var d=function(t,o){var a=s[o][t][0],l=[t];n(a,o);for(var u=a[1^o];;){for(;u!==t;)l.push(u),u=i(l[l.length-2],u,!1);if(s[0][t].length+s[1][t].length===0)break;var c=l[l.length-1],h=t,f=l[1],d=i(c,h,!0);if(r(e[c],e[h],e[f],e[d])<0)break;l.push(t),u=i(c,h)}return l}(l,h);!function(t,e){return e[1]===e[e.length-1]}(0,d)?(f.length>0&&c.push(f),f=d):f.push.apply(f,d)}f.length>0&&c.push(f)}return c};var r=t(75)},{75:75}],481:[function(t,e,n){"use strict";e.exports=function(t,e){for(var n=r(t,e.length),i=new Array(e.length),o=new Array(e.length),a=[],s=0;s0;){i[d=a.pop()]=!1;for(var u=n[d],s=0;s0})).length,g=new Array(v),y=new Array(v),p=0;p0;){var F=j.pop(),B=C[F];c(B,function(t,e){return t-e});var U,V=B.length,H=N[F];for(0===H&&(U=[W=m[F]]),p=0;p=0)&&(N[q]=1^H,j.push(q),0===H)){var W=m[q];n(W)||(W.reverse(),U.push(W))}}0===H&&R.push(U)}return R};var o=t(103),a=t(480),s=t(1052),l=t(1271),u=t(1245),c=t(1275),h=t(481)},{103:103,1052:1052,1245:1245,1271:1271,1275:1275,480:480,481:481}],483:[function(t,e,n){"use strict";var r=t(661),i={"X,X div":"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var o in i){var a=o.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");r.addStyleRule(a,i[o])}},{661:661}],484:[function(t,e,n){"use strict";e.exports={undo:{width:857.1,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",ascent:850,descent:-150},home:{width:928.6,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",ascent:850,descent:-150},"camera-retro":{width:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",ascent:850,descent:-150},zoombox:{width:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",ascent:850,descent:-150},pan:{width:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",ascent:850,descent:-150},zoom_plus:{width:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",ascent:850,descent:-150},plotlylogo:{width:1542,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",ascent:850,descent:-150},"z-axis":{width:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",ascent:850,descent:-150},"3d_rotate":{width:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",ascent:850,descent:-150},camera:{width:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",ascent:850,descent:-150},movie:{width:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",ascent:850,descent:-150},question:{width:857.1,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",ascent:850,descent:-150},disk:{width:857.1,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",ascent:850,descent:-150},lasso:{width:1031,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",ascent:850,descent:-150},selectbox:{width:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",ascent:850,descent:-150},spikeline:{width:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",ascent:850,descent:-150}}},{}],485:[function(t,e,n){"use strict";e.exports=t(1047)},{1047:1047}],486:[function(t,e,n){"use strict";e.exports=t(793)},{793:793}],487:[function(t,e,n){"use strict";e.exports=t(806)},{806:806}],488:[function(t,e,n){"use strict";e.exports=t(535)},{535:535}],489:[function(t,e,n){"use strict";e.exports=t(814)},{814:814}],490:[function(t,e,n){"use strict";e.exports=t(835)},{835:835}],491:[function(t,e,n){"use strict";e.exports=t(850)},{850:850}],492:[function(t,e,n){"use strict";e.exports=t(862)},{862:862}],493:[function(t,e,n){"use strict";e.exports=t(877)},{877:877}],494:[function(t,e,n){"use strict";e.exports=t(643)},{643:643}],495:[function(t,e,n){"use strict";e.exports=t(1048)},{1048:1048}],496:[function(t,e,n){"use strict";e.exports=t(1049)},{1049:1049}],497:[function(t,e,n){"use strict";e.exports=t(890)},{890:890}],498:[function(t,e,n){"use strict";e.exports=t(899)},{899:899}],499:[function(t,e,n){"use strict";e.exports=t(907)},{907:907}],500:[function(t,e,n){"use strict";e.exports=t(912)},{912:912}],501:[function(t,e,n){"use strict";e.exports=t(916)},{916:916}],502:[function(t,e,n){"use strict";var r=t(494);r.register([t(486),t(487),t(497),t(499),t(500),t(501),t(506),t(492),t(514),t(508),t(509),t(516),t(503),t(511),t(491),t(512),t(507),t(498),t(505),t(517),t(513),t(490),t(510),t(493),t(504),t(489)]),r.register([t(485),t(495),t(496),t(515)]),r.register([t(488)]),e.exports=r},{485:485,486:486,487:487,488:488,489:489,490:490,491:491,492:492,493:493,494:494,495:495,496:496,497:497,498:498,499:499,500:500,501:501,503:503,504:504,505:505,506:506,507:507,508:508,509:509,510:510,511:511,512:512,513:513,514:514,515:515,516:516,517:517}],503:[function(t,e,n){"use strict";e.exports=t(922)},{922:922}],504:[function(t,e,n){"use strict";e.exports=t(927)},{927:927}],505:[function(t,e,n){"use strict";e.exports=t(936)},{936:936}],506:[function(t,e,n){"use strict";e.exports=t(945)},{945:945}],507:[function(t,e,n){"use strict";e.exports=t(954)},{954:954}],508:[function(t,e,n){"use strict";e.exports=t(960)},{960:960}],509:[function(t,e,n){"use strict";e.exports=t(993)},{993:993}],510:[function(t,e,n){"use strict";e.exports=t(998)},{998:998}],511:[function(t,e,n){"use strict";e.exports=t(1007)},{1007:1007}],512:[function(t,e,n){"use strict";e.exports=t(1014)},{1014:1014}],513:[function(t,e,n){"use strict";e.exports=t(1021)},{1021:1021}],514:[function(t,e,n){"use strict";e.exports=t(1028)},{1028:1028}],515:[function(t,e,n){"use strict";e.exports=t(1050)},{1050:1050}],516:[function(t,e,n){"use strict";e.exports=t(1037)},{1037:1037}],517:[function(t,e,n){"use strict";e.exports=t(1045)},{1045:1045}],518:[function(t,e,n){"use strict";var r=t(661),i=t(705),o=t(523),a=t(520);e.exports=function(t,e,n,s,l){function u(n,i){return r.coerce(t,e,a,n,i)}s=s||{};var c=u("visible",!(l=l||{}).itemIsNotPlainObject),h=u("clicktoshow");if(!c&&!h)return e;o(t,e,n,u);for(var f=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:n},v=0;v<2;v++){var g=d[v],y=i.coerceRef(t,e,m,g,"","paper");if(i.coercePosition(e,m,u,y,g,.5),f){var x="a"+g,b=i.coerceRef(t,e,m,x,"pixel");"pixel"!==b&&b!==y&&(b=e[x]="pixel");var _="pixel"===b?p[v]:.4;i.coercePosition(e,m,u,b,x,_)}u(g+"anchor"),u(g+"shift")}if(r.noneOrAll(t,e,["x","y"]),f&&r.noneOrAll(t,e,["ax","ay"]),h){var w=u("xclick"),M=u("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{520:520,523:523,661:661,705:705}],519:[function(t,e,n){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],520:[function(t,e,n){"use strict";var r=t(519),i=t(729),o=t(710);e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",role:"info",dflt:!0,editType:"calcIfAutorange",description:["Determines whether or not this annotation is visible."].join(" ")},text:{valType:"string",role:"info",editType:"calcIfAutorange",description:["Sets the text associated with this annotation.","Plotly uses a subset of HTML tags to do things like","newline (
), bold (), italics (),","hyperlinks (). Tags , , "," are also supported."].join(" ")},textangle:{valType:"angle",dflt:0,role:"style",editType:"calcIfAutorange",description:["Sets the angle at which the `text` is drawn","with respect to the horizontal."].join(" ")},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw",description:"Sets the annotation text font."}),width:{valType:"number",min:1,dflt:null,role:"style",editType:"calcIfAutorange",description:["Sets an explicit width for the text box. null (default) lets the","text set the box width. Wider text will be clipped.","There is no automatic wrapping; use
to start a new line."].join(" ")},height:{valType:"number",min:1,dflt:null,role:"style",editType:"calcIfAutorange",description:["Sets an explicit height for the text box. null (default) lets the","text set the box height. Taller text will be clipped."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,role:"style",editType:"arraydraw",description:"Sets the opacity of the annotation (text + arrow)."},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",role:"style",editType:"arraydraw",description:["Sets the horizontal alignment of the `text` within the box.","Has an effect only if `text` spans more two or more lines","(i.e. `text` contains one or more
HTML tags) or if an","explicit width is set to override the text width."].join(" ")},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",role:"style",editType:"arraydraw",description:["Sets the vertical alignment of the `text` within the box.","Has an effect only if an explicit height is set to override","the text height."].join(" ")},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",role:"style",editType:"arraydraw",description:"Sets the background color of the annotation."},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",role:"style",editType:"arraydraw",description:["Sets the color of the border enclosing the annotation `text`."].join(" ")},borderpad:{valType:"number",min:0,dflt:1,role:"style",editType:"calcIfAutorange",description:["Sets the padding (in px) between the `text`","and the enclosing border."].join(" ")},borderwidth:{valType:"number",min:0,dflt:1,role:"style",editType:"calcIfAutorange",description:["Sets the width (in px) of the border enclosing","the annotation `text`."].join(" ")},showarrow:{valType:"boolean",dflt:!0,role:"style",editType:"calcIfAutorange",description:["Determines whether or not the annotation is drawn with an arrow.","If *true*, `text` is placed near the arrow's tail.","If *false*, `text` lines up with the `x` and `y` provided."].join(" ")},arrowcolor:{valType:"color",role:"style",editType:"arraydraw",description:"Sets the color of the annotation arrow."},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,role:"style",editType:"arraydraw",description:"Sets the annotation arrow head style."},arrowsize:{valType:"number",min:.3,dflt:1,role:"style",editType:"calcIfAutorange",description:["Sets the size of the annotation arrow head, relative to `arrowwidth`.","A value of 1 (default) gives a head about 3x as wide as the line."].join(" ")},arrowwidth:{valType:"number",min:.1,role:"style",editType:"calcIfAutorange",description:"Sets the width (in px) of annotation arrow line."},standoff:{valType:"number",min:0,dflt:0,role:"style",editType:"calcIfAutorange",description:["Sets a distance, in pixels, to move the arrowhead away from the","position it is pointing at, for example to point at the edge of","a marker independent of zoom. Note that this shortens the arrow","from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`","which moves everything by this amount."].join(" ")},ax:{valType:"any",role:"info",editType:"calcIfAutorange",description:["Sets the x component of the arrow tail about the arrow head.","If `axref` is `pixel`, a positive (negative) ","component corresponds to an arrow pointing","from right to left (left to right).","If `axref` is an axis, this is an absolute value on that axis,","like `x`, NOT a relative value."].join(" ")},ay:{valType:"any",role:"info",editType:"calcIfAutorange",description:["Sets the y component of the arrow tail about the arrow head.","If `ayref` is `pixel`, a positive (negative) ","component corresponds to an arrow pointing","from bottom to top (top to bottom).","If `ayref` is an axis, this is an absolute value on that axis,","like `y`, NOT a relative value."].join(" ")},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()],role:"info",editType:"calc",description:["Indicates in what terms the tail of the annotation (ax,ay) ","is specified. If `pixel`, `ax` is a relative offset in pixels ","from `x`. If set to an x axis id (e.g. *x* or *x2*), `ax` is ","specified in the same terms as that axis. This is useful ","for trendline annotations which should continue to indicate ","the correct trend when zoomed."].join(" ")},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()],role:"info",editType:"calc",description:["Indicates in what terms the tail of the annotation (ax,ay) ","is specified. If `pixel`, `ay` is a relative offset in pixels ","from `y`. If set to a y axis id (e.g. *y* or *y2*), `ay` is ","specified in the same terms as that axis. This is useful ","for trendline annotations which should continue to indicate ","the correct trend when zoomed."].join(" ")},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()],role:"info",editType:"calc",description:["Sets the annotation's x coordinate axis.","If set to an x axis id (e.g. *x* or *x2*), the `x` position","refers to an x coordinate","If set to *paper*, the `x` position refers to the distance from","the left side of the plotting area in normalized coordinates","where 0 (1) corresponds to the left (right) side."].join(" ")},x:{valType:"any",role:"info",editType:"calcIfAutorange",description:["Sets the annotation's x position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",role:"info",editType:"calcIfAutorange",description:["Sets the text box's horizontal position anchor","This anchor binds the `x` position to the *left*, *center*","or *right* of the annotation.","For example, if `x` is set to 1, `xref` to *paper* and","`xanchor` to *right* then the right-most portion of the","annotation lines up with the right-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *center* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},xshift:{valType:"number",dflt:0,role:"style",editType:"calcIfAutorange",description:["Shifts the position of the whole annotation and arrow to the","right (positive) or left (negative) by this many pixels."].join(" ")},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()],role:"info",editType:"calc",description:["Sets the annotation's y coordinate axis.","If set to an y axis id (e.g. *y* or *y2*), the `y` position","refers to an y coordinate","If set to *paper*, the `y` position refers to the distance from","the bottom of the plotting area in normalized coordinates","where 0 (1) corresponds to the bottom (top)."].join(" ")},y:{valType:"any",role:"info",editType:"calcIfAutorange",description:["Sets the annotation's y position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",role:"info",editType:"calcIfAutorange",description:["Sets the text box's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the annotation.","For example, if `y` is set to 1, `yref` to *paper* and","`yanchor` to *top* then the top-most portion of the","annotation lines up with the top-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *middle* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},yshift:{valType:"number",dflt:0,role:"style",editType:"calcIfAutorange",description:["Shifts the position of the whole annotation and arrow up","(positive) or down (negative) by this many pixels."].join(" ")},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,role:"style",editType:"arraydraw",description:["Makes this annotation respond to clicks on the plot.","If you click a data point that exactly matches the `x` and `y`","values of this annotation, and it is hidden (visible: false),","it will appear. In *onoff* mode, you must click the same point","again to make it disappear, so if you click multiple points,","you can show multiple annotations. In *onout* mode, a click","anywhere else in the plot (on another data point or not) will","hide this annotation.","If you need to show/hide this annotation in response to different","`x` or `y` values, you can set `xclick` and/or `yclick`. This is","useful for example to label the side of a bar. To label markers","though, `standoff` is preferred over `xclick` and `yclick`."].join(" ")},xclick:{valType:"any",role:"info",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `x` value","is `xclick` rather than the annotation's `x` value."].join(" ")},yclick:{valType:"any",role:"info",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `y` value","is `yclick` rather than the annotation's `y` value."].join(" ")},hovertext:{valType:"string",role:"info",editType:"arraydraw",description:["Sets text to appear when hovering over this annotation.","If omitted or blank, no hover label will appear."].join(" ")},hoverlabel:{bgcolor:{valType:"color",role:"style",editType:"arraydraw",description:["Sets the background color of the hover label.","By default uses the annotation's `bgcolor` made opaque,","or white if it was transparent."].join(" ")},bordercolor:{valType:"color",role:"style",editType:"arraydraw",description:["Sets the border color of the hover label.","By default uses either dark grey or white, for maximum","contrast with `hoverlabel.bgcolor`."].join(" ")},font:i({editType:"arraydraw",description:["Sets the hover label text font.","By default uses the global hover font and size,","with color from `hoverlabel.bordercolor`."].join(" ")}),editType:"arraydraw"},captureevents:{valType:"boolean",role:"info",editType:"arraydraw",description:["Determines whether the annotation text box captures mouse move","and click events, or allows those events to pass through to data","points in the plot that may be behind the annotation. By default","`captureevents` is *false* unless `hovertext` is provided.","If you use the event `plotly_clickannotation` without `hovertext`","you must explicitly enable `captureevents`."].join(" ")},editType:"calc",_deprecated:{ref:{valType:"string",role:"info",editType:"calc",description:["Obsolete. Set `xref` and `yref` separately instead."].join(" ")}}}},{519:519,710:710,729:729}],521:[function(t,e,n){"use strict";function r(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var n,r,i=o.getFromId(t,e.xref),a=o.getFromId(t,e.yref),s=3*e.arrowsize*e.arrowwidth||0;i&&i.autorange&&(n=s+e.xshift,r=s-e.xshift,e.axref===e.xref?(o.expand(i,[i.r2c(e.x)],{ppadplus:n,ppadminus:r}),o.expand(i,[i.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):o.expand(i,[i.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,n),ppadminus:Math.max(e._xpadminus,r)})),a&&a.autorange&&(n=s-e.yshift,r=s+e.yshift,e.ayref===e.yref?(o.expand(a,[a.r2c(e.y)],{ppadplus:n,ppadminus:r}),o.expand(a,[a.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):o.expand(a,[a.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,n),ppadminus:Math.max(e._ypadminus,r)}))})}var i=t(661),o=t(705),a=t(526).draw;e.exports=function(t){var e=t._fullLayout,n=i.filterVisible(e.annotations);if(n.length&&t._fullData.length){var s={};if(n.forEach(function(t){s[t.xref]=!0,s[t.yref]=!0}),o.list(t).filter(function(t){return t.autorange&&s[t._id]}).length)return i.syncOrAsync([a,r],t)}}},{526:526,661:661,705:705}],522:[function(t,e,n){"use strict";function r(t,e){var n,r,o,a,s,l,u,c=t._fullLayout.annotations,h=[],f=[],d=[],p=(e||[]).length;for(n=0;n0||n.explicitOff.length>0},onClick:function(t,e){var n,i=r(t,e),a=i.on,s=i.off.concat(i.explicitOff),l={};if(a.length||s.length){for(n=0;n2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var o=R.selectAll("a");1===o.size()&&o.text()===R.text()&&L.insert("a",":first-child").attr({"xlink:xlink:href":o.attr("xlink:href"),"xlink:xlink:show":o.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(D.node());var u=L.select(".annotation-text-math-group"),f=!u.empty(),g=h.bBox((f?u:R).node()),y=g.width,C=g.height,I=e.width||y,N=e.height||C,F=Math.round(I+2*O),B=Math.round(N+2*O);e._w=I,e._h=N;for(var U=!1,V=["x","y"],H=0;H1)&&(J===K?((at=$.r2fraction(e["a"+Z]))<0||at>1)&&(U=!0):U=!0,U))continue;q=$._offset+$.r2p(e[Z]),Y=.5}else"x"===Z?(G=e[Z],q=_.l+_.w*G):(G=1-e[Z],q=_.t+_.h*G),Y=e.showarrow?.5:G;if(e.showarrow){ot.head=q;var st=e["a"+Z];X=tt*n(.5,e.xanchor)-et*n(.5,e.yanchor),J===K?(ot.tail=$._offset+$.r2p(st),W=X):(ot.tail=q+st,W=X+st),ot.text=ot.tail+X;var lt=b["x"===Z?"width":"height"];if("paper"===K&&(ot.head=l.constrain(ot.head,1,lt-1)),"pixel"===J){var ut=-Math.max(ot.tail-3,ot.text),ct=Math.min(ot.tail+3,ot.text)-lt;ut>0?(ot.tail+=ut,ot.text+=ut):ct>0&&(ot.tail-=ct,ot.text-=ct)}ot.tail+=it,ot.head+=it}else W=X=nt*n(Y,rt),ot.text=q+X;ot.text+=it,X+=it,W+=it,e["_"+Z+"padplus"]=nt/2+W,e["_"+Z+"padminus"]=nt/2-W,e["_"+Z+"size"]=nt,e["_"+Z+"shift"]=X}if(U)L.remove();else{var ht=0,ft=0;if("left"!==e.align&&(ht=(I-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ft=(N-C)*("middle"===e.valign?.5:1)),f)u.select("svg").attr({x:O+ht-1,y:O+ft}).call(h.setClipUrl,z?M:null);else{var dt=O+ft-g.top,pt=O+ht-g.left;R.call(d.positionText,pt,dt).call(h.setClipUrl,z?M:null)}j.select("rect").call(h.setRect,O,O,I,N),D.call(h.setRect,P/2,P/2,F-P,B-P),L.call(h.setTranslate,Math.round(k.x.text-F/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+T+","+k.x.text+","+k.y.text+")"});var mt=function(n,o){A.selectAll(".annotation-arrow-g").remove();var u=k.x.head,f=k.y.head,d=k.x.tail+n,p=k.y.tail+o,g=k.x.text+n,y=k.y.text+o,b=l.rotationXYMatrix(T,g,y),M=l.apply2DTransform(b),E=l.apply2DTransform2(b),C=+D.attr("width"),P=+D.attr("height"),I=g-.5*C,O=I+C,z=y-.5*P,j=z+P,N=[[I,z,I,j],[I,j,O,j],[O,j,O,z],[O,z,I,z]].map(E);if(!N.reduce(function(t,e){return t^!!l.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){N.forEach(function(t){var e=l.segmentsIntersect(d,p,u,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var R=e.arrowwidth,F=e.arrowcolor,B=A.append("g").style({opacity:c.opacity(F)}).classed("annotation-arrow-g",!0),U=B.append("path").attr("d","M"+d+","+p+"L"+u+","+f).style("stroke-width",R+"px").call(c.stroke,c.rgb(F));if(v(U,"end",e),w.annotationPosition&&U.node().parentNode&&!r){var V=u,H=f;if(e.standoff){var q=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-p,2));V+=e.standoff*(d-u)/q,H+=e.standoff*(p-f)/q}var W,G,Y,X=B.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(p-H),transform:"translate("+V+","+H+")"}).style("stroke-width",R+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");m.init({element:X.node(),gd:t,prepFn:function(){var t=h.getTranslate(L);G=t.x,Y=t.y,W={},i&&i.autorange&&(W[i._name+".autorange"]=!0),s&&s.autorange&&(W[s._name+".autorange"]=!0)},moveFn:function(t,n){var r=M(G,Y),o=r[0]+t,a=r[1]+n;L.call(h.setTranslate,o,a),W[x+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,W[x+".y"]=s?s.p2r(s.r2p(e.y)+n):e.y-n/_.h,e.axref===e.xref&&(W[x+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(W[x+".ay"]=s.p2r(s.r2p(e.ay)+n)),B.attr("transform","translate("+t+","+n+")"),S.attr({transform:"rotate("+T+","+o+","+a+")"})},doneFn:function(e){if(e){a.relayout(t,W);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}};if(e.showarrow&&mt(0,0),E){var vt,gt;m.init({element:L.node(),gd:t,prepFn:function(){gt=S.attr("transform"),vt={}},moveFn:function(t,n){var o="pointer";if(e.showarrow)e.axref===e.xref?vt[x+".ax"]=i.p2r(i.r2p(e.ax)+t):vt[x+".ax"]=e.ax+t,e.ayref===e.yref?vt[x+".ay"]=s.p2r(s.r2p(e.ay)+n):vt[x+".ay"]=e.ay+n,mt(t,n);else{if(r)return;if(i)vt[x+".x"]=e.x+t/i._m;else{var a=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-a/2;vt[x+".x"]=m.align(l+t/_.w,a,0,1,e.xanchor)}if(s)vt[x+".y"]=e.y+n/s._m;else{var u=e._ysize/_.h,c=e.y-(e._yshift+e.yshift)/_.h-u/2;vt[x+".y"]=m.align(c-n/_.h,u,0,1,e.yanchor)}i&&s||(o=m.getCursor(i?.5:vt[x+".x"],s?.5:vt[x+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+n+")"+gt}),p(L,o)},doneFn:function(e){if(p(L),e){a.relayout(t,vt);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}}var y,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;r?(y="annotation-"+r,x=r+".annotations["+n+"]"):(y="annotation",x="annotations["+n+"]"),b._infolayer.selectAll("."+y+'[data-index="'+n+'"]').remove();var M="clip"+b._uid+"_ann"+n;if(e._input&&!1!==e.visible){var k={x:{},y:{}},T=+e.textangle||0,A=b._infolayer.append("g").classed(y,!0).attr("data-index",String(n)).style("opacity",e.opacity),S=A.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],C=e.captureevents||w.annotationText||E,L=S.append("g").style("pointer-events",C?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:n,annotation:e._input,fullAnnotation:e,event:o.event};r&&(i.subplotId=r),t.emit("plotly_clickannotation",i)});e.hovertext&&L.on("mouseover",function(){var n=e.hoverlabel,r=n.font,i=this.getBoundingClientRect(),o=t.getBoundingClientRect();f.loneHover({x0:i.left-o.left,x1:i.right-o.left,y:(i.top+i.bottom)/2-o.top,text:e.hovertext,color:n.bgcolor,borderColor:n.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){f.loneUnhover(b._hoverlayer.node())});var P=e.borderwidth,I=e.borderpad,O=P+I,D=L.append("rect").attr("class","bg").style("stroke-width",P+"px").call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor),z=e.width||e.height,j=b._topclips.selectAll("#"+M).data(z?[0]:[]);j.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),j.exit().remove();var N=e.font,R=L.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?R.call(d.makeEditable,{delegate:L,gd:t}).call(u).on("edit",function(n){e.text=n,this.call(u);var r={};r[x+".text"]=e.text,i&&i.autorange&&(r[i._name+".autorange"]=!0),s&&s.autorange&&(r[s._name+".autorange"]=!0),a.relayout(t,r)}):R.call(u)}else o.selectAll("#"+M).remove()}var o=t(98),a=t(700),s=t(764),l=t(661),u=t(705),c=t(537),h=t(561),f=t(578),d=t(683),p=t(679),m=t(558),v=t(527);e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var n=0;n=0,v=e.indexOf("end")>=0,g=d.backoff*p+n.standoff;if("line"===f.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var y=l.x-u.x,x=l.y-u.y;if(c=Math.atan2(x,y),h=c+Math.PI,g){if(g*g>y*y+x*x)return void a();var b=g*Math.cos(c),_=g*Math.sin(c);m&&(l.x-=b,l.y-=_,t.attr({x1:l.x,y1:l.y})),v&&(u.x+=b,u.y+=_,t.attr({x2:u.x,y2:u.y}))}}else if("path"===f.nodeName){var w=f.getTotalLength(),M="";if(w1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l.pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*n[0],e.yaxis.r2l(l.y)*n[1],e.zaxis.r2l(l.z)*n[2]]),r(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{526:526,753:753}],533:[function(t,e,n){"use strict";e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t(529)}}},layoutAttributes:t(529),handleDefaults:t(531),convert:t(530),draw:t(532)}},{529:529,530:530,531:531,532:532}],534:[function(t,e,n){"use strict";e.exports=t(1313),t(1314),t(1299),t(1300),t(1301),t(1302),t(1303),t(1304),t(1305),t(1306),t(1307),t(1308),t(1309),t(1310),t(1311),t(1312)},{1299:1299,1300:1300,1301:1301,1302:1302,1303:1303,1304:1304,1305:1305,1306:1306,1307:1307,1308:1308,1309:1309,1310:1310,1311:1311,1312:1312,1313:1313,1314:1314}],535:[function(t,e,n){"use strict";function r(t){var e=y[t];return e||(e=y[t]=a.instance(t))}function i(t){return s.extendFlat({},h,{description:t})}function o(t){return"Sets the calendar system to use with `"+t+"` date data."}var a=t(534),s=t(661),l=t(640),u=l.EPOCHJD,c=l.ONEDAY,h={valType:"enumerated",values:Object.keys(a.calendars),role:"info",editType:"calc",dflt:"gregorian"},f=function(t,e,n,r){var i={};return i[n]=h,s.coerce(t,e,i,n,r)},d={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},p={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},m={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},v="##",g={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:v,w:v,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},y={},x={xcalendar:i(o("x"))},b=s.extendFlat({},x,{ycalendar:i(o("y"))}),_=s.extendFlat({},b,{zcalendar:i(o("z"))}),w=i(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:b,bar:b,box:b,heatmap:b,contour:b,histogram:b,histogram2d:b,histogram2dcontour:b,scatter3d:_,surface:_,mesh3d:_,scattergl:b,ohlc:x,candlestick:x},layout:{calendar:i(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:w},yaxis:{calendar:w},scene:{xaxis:{calendar:w},yaxis:{calendar:w},zaxis:{calendar:w}}},transforms:{filter:{valuecalendar:i(["Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:i(["Sets the calendar system to use for `target`, if it is an","array of dates. If `target` is a string (eg *x*) we use the","corresponding trace attribute (eg `xcalendar`) if it exists,","even if `targetcalendar` is provided."].join(" "))}}},layoutAttributes:h,handleDefaults:f,handleTraceDefaults:function(t,e,n,r){for(var i=0;i=0))return t;if(3===a)r[a]>1&&(r[a]=1);else if(r[a]>=1)return t}var s=Math.round(255*r[0])+", "+Math.round(255*r[1])+", "+Math.round(255*r[2]);return i?"rgba("+s+", "+r[3]+")":"rgb("+s+")"}var i=t(1266),o=t(107),a=e.exports={},s=t(536);a.defaults=s.defaults;var l=a.defaultLine=s.defaultLine;a.lightLine=s.lightLine;var u=a.background=s.background;a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(i(t))},a.opacity=function(t){return t?i(t).getAlpha():0},a.addOpacity=function(t,e){var n=i(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},a.combine=function(t,e){var n=i(t).toRgb();if(1===n.a)return i(t).toRgbString();var r=i(e||u).toRgb(),o=1===r.a?r:{r:255*(1-r.a)+r.r*r.a,g:255*(1-r.a)+r.g*r.a,b:255*(1-r.a)+r.b*r.a},a={r:o.r*(1-n.a)+n.r*n.a,g:o.g*(1-n.a)+n.g*n.a,b:o.b*(1-n.a)+n.b*n.a};return i(a).toRgbString()},a.contrast=function(t,e,n){var r=i(t);return 1!==r.getAlpha()&&(r=i(a.combine(t,u))),(r.isDark()?e?r.lighten(e):u:n?r.darken(n):l).toString()},a.stroke=function(t,e){var n=i(e);t.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(t,e){var n=i(e);t.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,n,i,o,s=Object.keys(t);for(e=0;e0?S>=D:S<=D));E++)S>j&&S0?S>=D:S<=D));E++)S>C[0]&&S1){var ot=Math.pow(10,Math.floor(Math.log(it)/Math.LN10));nt*=ot*c.roundUp(it/ot,[2,5,10]),(Math.abs(M.levels.start)/M.levels.size+1e-6)%1<2e-6&&(tt.tick0=0)}tt.dtick=nt}tt.domain=[K+Y,K+q-Y],tt.setScale();var at=T._infolayer.selectAll("g."+e).data([0]);at.enter().append("g").classed(e,!0).each(function(){var t=r.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),at.attr("transform","translate("+Math.round(A.l)+","+Math.round(A.t)+")");var st=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(A.l)+",-"+Math.round(A.t)+")");tt._axislayer=at.select(".cbaxis");var lt=0;if(-1!==["top","bottom"].indexOf(M.titleside)){var ut,ct=A.l+(M.x+W)*A.w,ht=tt.titlefont.size;ut="top"===M.titleside?(1-(K+q-Y))*A.h+A.t+3+.75*ht:(1-(K+Y))*A.h+A.t-3-.25*ht,k(tt._id+"title",{attributes:{x:ct,y:ut,"text-anchor":"start"}})}var ft=c.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M.titleside)){var e=at.select(".cbtitle"),n=e.select("text"),o=[-M.outlinewidth/2,M.outlinewidth/2],a=e.select(".h"+tt._id+"title-math-group").node(),s=15.6;if(n.node()&&(s=parseInt(n.node().style.fontSize,10)*g),a?(lt=d.bBox(a).height)>s&&(o[1]-=(lt-s)/2):n.node()&&!n.classed("js-placeholder")&&(lt=d.bBox(n.node()).height),lt){if(lt+=5,"top"===M.titleside)tt.domain[1]-=lt/A.h,o[1]*=-1;else{tt.domain[0]+=lt/A.h;var u=v.lineCount(n);o[1]+=(1-u)*s}e.attr("transform","translate("+o+")"),tt.setScale()}}at.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(A.h*(1-tt.domain[1]))+")");var h=at.select(".cbfills").selectAll("rect.cbfill").data(P);h.enter().append("rect").classed("cbfill",!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var n=[0===e?C[0]:(P[e]+P[e-1])/2,e===P.length-1?C[1]:(P[e]+P[e+1])/2].map(tt.c2p).map(Math.round);e!==P.length-1&&(n[1]+=n[1]>n[0]?1:-1);var o=O(t).replace("e-",""),a=i(o).toHexString();r.select(this).attr({x:X,width:Math.max(U,2),y:r.min(n),height:Math.max(r.max(n)-r.min(n),2),fill:a})});var f=at.select(".cblines").selectAll("path.cbline").data(M.line.color&&M.line.width?L:[]);return f.enter().append("path").classed("cbline",!0),f.exit().remove(),f.each(function(t){r.select(this).attr("d","M"+X+","+(Math.round(tt.c2p(t))+M.line.width/2%1)+"h"+U).call(d.lineGroupStyle,M.line.width,I(t),M.line.dash)}),tt._axislayer.selectAll("g."+tt._id+"tick,path").remove(),tt._pos=X+U+(M.outlinewidth||0)/2-("outside"===M.ticks?1:0),tt.side="right",c.syncOrAsync([function(){return l.doTicks(t,tt,!0)},function(){if(-1===["top","bottom"].indexOf(M.titleside)){var e=tt.titlefont.size,n=tt._offset+tt._length/2,i=A.l+(tt.position||0)*A.w+("right"===tt.side?10+e*(tt.showticklabels?1:.5):-10-e*(tt.showticklabels?.5:0));k("h"+tt._id+"title",{avoid:{selection:r.select(t).selectAll("g."+tt._id+"tick"),side:M.titleside,offsetLeft:A.l,offsetTop:A.t,maxShift:T.width},attributes:{x:i,y:n,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},a.previousPromises,function(){var n=U+M.outlinewidth/2+d.bBox(tt._axislayer.node()).width;if((R=st.select("text")).node()&&!R.classed("js-placeholder")){var r,i=st.select(".h"+tt._id+"title-math-group").node();r=i&&-1!==["top","bottom"].indexOf(M.titleside)?d.bBox(i).width:d.bBox(st.node()).right-X-A.l,n=Math.max(n,r)}var o=2*M.xpad+n+M.borderwidth+M.outlinewidth/2,s=J-$;at.select(".cbbg").attr({x:X-M.xpad-(M.borderwidth+M.outlinewidth)/2,y:$-G,width:Math.max(o,2),height:Math.max(s+2*G,2)}).call(p.fill,M.bgcolor).call(p.stroke,M.bordercolor).style({"stroke-width":M.borderwidth}),at.selectAll(".cboutline").attr({x:X,y:$+M.ypad+("top"===M.titleside?lt:0),width:Math.max(U,2),height:Math.max(s-2*M.ypad-lt,2)}).call(p.stroke,M.outlinecolor).style({fill:"None","stroke-width":M.outlinewidth});var l=({center:.5,right:1}[M.xanchor]||0)*o;at.attr("transform","translate("+(A.l-l)+","+A.t+")"),a.autoMargin(t,e,{x:M.x,y:M.y,l:o*({right:1,center:.5}[M.xanchor]||0),r:o*({left:1,center:.5}[M.xanchor]||0),t:s*({bottom:1,middle:.5}[M.yanchor]||0),b:s*({top:1,middle:.5}[M.yanchor]||0)})}],t);if(ft&&ft.then&&(t._promises||[]).push(ft),t._context.edits.colorbarPosition){var dt,pt,mt;u.init({element:at.node(),gd:t,prepFn:function(){dt=at.attr("transform"),f(at)},moveFn:function(t,e){at.attr("transform",dt+" translate("+t+","+e+")"),pt=u.align(Z+t/A.w,V,0,1,M.xanchor),mt=u.align(K-e/A.h,q,0,1,M.yanchor);var n=u.getCursor(pt,mt,M.xanchor,M.yanchor);f(at,n)},doneFn:function(e){f(at),e&&void 0!==pt&&void 0!==mt&&o.restyle(t,{"colorbar.x":pt,"colorbar.y":mt},w().index)}})}return ft}T._infolayer.selectAll("g."+e).remove()}}function w(){var n,r,i=e.substr(2);for(n=0;n=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=o(m)),s.colorscale=m)}},{548:548,555:555,661:661}],544:[function(t,e,n){"use strict";var r=t(542),i=t(650).extendFlat,o=t(555);e.exports=function(t,e,n){var a=t?t+".":"";return{color:{valType:"color",arrayOk:!0,role:"style",editType:e||"style",description:["Sets the",t,"color. It accepts either a specific color","or an array of numbers that are mapped to the colorscale","relative to the max and min values of the array or relative to","`cmin` and `cmax` if set."].join(" ")},colorscale:i({},r.colorscale,{description:["Sets the colorscale and only has an effect","if `"+a+"color` is set to a numerical array.","The colorscale must be an array containing","arrays mapping a normalized value to an","rgb, rgba, hex, hsl, hsv, or named color string.","At minimum, a mapping for the lowest (0) and highest (1)","values are required. For example,","`[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`.","To control the bounds of the colorscale in color space,","use `"+a+"cmin` and `"+a+"cmax`.","Alternatively, `colorscale` may be a palette name string","of the following list:",Object.keys(o).join(", ")].join(" ")}),cauto:i({},r.zauto,{impliedEdits:{cmin:void 0,cmax:void 0},description:["Has an effect only if `"+a+"color` is set to a numerical array","and `cmin`, `cmax` are set by the user. In this case,","it controls whether the range of colors in `colorscale` is mapped to","the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax`","values (`cauto: false`).","Defaults to `false` when `cmin`, `cmax` are set by the user."].join(" ")}),cmax:i({},r.zmax,{editType:e||r.zmax.editType,impliedEdits:{cauto:!1},description:["Has an effect only if `"+a+"color` is set to a numerical array.","Sets the upper bound of the color domain.","Value should be associated to the `"+a+"color` array index,","and if set, `"+a+"cmin` must be set as well."].join(" ")}),cmin:i({},r.zmin,{editType:e||r.zmin.editType,impliedEdits:{cauto:!1},description:["Has an effect only if `"+a+"color` is set to a numerical array.","Sets the lower bound of the color domain.","Value should be associated to the `"+a+"color` array index,","and if set, `"+a+"cmax` must be set as well."].join(" ")}),autocolorscale:i({},r.autocolorscale,{description:["Has an effect only if `"+a+"color` is set to a numerical array.","Determines whether the colorscale is a default palette (`autocolorscale: true`)","or the palette determined by `"+a+"colorscale`.","In case `colorscale` is unspecified or `autocolorscale` is true, the default ","palette will be chosen according to whether numbers in the `color` array are","all positive, all negative or mixed."].join(" "),dflt:!1===n?n:r.autocolorscale.dflt}),reversescale:i({},r.reversescale,{description:["Has an effect only if `"+a+"color` is set to a numerical array.","Reverses the color mapping if true (`cmin` will correspond to the last color","in the array and `cmax` will correspond to the first color)."].join(" ")})}}},{542:542,555:555,650:650}],545:[function(t,e,n){"use strict";var r=t(555);e.exports=r.RdBu},{555:555}],546:[function(t,e,n){"use strict";var r=t(107),i=t(661),o=t(541),a=t(539),s=t(552),l=t(548);e.exports=function(t,e,n,u,c){var h=c.prefix,f=c.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,v=p[f+"min"],g=p[f+"max"],y=p.colorscale;u(h+f+"auto",!(r(v)&&r(g)&&v=0;i--,o++)e=t[i],r[o]=[1-e[0],e[1]];return r}},{}],549:[function(t,e,n){"use strict";var r=t(555),i=t(545),o=t(553);e.exports=function(t,e){function n(){try{t=r[t]||JSON.parse(t)}catch(n){t=e}}return e||(e=i),t?("string"==typeof t&&(n(),"string"==typeof t&&n()),o(t)?t:e):e}},{545:545,553:553,555:555}],550:[function(t,e,n){"use strict";var r=t(107),i=t(661),o=t(552);e.exports=function(t,e){var n=e?i.nestedProperty(t,e).get()||{}:t,a=n.color,s=!1;if(Array.isArray(a))for(var l=0;l4/3-s?a:s}},{}],557:[function(t,e,n){"use strict";var r=t(661),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,n,o){return t="left"===n?0:"center"===n?1:"right"===n?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:r.constrain(Math.floor(3*e),0,2),i[e][t]}},{661:661}],558:[function(t,e,n){"use strict";function r(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&l.plot(t)}function o(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t(453),s=t(278),l=t(700),u=t(661),c=t(710),h=t(639),f=e.exports={};f.align=t(556),f.getCursor=t(557);var d=t(559);f.unhover=d.wrapped,f.unhoverRaw=d.raw,f.init=function(t){function e(e){if(!e.buttons||2!==e.buttons){y._dragged=!1,y._dragging=!0;var i=o(e);return l=i[0],d=i[1],g=e.target,(p=(new Date).getTime())-y._mouseDownTimeb&&(x=Math.max(x-1,1)),t.doneFn&&t.doneFn(y._dragged,x,e),!y._dragged){var r;try{r=new MouseEvent("click",e)}catch(t){var l=o(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,l[0],l[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}g.dispatchEvent(r)}return i(y),y._dragged=!1,u.pauseEvent(e)}y._dragged=!1}var l,d,p,m,v,g,y=t.gd,x=1,b=h.DBLCLICKDELAY,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=e,_.ontouchstart=e},f.coverSlip=r},{278:278,453:453,556:556,557:557,559:559,639:639,661:661,700:700,710:710}],559:[function(t,e,n){"use strict";var r=t(649),i=t(684),o=t(656),a=t(573),s=e.exports={};s.wrapped=function(t,e,n){t=o(t),i.clear(t._fullLayout._uid+a.HOVERID),s.raw(t,e,n)},s.raw=function(t,e){var n=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===r.triggerHandler(t,"plotly_beforehover",e)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{573:573,649:649,656:656,684:684}],560:[function(t,e,n){"use strict";n.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",role:"style",editType:"style",description:["Sets the dash style of lines. Set to a dash type string","(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)","or a dash length list in px (eg *5px,10px,2px,2px*)."].join(" ")}},{}],561:[function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){if(u.traceIs(n,"symbols")){var l=g(n);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:v.isBubble(n)?l(t.ms):(o.size||6)/2,t.mrc=e;var r=y.symbolNumber(t.mx||o.symbol)||0,i=r%100;return t.om=r%200>=100,y.symbolFuncs[i](e)+(r>=200?_:"")}).style("opacity",function(t){return(t.mo+1||o.opacity+1)-1})}var h,f,d,p=!1;if(t.so?(d=a.outlierwidth,f=a.outliercolor,h=o.outliercolor):(d=(t.mlw+1||a.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,f="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(a.color)?c.defaultLine:a.color,Array.isArray(o.color)&&(h=c.defaultLine,p=!0),h="mc"in t?t.mcc=r(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(c.stroke,h).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",d+"px");var m=o.gradient,x=t.mgt;if(x?p=!0:x=m&&m.type,x&&"none"!==x){var b=t.mgc;b?p=!0:b=m.color;var w="g"+s._fullLayout._uid+"-"+n.uid;p&&(w+="-"+t.i),e.call(y.gradient,s,w,x,h,b)}else e.call(c.fill,h);d&&e.call(c.stroke,f)}}function i(t,e,n,r){var i=t[0]-e[0],o=t[1]-e[1],s=n[0]-e[0],l=n[1]-e[1],u=Math.pow(i*i+o*o,T/2),c=Math.pow(s*s+l*l,T/2),h=(c*c*i-u*u*s)*r,f=(c*c*o-u*u*l)*r,d=3*c*(u+c),p=3*u*(u+c);return[[a.round(e[0]+(d&&h/d),2),a.round(e[1]+(d&&f/d),2)],[a.round(e[0]-(p&&h/p),2),a.round(e[1]-(p&&f/p),2)]]}function o(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var a=t(98),s=t(107),l=t(1266),u=t(779),c=t(537),h=t(551),f=t(661),d=t(683),p=t(642),m=t(634).LINE_SPACING,v=t(985),g=t(980),y=e.exports={};y.font=function(t,e,n,r){f.isPlainObject(e)&&(r=e.color,n=e.size,e=e.family),e&&t.style("font-family",e),n+1&&t.style("font-size",n+"px"),r&&t.call(c.fill,r)},y.setPosition=function(t,e,n){t.attr("x",e).attr("y",n)},y.setSize=function(t,e,n){t.attr("width",e).attr("height",n)},y.setRect=function(t,e,n,r,i){t.call(y.setPosition,e,n).call(y.setSize,r,i)},y.translatePoint=function(t,e,n,r){var i=n.c2p(t.x),o=r.c2p(t.y);return!!(s(i)&&s(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform","translate("+i+","+o+")"),!0)},y.translatePoints=function(t,e,n){t.each(function(t){var r=a.select(this);y.translatePoint(t,r,e,n)})},y.hideOutsideRangePoint=function(t,e,n,r){e.attr("display",n.isPtWithinRange(t)&&r.isPtWithinRange(t)?null:"none")},y.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var n=e.xaxis,r=e.yaxis;t.each(function(t){y.hideOutsideRangePoint(t,a.select(this),n,r)})}},y.crispRound=function(t,e,n){return e&&s(e)?t._context.staticPlot?e:e<1?1:Math.round(e):n||0},y.singleLineStyle=function(t,e,n,r,i){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},a=n||o.width||0,s=i||o.dash||"";c.stroke(e,r||o.color),y.dashLine(e,s,a)},y.lineGroupStyle=function(t,e,n,r){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=r||i.dash||"";a.select(this).call(c.stroke,n||i.color).call(y.dashLine,s,o)})},y.dashLine=function(t,e,n){n=+n||0,e=y.dashStyle(e,n),t.style({"stroke-dasharray":e,"stroke-width":n+"px"})},y.dashStyle=function(t,e){e=+e||1;var n=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=n+"px,"+n+"px":"dash"===t?t=3*n+"px,"+3*n+"px":"longdash"===t?t=5*n+"px,"+5*n+"px":"dashdot"===t?t=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===t&&(t=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t},y.singleFillStyle=function(t){var e=(((a.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(c.fill,e)},y.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var n=a.select(this);try{n.call(c.fill,e[0].trace.fillcolor)}catch(e){f.error(e,t),n.remove()}})};var x=t(562);y.symbolNames=[],y.symbolFuncs=[],y.symbolNeedLines={},y.symbolNoDot={},y.symbolList=[],Object.keys(x).forEach(function(t){var e=x[t];y.symbolList=y.symbolList.concat([e.n,t,e.n+100,t+"-open"]),y.symbolNames[e.n]=t,y.symbolFuncs[e.n]=e.f,e.needLine&&(y.symbolNeedLines[e.n]=!0),e.noDot?y.symbolNoDot[e.n]=!0:y.symbolList=y.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var b=y.symbolNames.length,_="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";y.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=y.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0};y.gradient=function(t,e,n,r,i,o){var s=e._fullLayout._defs.select(".gradients").selectAll("#"+n).data([r+i+o],f.identity);s.exit().remove(),s.enter().append("radial"===r?"radialGradient":"linearGradient").each(function(){var t=a.select(this);"horizontal"===r?t.attr(w):"vertical"===r&&t.attr(M),t.attr("id",n);var e=l(i),s=l(o);t.append("stop").attr({offset:"0%","stop-color":c.tinyRGB(s),"stop-opacity":s.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":c.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+n+")","fill-opacity":null})},y.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},y.singlePointStyle=function(t,e,n,i,o,a){var s=n.marker;r(t,e,n,i,o,s,s.line,a)},y.pointStyle=function(t,e,n){if(t.size()){var r=e.marker,i=y.tryColorscale(r,""),o=y.tryColorscale(r,"line");t.each(function(t){y.singlePointStyle(t,a.select(this),e,i,o,n)})}},y.tryColorscale=function(t,e){var n=e?f.nestedProperty(t,e).get():t,r=n.colorscale,i=n.color;return r&&Array.isArray(i)?h.makeColorScaleFunc(h.extractScale(r,n.cmin,n.cmax)):f.identity};var k={start:1,end:-1,middle:0,bottom:1,top:-1};y.textPointStyle=function(t,e,n){t.each(function(t){var r=a.select(this),i=f.extractOption(t,e,"tx","text");if(i){var o=t.tp||e.textposition,l=-1!==o.indexOf("top")?"top":-1!==o.indexOf("bottom")?"bottom":"middle",u=-1!==o.indexOf("left")?"end":-1!==o.indexOf("right")?"start":"middle",c=t.ts||e.textfont.size,h=t.mrc?t.mrc/.8+1:0;c=s(c)&&c>0?c:0,r.call(y.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",u).text(i).call(d.convertToTspans,n);var p=a.select(this.parentNode),v=(d.lineCount(r)-1)*m+1,g=k[u]*h,x=.75*c+k[l]*h+(k[l]-1)*v*c/2;p.attr("transform","translate("+g+","+x+")")}else r.remove()})};var T=.5;y.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var n,r="M"+t[0],o=[];for(n=1;n=1e4&&(y.savedBBoxes={},E=0),n&&(y.savedBBoxes[n]=g),E++,f.extendFlat({},g)},y.setClipUrl=function(t,e){if(e){var n="#"+e,r=a.select("base");r.size()&&r.attr("href")&&(n=window.location.href.split("#")[0]+n),t.attr("clip-path","url("+n+")")}else t.attr("clip-path",null)},y.getTranslate=function(t){var e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,n=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(e,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},y.setTranslate=function(t,e,n){var r=/(\btranslate\(.*?\);?)/,i=t.attr?"attr":"getAttribute",o=t.attr?"attr":"setAttribute",a=t[i]("transform")||"";return e=e||0,n=n||0,a=a.replace(r,"").trim(),a+=" translate("+e+", "+n+")",a=a.trim(),t[o]("transform",a),a},y.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,n=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(e,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},y.setScale=function(t,e,n){var r=/(\bscale\(.*?\);?)/,i=t.attr?"attr":"getAttribute",o=t.attr?"attr":"setAttribute",a=t[i]("transform")||"";return e=e||1,n=n||1,a=a.replace(r,"").trim(),a+=" scale("+e+", "+n+")",a=a.trim(),t[o]("transform",a),a},y.setPointGroupScale=function(t,e,n){var r,i,o;return e=e||1,n=n||1,i=1===e&&1===n?"":" scale("+e+","+n+")",o=/\s*sc.*/,t.each(function(){r=(this.getAttribute("transform")||"").replace(o,""),r=(r+=i).trim(),this.setAttribute("transform",r)}),i};var C=/translate\([^)]*\)\s*$/;y.setTextPointsScale=function(t,e,n){t.each(function(){var t,r=a.select(this),i=r.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(r.attr("transform")||"").match(C);t=1===e&&1===n?[]:["translate("+o+","+s+")","scale("+e+","+n+")","translate("+-o+","+-s+")"],l&&t.push(l),r.attr("transform",t.join(" "))}})}},{107:107,1266:1266,537:537,551:551,562:562,634:634,642:642,661:661,683:683,779:779,98:98,980:980,985:985}],562:[function(t,e,n){"use strict";var r=t(98);e.exports={circle:{n:0,f:function(t){var e=r.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=r.round(.4*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H"+e+"V"+n+"H-"+e+"V"+e+"H-"+n+"V-"+e+"H-"+e+"V-"+n+"H"+e+"V-"+e+"H"+n+"Z"}},x:{n:4,f:function(t){var e=r.round(.8*t/Math.sqrt(2),2),n="l"+e+","+e,i="l"+e+",-"+e,o="l-"+e+",-"+e,a="l-"+e+","+e;return"M0,"+e+n+i+o+i+o+a+o+a+n+a+n+"Z"}},"triangle-up":{n:5,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+e+","+r.round(t/2,2)+"H"+e+"L0,-"+r.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+r.round(t/2,2)+"H"+e+"L0,"+r.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M"+r.round(t/2,2)+",-"+e+"V"+e+"L-"+r.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+r.round(t/2,2)+",-"+e+"V"+e+"L"+r.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+n+",-"+e+"H"+e+"V"+n+"Z"}},"triangle-se":{n:10,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+e+",-"+n+"V"+e+"H-"+n+"Z"}},"triangle-sw":{n:11,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H-"+e+"V-"+n+"Z"}},"triangle-nw":{n:12,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+e+","+n+"V-"+e+"H"+n+"Z"}},pentagon:{n:13,f:function(t){var e=r.round(.951*t,2),n=r.round(.588*t,2),i=r.round(-t,2),o=r.round(-.309*t,2);return"M"+e+","+o+"L"+n+","+r.round(.809*t,2)+"H-"+n+"L-"+e+","+o+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),i=r.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+n+"V"+n+"L0,"+e+"L-"+i+","+n+"V-"+n+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),i=r.round(t*Math.sqrt(3)/2,2);return"M-"+n+","+i+"H"+n+"L"+e+",0L"+n+",-"+i+"H-"+n+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=r.round(.924*t,2),n=r.round(.383*t,2);return"M-"+n+",-"+e+"H"+n+"L"+e+",-"+n+"V"+n+"L"+n+","+e+"H-"+n+"L-"+e+","+n+"V-"+n+"Z"}},star:{n:17,f:function(t){var e=1.4*t,n=r.round(.225*e,2),i=r.round(.951*e,2),o=r.round(.363*e,2),a=r.round(.588*e,2),s=r.round(-e,2),l=r.round(-.309*e,2),u=r.round(.118*e,2),c=r.round(.809*e,2);return"M"+n+","+l+"H"+i+"L"+o+","+u+"L"+a+","+c+"L0,"+r.round(.382*e,2)+"L-"+a+","+c+"L-"+o+","+u+"L-"+i+","+l+"H-"+n+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=r.round(.66*t,2),n=r.round(.38*t,2),i=r.round(.76*t,2);return"M-"+i+",0l-"+n+",-"+e+"h"+i+"l"+n+",-"+e+"l"+n+","+e+"h"+i+"l-"+n+","+e+"l"+n+","+e+"h-"+i+"l-"+n+","+e+"l-"+n+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),i=r.round(1.6*t,2),o=r.round(4*t,2),a="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+n+a+e+","+n+a+"0,-"+i+a+"-"+e+","+n+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),i=r.round(1.6*t,2),o=r.round(4*t,2),a="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+n+a+"-"+e+",-"+n+a+"0,"+i+a+e+",-"+n+"Z"}},"star-square":{n:21,f:function(t){var e=r.round(1.1*t,2),n=r.round(2*t,2),i="A "+n+","+n+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=r.round(1.4*t,2),n=r.round(1.9*t,2),i="A "+n+","+n+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=r.round(.7*t,2),n=r.round(1.4*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=r.round(1.4*t,2),n=r.round(.7*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=r.round(t,2),n=r.round(t/Math.sqrt(2),2);return"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=r.round(1.3*t,2),n=r.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+n+",-"+n+"L"+n+","+n+"M-"+n+","+n+"L"+n+",-"+n},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=r.round(1.2*t,2),n=r.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=r.round(t/2,2),n=r.round(t,2);return"M"+e+","+n+"V-"+n+"m-"+n+",0V"+n+"M"+n+","+e+"H-"+n+"m0,-"+n+"H"+n},needLine:!0},"y-up":{n:37,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+n+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+n+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+n+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),i=r.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+n+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=r.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=r.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{98:98}],563:[function(t,e,n){"use strict";e.exports={visible:{valType:"boolean",role:"info",editType:"calc",description:["Determines whether or not this set of error bars is visible."].join(" ")},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],role:"info",editType:"calc",description:["Determines the rule used to generate the error bars.","If *constant`, the bar lengths are of a constant value.","Set this constant in `value`.","If *percent*, the bar lengths correspond to a percentage of","underlying data. Set this percentage in `value`.","If *sqrt*, the bar lengths correspond to the sqaure of the","underlying data.","If *array*, the bar lengths are set with data set `array`."].join(" ")},symmetric:{valType:"boolean",role:"info",editType:"calc",description:["Determines whether or not the error bars have the same length","in both direction","(top/bottom for vertical bars, left/right for horizontal bars."].join(" ")},array:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar.","Values are plotted relative to the underlying data."].join(" ")},arrayminus:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar in the","bottom (left) direction for vertical (horizontal) bars","Values are plotted relative to the underlying data."].join(" ")},value:{valType:"number",min:0,dflt:10,role:"info",editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars."].join(" ")},valueminus:{valType:"number",min:0,dflt:10,role:"info",editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars in the","bottom (left) direction for vertical (horizontal) bars"].join(" ")},traceref:{valType:"integer",min:0,dflt:0,role:"info",editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,role:"info",editType:"style"},copy_ystyle:{valType:"boolean",role:"style",editType:"plot"},copy_zstyle:{valType:"boolean",role:"style",editType:"style"},color:{valType:"color",role:"style",editType:"style",description:"Sets the stoke color of the error bars."},thickness:{valType:"number",min:0,dflt:2,role:"style",editType:"style",description:"Sets the thickness (in px) of the error bars."},width:{valType:"number",min:0,role:"style",editType:"plot",description:["Sets the width (in px) of the cross-bar at both ends","of the error bars."].join(" ")},editType:"calc",_deprecated:{opacity:{valType:"number",role:"style",editType:"style",description:["Obsolete.","Use the alpha channel in error bar `color` to set the opacity."].join(" ")}}}},{}],564:[function(t,e,n){"use strict";function r(t,e,n,r){var o=e["error_"+r]||{},l=[];if(o.visible&&-1!==["linear","log"].indexOf(n.type)){for(var u=s(o),c=0;c0;t.each(function(t){var f,d=t[0].trace,p=d.error_x||{},m=d.error_y||{};d.ids&&(f=function(t){return t.id});var v=s.hasMarkers(d)&&d.marker.maxdisplayed>0;m.visible||p.visible||(t=[]);var g=i.select(this).selectAll("g.errorbar").data(t,f);if(g.exit().remove(),t.length){p.visible||g.selectAll("path.xerror").remove(),m.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);h&&y.style("opacity",0).transition().duration(n.duration).style("opacity",1),a.setClipUrl(g,e.layerClipId),g.each(function(t){var e=i.select(this),a=r(t,u,c);if(!v||t.vis){var s;if(m.visible&&o(a.x)&&o(a.yh)&&o(a.ys)){var f=m.width;s="M"+(a.x-f)+","+a.yh+"h"+2*f+"m-"+f+",0V"+a.ys,a.noYS||(s+="m-"+f+",0h"+2*f);var d=e.select("path.yerror");(l=!d.size())?d=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):h&&(d=d.transition().duration(n.duration).ease(n.easing)),d.attr("d",s)}if(p.visible&&o(a.y)&&o(a.xh)&&o(a.xs)){var g=(p.copy_ystyle?m:p).width;s="M"+a.xh+","+(a.y-g)+"v"+2*g+"m0,-"+g+"H"+a.xs,a.noXS||(s+="m0,-"+g+"v"+2*g);var y=e.select("path.xerror");(l=!y.size())?y=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):h&&(y=y.transition().duration(n.duration).ease(n.easing)),y.attr("d",s)}}})}})}},{107:107,561:561,98:98,985:985}],569:[function(t,e,n){"use strict";var r=t(98),i=t(537);e.exports=function(t){t.each(function(t){var e=t[0].trace,n=e.error_y||{},o=e.error_x||{},a=r.select(this);a.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(i.stroke,n.color),o.copy_ystyle&&(o=n),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(i.stroke,o.color)})}},{537:537,98:98}],570:[function(t,e,n){"use strict";var r=t(729);e.exports={hoverlabel:{bgcolor:{valType:"color",role:"style",arrayOk:!0,editType:"none",description:["Sets the background color of the hover labels for this trace"].join(" ")},bordercolor:{valType:"color",role:"style",arrayOk:!0,editType:"none",description:["Sets the border color of the hover labels for this trace."].join(" ")},font:r({arrayOk:!0,editType:"none",description:"Sets the font used in hover labels."}),namelength:{valType:"integer",min:-1,arrayOk:!0,role:"style",editType:"none",description:["Sets the length (in number of characters) of the trace name in","the hover labels for this trace. -1 shows the whole name","regardless of length. 0-3 shows the first 0-3 characters, and","an integer >3 will show the whole name if it is less than that","many characters, but if it is longer, will truncate to","`namelength - 3` characters and add an ellipsis."].join(" ")},editType:"calc"}}},{729:729}],571:[function(t,e,n){"use strict";function r(t,e,n,r){r=r||i.identity,Array.isArray(t)&&(e[0][n]=r(t))}var i=t(661),o=t(779);e.exports=function(t){for(var e=t.calcdata,n=t._fullLayout,a=0;a=0&&n.indexJ.width||K<0||K>J.height)return x.unhoverRaw(t,e)}if(D="xval"in e?w.flat(f,e.xval):w.p2c(S,Z),z="yval"in e?w.flat(f,e.yval):w.p2c(E,K),!h(D[0])||!h(z[0]))return d.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var $=1/0;for(N=0;NG&&(Y.splice(0,G),$=Y[0].distance)}if(0===Y.length)return x.unhoverRaw(t,e);Y.sort(function(t,e){return t.distance-e.distance});var rt=t._hoverdata,it=[];for(j=0;j1,lt=i(Y,{hovermode:O,rotateLabels:st,bgColor:y.combine(m.plot_bgcolor||y.background,m.paper_bgcolor),container:m._hoverlayer,outerContainer:m._paperdiv,commonLabelOpts:m.hoverlabel},t);if(o(Y,st?"xa":"ya"),a(lt,st),e.target&&e.target.tagName){var ut=_.getComponentMethod("annotations","hasClickToShow")(t,it);v(c.select(e.target),ut?"pointer":"")}e.target&&!r&&u(t,e,rt)&&(rt&&t.emit("plotly_unhover",{event:e,points:rt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:D,yvals:z}))}else t.emit("plotly_hover",{event:e.originalEvent,points:[e]})}function i(t,e,n){var r,i,o=e.hovermode,a=e.rotateLabels,s=e.bgColor,l=e.container,u=e.outerContainer,h=e.commonLabelOpts||{},f=e.fontFamily||M.HOVERFONT,d=e.fontSize||M.HOVERFONTSIZE,p=t[0],v=p.xa,x=p.ya,b="y"===o?"yLabel":"xLabel",_=p[b],w=(String(_)||"").split(" ")[0],T=u.node().getBoundingClientRect(),A=T.top,S=T.width,E=T.height,P=p.distance<=M.MAXDIST&&("x"===o||"y"===o);for(r=0;r-1&&r.length>p&&(r=p>3?r.substr(0,p-3)+"...":r.substr(0,p))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):P&&t[o+"Label"]===_?i=t[("x"===o?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===r&&e.remove(),i=r);var v=e.select("text.nums").call(g.font,t.fontFamily||f,t.fontSize||d,t.fontColor||h).text(i).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,n),x=e.select("text.name"),b=0;r&&r!==i?(x.call(g.font,t.fontFamily||f,t.fontSize||d,u).text(r).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,n),b=x.node().getBoundingClientRect().width+2*L):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:h});var w,M,T=v.node().getBoundingClientRect(),I=t.xa._offset+(t.x0+t.x1)/2,O=t.ya._offset+(t.y0+t.y1)/2,D=Math.abs(t.x1-t.x0),z=Math.abs(t.y1-t.y0),j=T.width+C+L+b;t.ty0=A-T.top,t.bx=T.width+2*L,t.by=T.height+2*L,t.anchor="start",t.txwidth=T.width,t.tx2width=b,t.offset=0,a?(t.pos=I,w=O+z/2+j<=E,M=O-z/2-j>=0,"top"!==t.idealAlign&&w||!M?w?(O+=z/2,t.anchor="start"):t.anchor="middle":(O-=z/2,t.anchor="end")):(t.pos=O,w=I+D/2+j<=S,M=I-D/2-j>=0,"left"!==t.idealAlign&&w||!M?w?(I+=D/2,t.anchor="start"):t.anchor="middle":(I-=D/2,t.anchor="end")),v.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+I+","+O+")"+(a?"rotate("+k+")":""))}),D}function o(t,e){for(var n,r,i,o,a,s,l,u=0,c=t.map(function(t,n){var r=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===r._id.charAt(0)?A:1)/2,pmin:r._offset,pmax:r._offset+r._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,o=0;o.01&&d.pmin===p.pmin&&d.pmax===p.pmax){for(a=f.length-1;a>=0;a--)f[a].dp+=r;for(h.push.apply(h,f),c.splice(o+1,1),l=0,a=h.length-1;a>=0;a--)l+=h[a].dp;for(i=l/h.length,a=h.length-1;a>=0;a--)h[a].dp-=i;n=!1}else o++}c.forEach(function(t){var e=t[0],l=t[t.length-1];if(r=e.pmin-e.pos-e.dp+e.size,i=l.pos+l.dp+l.size-e.pmax,r>.01){for(a=t.length-1;a>=0;a--)t[a].dp+=r;n=!1}if(!(i<.01)){if(r<-.01){for(a=t.length-1;a>=0;a--)t[a].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(s=t[o]).pos>e.pmax-1&&(s.del=!0,u--);for(o=0;o=0;a--)t[a].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(s=t[o]).pos+s.dp+s.size>e.pmax&&(s.del=!0,u--)}}})}for(o=c.length-1;o>=0;o--){var m=c[o];for(a=m.length-1;a>=0;a--){var v=m[a],g=t[v.i];g.offset=v.dp,g.del=v.del}}}function a(t,e){t.each(function(t){var n=c.select(this);if(t.del)n.remove();else{var r="end"===t.anchor?-1:1,i=n.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],a=o*(C+L),s=a+o*(t.txwidth+L),l=0,u=t.offset;"middle"===t.anchor&&(a-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-E,l=t.offset*S),n.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(r*C+l)+","+(C+u)+"v"+(t.by/2-C)+"h"+r*t.bx+"v-"+t.by+"H"+(r*C+l)+"V"+(u-C)+"Z"),i.call(m.positionText,a+l,u+t.ty0-t.by/2+L),t.tx2width&&(n.select("text.name").call(m.positionText,s+o*L+l,u+t.ty0-t.by/2+L),n.select("rect").call(g.setRect,s+(o-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))}})}function s(t,e){function n(e,n,r){var i=s(n,r);i&&(t[e]=i)}var r=t.index,i=t.trace||{},o=t.cd[0],a=t.cd[r]||{},s=Array.isArray(r)?function(t,e){return d.castOption(o,r,t)||d.extractOption({},i,"",e)}:function(t,e){return d.extractOption(a,i,t,e)};n("hoverinfo","hi","hoverinfo"),n("color","hbg","hoverlabel.bgcolor"),n("borderColor","hbc","hoverlabel.bordercolor"),n("fontFamily","htf","hoverlabel.font.family"),n("fontSize","hts","hoverlabel.font.size"),n("fontColor","htc","hoverlabel.font.color"),n("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=d.constrain(t.x0,0,t.xa._length),t.x1=d.constrain(t.x1,0,t.xa._length),t.y0=d.constrain(t.y0,0,t.ya._length),t.y1=d.constrain(t.y1,0,t.ya._length);var l;if(void 0!==t.xLabelVal){l="log"===t.xa.type&&t.xLabelVal<=0;var u=b.tickText(t.xa,t.xa.c2l(l?-t.xLabelVal:t.xLabelVal),"hover");l?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+u.text:t.xLabel=u.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){l="log"===t.ya.type&&t.yLabelVal<=0;var c=b.tickText(t.ya,t.ya.c2l(l?-t.yLabelVal:t.yLabelVal),"hover");l?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+c.text:t.yLabel=c.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+f,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return"all"!==p&&(-1===(p=p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function l(t,e){var n=e.hovermode,r=e.container,i=t[0],o=i.xa,a=i.ya,s=o.showspikes,l=a.showspikes;if(r.selectAll(".spikeline").remove(),"closest"===n&&(s||l)){var u=e.fullLayout,c=o._offset+(i.x0+i.x1)/2,h=a._offset+(i.y0+i.y1)/2,d=y.combine(u.plot_bgcolor,u.paper_bgcolor),p=f.readability(i.color,d)<1.5?y.contrast(d):i.color;if(l){var m=a.spikemode,v=a.spikethickness,x=a.spikecolor||p,b=a._boundingBox,_=(b.left+b.right)/2=0;r--){var i=n[r],o=t._hoverdata[r];if(i.curveNumber!==o.curveNumber||String(i.pointNumber)!==String(o.pointNumber))return!0}return!1}var c=t(98),h=t(107),f=t(1266),d=t(661),p=t(649),m=t(683),v=t(671),g=t(561),y=t(537),x=t(558),b=t(705),_=t(779),w=t(575),M=t(573),k=M.YANGLE,T=Math.PI*k/180,A=1/Math.sin(T),S=Math.cos(T),E=Math.sin(T),C=M.HOVERARROWSIZE,L=M.HOVERTEXTPAD;n.hover=function(t,e,n,i){t=d.getGraphDiv(t),d.throttle(t._fullLayout._uid+M.HOVERID,M.HOVERMINTIME,function(){r(t,e,n,i)})},n.loneHover=function(t,e){var n={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},r=c.select(e.container),o=e.outerContainer?c.select(e.outerContainer):r,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:r,outerContainer:o},l=i([n],s,e.gd);return a(l,s.rotateLabels),l.node()}},{107:107,1266:1266,537:537,558:558,561:561,573:573,575:575,649:649,661:661,671:671,683:683,705:705,779:779,98:98}],577:[function(t,e,n){"use strict";var r=t(661);e.exports=function(t,e,n,i){n("hoverlabel.bgcolor",(i=i||{}).bgcolor),n("hoverlabel.bordercolor",i.bordercolor),n("hoverlabel.namelength",i.namelength),r.coerceFont(n,"hoverlabel.font",i.font)}},{661:661}],578:[function(t,e,n){"use strict";var r=t(98),i=t(661),o=t(558),a=t(575),s=t(579);e.exports={moduleType:"component",name:"fx",constants:t(573),schema:{layout:s},attributes:t(570),layoutAttributes:s,supplyLayoutGlobalDefaults:t(581),supplyDefaults:t(574),supplyLayoutDefaults:t(580),calc:t(571),getDistanceFunction:a.getDistanceFunction,getClosest:a.getClosest,inbox:a.inbox,appendArrayPointValue:a.appendArrayPointValue,castHoverOption:function(t,e,n){return i.castOption(t,e,"hoverlabel."+n)},castHoverinfo:function(t,e,n){return i.castOption(t,n,"hoverinfo",function(n){return i.coerceHoverinfo({hoverinfo:n},{_module:t._module},e)})},hover:t(576).hover,unhover:o.unhover,loneHover:t(576).loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:r.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t(572)}},{558:558,570:570,571:571,572:572,573:573,574:574,575:575,576:576,579:579,580:580,581:581,661:661,98:98}],579:[function(t,e,n){"use strict";var r=t(573),i=t(729)({editType:"none",description:"Sets the default hover label font used by all traces on the graph."});i.family.dflt=r.HOVERFONT,i.size.dflt=r.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",role:"info",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar",description:["Determines the mode of drag interactions.","*select* and *lasso* apply only to scatter traces with","markers or text. *orbit* and *turntable* apply only to","3D scenes."].join(" ")},hovermode:{valType:"enumerated",role:"info",values:["x","y","closest",!1],editType:"modebar",description:"Determines the mode of hover interactions."},hoverlabel:{bgcolor:{valType:"color",role:"style",editType:"none",description:["Sets the background color of all hover labels on graph"].join(" ")},bordercolor:{valType:"color",role:"style",editType:"none",description:["Sets the border color of all hover labels on graph."].join(" ")},font:i,namelength:{valType:"integer",min:-1,dflt:15,role:"style",editType:"none",description:["Sets the default length (in number of characters) of the trace name in","the hover labels for all traces. -1 shows the whole name","regardless of length. 0-3 shows the first 0-3 characters, and","an integer >3 will show the whole name if it is less than that","many characters, but if it is longer, will truncate to","`namelength - 3` characters and add an ellipsis."].join(" ")},editType:"none"}}},{573:573,729:729}],580:[function(t,e,n){"use strict";function r(t){for(var e=!0,n=0;n=2/3},n.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},n.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},n.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],588:[function(t,e,n){"use strict";var r=t(729),i=t(536);e.exports={bgcolor:{valType:"color",role:"style",editType:"legend",description:"Sets the legend background color."},bordercolor:{valType:"color",dflt:i.defaultLine,role:"style",editType:"legend",description:"Sets the color of the border enclosing the legend."},borderwidth:{valType:"number",min:0,dflt:0,role:"style",editType:"legend",description:"Sets the width (in px) of the border enclosing the legend."},font:r({editType:"legend",description:"Sets the font used to text the legend items."}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",role:"info",editType:"legend",description:"Sets the orientation of the legend."},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],role:"style",editType:"legend",description:["Determines the order at which the legend items are displayed.","If *normal*, the items are displayed top-to-bottom in the same","order as the input data.","If *reversed*, the items are displayed in the opposite order","as *normal*.","If *grouped*, the items are displayed in groups","(when a trace `legendgroup` is provided).","if *grouped+reversed*, the items are displayed in the opposite order","as *grouped*."].join(" ")},tracegroupgap:{valType:"number",min:0,dflt:10,role:"style",editType:"legend",description:["Sets the amount of vertical space (in px) between legend groups."].join(" ")},x:{valType:"number",min:-2,max:3,dflt:1.02,role:"style",editType:"legend",description:"Sets the x position (in normalized coordinates) of the legend."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",role:"info",editType:"legend",description:["Sets the legend's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the legend."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:1,role:"style",editType:"legend",description:"Sets the y position (in normalized coordinates) of the legend."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",role:"info",editType:"legend",description:["Sets the legend's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the legend."].join(" ")},editType:"legend"}},{536:536,729:729}],589:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],590:[function(t,e,n){"use strict";var r=t(779),i=t(661),o=t(588),a=t(755),s=t(594);e.exports=function(t,e,n){function l(t,e){return i.coerce(d,p,o,t,e)}for(var u,c,h,f,d=t.legend||{},p=e.legend={},m=0,v="normal",g=0;g1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(u=0,h="left",c=1.1,f="bottom"):(u=0,h="left",c=-.1,f="top")}l("traceorder",v),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",h),l("y",c),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{588:588,594:594,661:661,755:755,779:779}],591:[function(t,e,n){"use strict";function r(t,e){function n(n){g.convertToTspans(n,e,function(){o(t,e)})}var r=t.data()[0][0],i=e._fullLayout,a=r.trace,s=d.traceIs(a,"pie"),l=a.index,u=s?r.label:a.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr("text-anchor","start").classed("user-select-none",!0).call(m.font,i.legend.font).text(u),e._context.edits.legendText&&!s?f.call(g.makeEditable,{gd:e}).call(n).on("edit",function(t){this.text(t).call(n);var i=t;this.text()||(t=" ");var o,a=r.trace._fullInput||{},s={};if(-1!==["ohlc","candlestick"].indexOf(a.type))s[(o=r.trace.transforms)[o.length-1].direction+".name"]=t;else if(d.hasTransform(a,"groupby")){var u=d.getTransformIndices(a,"groupby"),f=u[u.length-1],p=h.keyedContainer(a,"transforms["+f+"].styles","target","value.name");""===i?p.remove(r.trace._group):p.set(r.trace._group,t),s=p.constructUpdate()}else s.name=t;return c.restyle(e,s,l)}):f.call(n)}function i(t,e){var n,r=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(n=(new Date).getTime())-e._legendMouseDownTimeA&&(r=Math.max(r-1,1)),1===r?n._clickTimeout=setTimeout(function(){y(t,e,r)},A):2===r&&(n._clickTimeout&&clearTimeout(n._clickTimeout),e._legendMouseDownTime=0,y(t,e,r))}})}function o(t,e){var n=t.data()[0][0];if(n.trace.showlegend){var r,i,o=t.select("g[class*=math-group]"),a=o.node(),s=e._fullLayout.legend.font.size*_;if(a){var l=m.bBox(a);r=l.height,i=l.width,m.setTranslate(o,0,r/4)}else{var u=t.select(".legendtext"),c=g.lineCount(u),h=u.node();r=s*c,i=h?m.bBox(h).width:0;var f=s*(.3+(1-c)/2);g.positionText(u,40,f)}r=Math.max(r,16)+3,n.height=r,n.width=i}else t.remove()}function a(t,e,n){var r=t._fullLayout,i=r.legend,o=i.borderwidth,a=k.isGrouped(i),s=0;if(i.width=0,i.height=0,k.isVertical(i))a&&e.each(function(t,e){m.setTranslate(this,0,e*i.tracegroupgap)}),n.each(function(t){var e=t[0],n=e.height,r=e.width;m.setTranslate(this,o,5+o+i.height+n/2),i.height+=n,i.width=Math.max(i.width,r)}),i.width+=45+2*o,i.height+=10+2*o,a&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(a){for(var l=[i.width],c=e.data(),h=0,f=c.length;hr.width-(r.margin.r+r.margin.l)&&(x=0,v+=g,i.height=i.height+g,g=0),m.setTranslate(this,o+x,5+o+e.height/2+v),i.width+=a+n,i.height=Math.max(i.height,e.height),x+=a+n,g=Math.max(e.height,g)}),i.width+=2*o,i.height+=10+2*o}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),n.each(function(e){var n=e[0];u.select(this).select(".legendtoggle").call(m.setRect,0,-n.height/2,(t._context.edits.legendText?0:i.width)+s,n.height)})}function s(t){var e=t._fullLayout.legend,n="left";T.isRightAnchor(e)?n="right":T.isCenterAnchor(e)&&(n="center");var r="top";T.isBottomAnchor(e)?r="bottom":T.isMiddleAnchor(e)&&(r="middle"),f.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[n]||0),r:e.width*({left:1,center:.5}[n]||0),b:e.height*({top:1,middle:.5}[r]||0),t:e.height*({bottom:1,middle:.5}[r]||0)})}function l(t){var e=t._fullLayout.legend,n="left";T.isRightAnchor(e)?n="right":T.isCenterAnchor(e)&&(n="center"),f.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[n]||0),r:e.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t(98),c=t(700),h=t(661),f=t(764),d=t(779),p=t(558),m=t(561),v=t(537),g=t(683),y=t(593),x=t(589),b=t(639),_=t(634).LINE_SPACING,w=t(592),M=t(596),k=t(594),T=t(587),A=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){C.attr("data-scroll",e).call(m.setTranslate,0,e),L.call(m.setRect,F,t,x.scrollBarWidth,x.scrollBarHeight),S.select("rect").attr({y:g.borderwidth-e})}var n=t._fullLayout,o="legend"+n._uid;if(n._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var g=n.legend,b=n.showlegend&&w(t.calcdata,g),_=n.hiddenlabels||[];if(!n.showlegend||!b.length)return n._infolayer.selectAll(".legend").remove(),n._topdefs.select("#"+o).remove(),void f.autoMargin(t,"legend");var k=n._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({class:"legend","pointer-events":"all"});var S=n._topdefs.selectAll("#"+o).data([0]);S.enter().append("clipPath").attr("id",o).append("rect");var E=k.selectAll("rect.bg").data([0]);E.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),E.call(v.stroke,g.bordercolor),E.call(v.fill,g.bgcolor),E.style("stroke-width",g.borderwidth+"px");var C=k.selectAll("g.scrollbox").data([0]);C.enter().append("g").attr("class","scrollbox");var L=k.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var P=C.selectAll("g.groups").data(b);P.enter().append("g").attr("class","groups"),P.exit().remove();var I=P.selectAll("g.traces").data(h.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.call(M,t).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(r,t).call(i,t)});var O=0!==k.enter().size();O&&(a(t,P,I),s(t));var D=n.width,z=n.height;a(t,P,I),g.height>z?l(t):s(t);var j=n._size,N=j.l+j.w*g.x,R=j.t+j.h*(1-g.y);T.isRightAnchor(g)?N-=g.width:T.isCenterAnchor(g)&&(N-=g.width/2),T.isBottomAnchor(g)?R-=g.height:T.isMiddleAnchor(g)&&(R-=g.height/2);var F=g.width,B=j.w;F>B?(N=j.l,F=B):(N+F>D&&(N=D-F),N<0&&(N=0),F=Math.min(D-N,g.width));var U=g.height,V=j.h;U>V?(R=j.t,U=V):(R+U>z&&(R=z-U),R<0&&(R=0),U=Math.min(z-R,g.height)),m.setTranslate(k,N,R);var H,q,W=U-x.scrollBarHeight-2*x.scrollBarMargin,G=g.height-U;if(g.height<=U||t._context.staticPlot)E.attr({width:F-g.borderwidth,height:U-g.borderwidth,x:g.borderwidth/2,y:g.borderwidth/2}),m.setTranslate(C,0,0),S.select("rect").attr({width:F-2*g.borderwidth,height:U-2*g.borderwidth,x:g.borderwidth,y:g.borderwidth}),C.call(m.setClipUrl,o);else{H=x.scrollBarMargin,q=C.attr("data-scroll")||0,E.attr({width:F-2*g.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:U-g.borderwidth,x:g.borderwidth/2,y:g.borderwidth/2}),S.select("rect").attr({width:F-2*g.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:U-2*g.borderwidth,x:g.borderwidth,y:g.borderwidth-q}),C.call(m.setClipUrl,o),O&&e(H,q),k.on("wheel",null),k.on("wheel",function(){q=h.constrain(C.attr("data-scroll")-u.event.deltaY/W*G,-G,0),e(H=x.scrollBarMargin-q/G*W,q),0!==q&&q!==-G&&u.event.preventDefault()}),L.on(".drag",null),C.on(".drag",null);var Y=u.behavior.drag().on("drag",function(){H=h.constrain(u.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+W),q=-(H-x.scrollBarMargin)/W*G,e(H,q)});L.call(Y),C.call(Y)}if(t._context.edits.legendPosition){var X,Z,K,J;k.classed("cursor-move",!0),p.init({element:k.node(),gd:t,prepFn:function(){var t=m.getTranslate(k);K=t.x,J=t.y},moveFn:function(t,e){var n=K+t,r=J+e;m.setTranslate(k,n,r),X=p.align(n,0,j.l,j.l+j.w,g.xanchor),Z=p.align(r,0,j.t+j.h,j.t,g.yanchor)},doneFn:function(e,r,i){if(e&&void 0!==X&&void 0!==Z)c.relayout(t,{"legend.x":X,"legend.y":Z});else{var o=n._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});o.size()>0&&(1===r?k._clickTimeout=setTimeout(function(){y(o,t,r)},A):2===r&&(k._clickTimeout&&clearTimeout(k._clickTimeout),y(o,t,r)))}}})}}}},{537:537,558:558,561:561,587:587,589:589,592:592,593:593,594:594,596:596,634:634,639:639,661:661,683:683,700:700,764:764,779:779,98:98}],592:[function(t,e,n){"use strict";var r=t(779),i=t(594);e.exports=function(t,e){function n(t,n){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[n]]):s[t].push([n]);else{var r="~~i"+h;l.push(r),s[r]=[[n]],h++}}var o,a,s={},l=[],u=!1,c={},h=0;for(o=0;on[1])return n[1]}return i}function i(t){return t[0]}var s,u,c=t[0],h=c.trace,f=l.hasMarkers(h),d=l.hasText(h),p=l.hasLines(h);if(f||d||p){var m={},v={};f&&(m.mc=n("marker.color",i),m.mo=n("marker.opacity",o.mean,[.2,1]),m.ms=n("marker.size",o.mean,[2,16]),m.mlc=n("marker.line.color",i),m.mlw=n("marker.line.width",o.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(v.line={width:n("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=n("textposition",i),m.ts=10,m.tc=n("textfont.color",i),m.tf=n("textfont.family",i)),s=[o.minExtend(c,m)],u=o.minExtend(h,v)}var g=r.select(this).select("g.legendpoints"),y=g.selectAll("path.scatterpts").data(f?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(a.pointStyle,u,e),f&&(s[0].mrc=3);var x=g.selectAll("g.pointtext").data(d?s:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(a.textPointStyle,u,e)})}},{537:537,561:561,661:661,779:779,950:950,98:98,985:985}],597:[function(t,e,n){"use strict";function r(t,e){var n,r,i=e.currentTarget,o=i.getAttribute("data-attr"),a=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},u=d.list(t,null,!0),c="on";if("zoom"===o){var f,p="in"===a?.5:2,m=(1+p)/2,v=(1-p)/2;for(r=0;r1)return r(["resetViews","toggleHover"]),a(g,n);c&&(r(["zoom3d","pan3d","orbitRotation","tableRotation"]),r(["resetCameraDefault3d","resetCameraLastSave3d"]),r(["hoverClosest3d"]));var y=i(s),x=[];return((u||p)&&!y||m)&&(x=["zoom2d","pan2d"]),(v||h)&&(x=["pan2d"]),o(l)&&(x.push("select2d"),x.push("lasso2d")),x.length&&r(x),!u&&!p||y||m||r(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?r(["toggleHover"]):p?r(["hoverClosestGl2d"]):u?r(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d?r(["hoverClosestPie"]):v?r(["resetViewMapbox","toggleHover"]):h&&(r(["zoomInGeo","zoomOutGeo","resetGeo"]),r(["hoverClosestGeo"])),a(g,n)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),n=!0,r=0;r0)){var p=i(e,n,l);h("x",p[0]),h("y",p[1]),o.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),o.coerceFont(h,"font",n.font);var m=h("bgcolor");h("activecolor",a.contrast(m,u.lightAmount,u.darkAmount)),h("bordercolor"),h("borderwidth")}}},{537:537,601:601,602:602,603:603,661:661}],605:[function(t,e,n){"use strict";function r(t){for(var e=g.list(t,"x",!0),n=[],r=0;rd&&(d=h)));return d>=f?[f,d]:void 0}}var i=t(661),o=t(705),a=t(616),s=t(619);e.exports=function(t){var e=t._fullLayout,n=i.filterVisible(e.shapes);if(n.length&&t._fullData.length)for(var s=0;sq&&r>W&&!t.shiftKey?d.getCursor(i/n,1-o/r):"move";p(e,a),H=a.split("-")[0]}function a(r,i){if("path"===n.type){var a=function(t){return U(F(t)+r)};N&&"date"===N.type&&(a=v.encodeDate(a));var l=function(t){return V(B(t)+i)};R&&"date"===R.type&&(l=v.encodeDate(l)),n.path=s(z,a,l),h[j]=n.path}else h[x]=n.x0=U(f+r),h[b]=n.y0=V(m+i),h[_]=n.x1=U(g+r),h[w]=n.y1=V(y+i);e.attr("d",o(t,n))}function u(r,i){if("path"===n.type){var a=function(t){return U(F(t)+r)};N&&"date"===N.type&&(a=v.encodeDate(a));var l=function(t){return V(B(t)+i)};R&&"date"===R.type&&(l=v.encodeDate(l)),n.path=s(z,a,l),h[j]=n.path}else{var u=~H.indexOf("n")?M+i:M,c=~H.indexOf("s")?k+i:k,f=~H.indexOf("w")?T+r:T,d=~H.indexOf("e")?A+r:A;c-u>W&&(h[S]=n[P]=V(u),h[E]=n[I]=V(c)),d-f>q&&(h[C]=n[O]=U(f),h[L]=n[D]=U(d))}e.attr("d",o(t,n))}var h,f,m,g,y,x,b,_,w,M,k,T,A,S,E,C,L,P,I,O,D,z,j,N,R,F,B,U,V,H,q=10,W=10,G={element:e.node(),gd:t,prepFn:function(e){N=c.getFromId(t,n.xref),R=c.getFromId(t,n.yref),F=v.getDataToPixel(t,N),B=v.getDataToPixel(t,R,!0),U=v.getPixelToData(t,N),V=v.getPixelToData(t,R,!0);var o="shapes["+r+"]";"path"===n.type?(z=n.path,j=o+".path"):(f=F(n.x0),m=B(n.y0),g=F(n.x1),y=B(n.y1),x=o+".x0",b=o+".y0",_=o+".x1",w=o+".y1"),fs&&(t="X"),t});return r>s&&(l=l.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),i+l})}function s(t,e,n){return t.replace(m.segmentRE,function(t){var r=0,i=t.charAt(0),o=m.paramIsX[i],a=m.paramIsY[i],s=m.numParams[i];return i+t.substr(1).replace(m.paramRE,function(t){return r>=s?t:(o[r]?t=e(t):a[r]&&(t=n(t)),r++,t)})})}var l=t(700),u=t(661),c=t(705),h=t(537),f=t(561),d=t(558),p=t(679),m=t(616),v=t(619);e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var n=0;n0)&&(r("active"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("len"),r("lenmode"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),o.coerceFont(r,"font",n.font),r("currentvalue.visible")&&(r("currentvalue.xanchor"),r("currentvalue.prefix"),r("currentvalue.suffix"),r("currentvalue.offset"),o.coerceFont(r,"currentvalue.font",e.font)),r("transition.duration"),r("transition.easing"),r("bgcolor"),r("activebgcolor"),r("bordercolor"),r("borderwidth"),r("ticklen"),r("tickwidth"),r("tickcolor"),r("minorticklen"))}function i(t,e){function n(t,e){return o.coerce(r,i,u,t,e)}for(var r,i,a=t.steps||[],s=e.steps=[],l=0;l=n.steps.length&&(n.active=0),e.call(s,n).call(b,n).call(c,n).call(p,n).call(x,t,n).call(l,t,n),T.setTranslate(e,n.lx+n.pad.l,n.ly+n.pad.t),e.call(v,n,n.active/(n.steps.length-1),!1),e.call(s,n)}function s(t,e,n){if(e.currentvalue.visible){var r,i,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":r=e.inputAreaLength-E.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":r=.5*e.inputAreaLength,i="middle";break;default:r=E.currentValueInset,i="left"}o.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var a=e.currentvalue.prefix?e.currentvalue.prefix:"";a+="string"==typeof n?n:e.steps[e.active].label,e.currentvalue.suffix&&(a+=e.currentvalue.suffix),o.call(T.font,e.currentvalue.font).text(a).call(A.convertToTspans,e.gd);var s=A.lineCount(o),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*C;return A.positionText(o,r,l),o}}function l(t,e,n){var r=t.selectAll("rect."+E.gripRectClass).data([0]);r.enter().append("rect").classed(E.gripRectClass,!0).call(d,e,t,n).style("pointer-events","all"),r.attr({width:E.gripWidth,height:E.gripHeight,rx:E.gripRadius,ry:E.gripRadius}).call(k.stroke,n.bordercolor).call(k.fill,n.bgcolor).style("stroke-width",n.borderwidth+"px")}function u(t,e,n){var r=t.selectAll("text").data([0]);return r.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),r.call(T.font,n.font).text(e.step.label).call(A.convertToTspans,n.gd),r}function c(t,e){var n=t.selectAll("g."+E.labelsClass).data([0]);n.enter().append("g").classed(E.labelsClass,!0);var r=n.selectAll("g."+E.labelGroupClass).data(e.labelSteps);r.enter().append("g").classed(E.labelGroupClass,!0),r.exit().remove(),r.each(function(t){var n=w.select(this);n.call(u,t,e),T.setTranslate(n,g(e,t.fraction),E.tickOffset+e.ticklen+e.font.size*C+E.labelOffset+e.currentValueTotalHeight)})}function h(t,e,n,r,i){var o=Math.round(r*(n.steps.length-1));o!==n.active&&f(t,e,n,o,!0,i)}function f(t,e,n,r,i,o){var a=n.active;n._input.active=n.active=r;var l=n.steps[n.active];e.call(v,n,n.active/(n.steps.length-1),o),e.call(s,n),t.emit("plotly_sliderchange",{slider:n,step:n.steps[n.active],interaction:i,previousActive:a}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:i,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var n=e._nextMethod.step;n.method&&(n.execute&&M.executeAPICommand(t,n.method,n.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,n){function r(){return n.data()[0]}var i=n.node(),o=w.select(e);t.on("mousedown",function(){var t=r();e.emit("plotly_sliderstart",{slider:t});var a=n.select("."+E.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),a.call(k.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);h(e,n,t,s,!0),t._dragging=!0,o.on("mousemove",function(){var t=r(),o=y(t,w.mouse(i)[0]);h(e,n,t,o,!1)}),o.on("mouseup",function(){var t=r();t._dragging=!1,a.call(k.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var n=t.selectAll("rect."+E.tickRectClass).data(e.steps);n.enter().append("rect").classed(E.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each(function(t,n){var r=n%e.labelStride==0,i=w.select(this);i.attr({height:r?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),T.setTranslate(i,g(e,n/(e.steps.length-1))-.5*e.tickwidth,(r?E.tickOffset:E.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=t.steps.length,n=0;n0&&(a=a.transition().duration(e.transition.duration).ease(e.transition.easing)),a.attr("transform","translate("+(o-.5*E.gripWidth)+","+e.currentValueTotalHeight+")")}}function g(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function x(t,e,n){var r=t.selectAll("rect."+E.railTouchRectClass).data([0]);r.enter().append("rect").classed(E.railTouchRectClass,!0).call(d,e,t,n).style("pointer-events","all"),r.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,E.tickOffset+n.ticklen+n.labelHeight)}).call(k.fill,n.bgcolor).attr("opacity",0),T.setTranslate(r,0,n.currentValueTotalHeight)}function b(t,e){var n=t.selectAll("rect."+E.railRectClass).data([0]);n.enter().append("rect").classed(E.railRectClass,!0);var r=e.inputAreaLength-2*E.railInset;n.attr({width:r,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),T.setTranslate(n,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;r0?[0]:[]);if(s.enter().append("g").classed(E.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==n.length){var l=s.selectAll("g."+E.groupClassName).data(n,i);l.enter().append("g").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u0||f<0){var m={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[_.side];e.attr("transform","translate("+m+")")}}}var v,g=n.propContainer,y=n.propName,x=n.traceIndex,b=n.dfltName,_=n.avoid||{},w=n.attributes,M=n.transform,k=n.containerGroup,T=t._fullLayout,A=g.titlefont.family,S=g.titlefont.size,E=g.titlefont.color,C=1,L=!1,P=g.title.trim();"title"===y?v="titleText":-1!==y.indexOf("axis")?v="axisTitleText":y.indexOf(!0)&&(v="colorbarTitleText");var I=t._context.edits[v];""===P&&(C=0),P.match(f)&&(C=.2,L=!0,I||(P=""));var O=P||I;k||(k=T._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var D=k.selectAll("text").data(O?[0]:[]);if(D.enter().append("text"),D.text(P).attr("class",e),D.exit().remove(),O){D.call(d);var z="Click to enter "+b+" title";I&&(P?D.on(".opacity",null):(C=0,L=!0,P=z,D.text(P).on("mouseover.opacity",function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})),D.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?o.restyle(t,y,e,x):o.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(c.positionText,w.x,w.y)})),D.classed("js-placeholder",L)}}},{107:107,537:537,561:561,639:639,661:661,683:683,700:700,764:764,98:98}],628:[function(t,e,n){"use strict";var r=t(729),i=t(536),o=t(650).extendFlat,a=t(689).overrideAll,s=t(763),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle",role:"info",description:["Sets the Plotly method to be called on click.","If the `skip` method is used, the API updatemenu will function as normal","but will perform no API calls and will not bind automatically to state","updates. This may be used to create a component interface and attach to","updatemenu events manually via JavaScript."].join(" ")},args:{valType:"info_array",role:"info",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets the arguments values to be passed to the Plotly","method set in `method` on click."].join(" ")},label:{valType:"string",role:"info",dflt:"",description:"Sets the text label to appear on the button."},execute:{valType:"boolean",role:"info",dflt:!0,description:["When true, the API method is executed. When false, all other behaviors are the same","and command execution is skipped. This may be useful when hooking into, for example,","the `plotly_buttonclicked` method and executing the API command manually without losing","the benefit of the updatemenu automatically binding to the state of the plot through the","specification of `method` and `args`."].join(" ")}};e.exports=a({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean",role:"info",description:["Determines whether or not the update menu is visible."].join(" ")},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown",role:"info",description:["Determines whether the buttons are accessible via a dropdown menu","or whether the buttons are stacked horizontally or vertically"].join(" ")},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down",role:"info",description:["Determines the direction in which the buttons are laid out, whether","in a dropdown menu or a row/column of buttons. For `left` and `up`,","the buttons will still appear in left-to-right or top-to-bottom order","respectively."].join(" ")},active:{valType:"integer",role:"info",min:-1,dflt:0,description:["Determines which button (by index starting from 0) is","considered active."].join(" ")},showactive:{valType:"boolean",role:"info",dflt:!0,description:"Highlights active dropdown item or active button if true."},buttons:l,x:{valType:"number",min:-2,max:3,dflt:-.05,role:"style",description:"Sets the x position (in normalized coordinates) of the update menu."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right",role:"info",description:["Sets the update menu's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:1,role:"style",description:"Sets the y position (in normalized coordinates) of the update menu."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top",role:"info",description:["Sets the update menu's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},pad:o({},s,{description:"Sets the padding around the buttons or dropdown menu."}),font:r({description:"Sets the font of the update menu button text."}),bgcolor:{valType:"color",role:"style",description:"Sets the background color of the update menu buttons."},bordercolor:{valType:"color",dflt:i.borderLine,role:"style",description:"Sets the color of the border enclosing the update menu."},borderwidth:{valType:"number",min:0,dflt:1,role:"style",editType:"arraydraw",description:"Sets the width (in px) of the border enclosing the update menu."}},"arraydraw","from-root")},{536:536,650:650,689:689,729:729,763:763}],629:[function(t,e,n){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},{}],630:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,s,n,r)}r("visible",i(t,e).length>0)&&(r("active"),r("direction"),r("type"),r("showactive"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),r("pad.t"),r("pad.r"),r("pad.b"),r("pad.l"),o.coerceFont(r,"font",n.font),r("bgcolor",n.paper_bgcolor),r("bordercolor"),r("borderwidth"))}function i(t,e){function n(t,e){return o.coerce(r,i,u,t,e)}for(var r,i,a=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(o.enter().append("g").classed(C.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&_(t),0!==n.length){var c=o.selectAll("g."+C.headerGroupClassName).data(n,i);c.enter().append("g").classed(C.headerGroupClassName,!0);var h=o.selectAll("g."+C.dropdownButtonGroupClassName).data([0]);h.enter().append("g").classed(C.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var f=0;fM,A=r.barLength+2*r.barPad,S=r.barWidth+2*r.barPad,E=p,C=v+g;C+S>u&&(C=u-S);var L=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(o.fill,r.barColor),T?(this.hbar=L.attr({rx:r.barRadius,ry:r.barRadius,x:E,y:C,width:A,height:S}),this._hbarXMin=E+A/2,this._hbarTranslateMax=M-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=g>k,I=r.barWidth+2*r.barPad,O=r.barLength+2*r.barPad,D=p+m,z=v;D+I>l&&(D=l-I);var j=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);j.exit().on(".drag",null).remove(),j.enter().append("rect").classed("scrollbar-vertical",!0).call(o.fill,r.barColor),P?(this.vbar=j.attr({rx:r.barRadius,ry:r.barRadius,x:D,y:z,width:I,height:O}),this._vbarYMin=z+O/2,this._vbarTranslateMax=k-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,R=c-.5,F=P?h+I+.5:h+.5,B=f-.5,U=T?d+S+.5:d+.5,V=s._topdefs.selectAll("#"+N).data(T||P?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",N).append("rect"),T||P?(this._clipRect=V.select("rect").attr({x:Math.floor(R),y:Math.floor(B),width:Math.ceil(F)-Math.floor(R),height:Math.ceil(U)-Math.floor(B)}),this.container.call(a.setClipUrl,N),this.bg.attr({x:p,y:v,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),T||P){var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),P&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,n)},r.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},r.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},r.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},r.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,r=n+this._hbarTranslateMax;t=(s.constrain(i.event.x,n,r)-n)/(r-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,a=o+this._vbarTranslateMax;e=(s.constrain(i.event.y,o,a)-o)/(a-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},r.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=s.constrain(t||0,0,n),e=s.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/n;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var o=e/r;this.vbar.call(a.setTranslate,t,e+o*this._vbarTranslateMax)}}},{537:537,561:561,661:661,98:98}],634:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],635:[function(t,e,n){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],636:[function(t,e,n){"use strict";for(var r=t(650).extendFlat,i={circle:{unicode:"●"},square:{unicode:"■"},diamond:{unicode:"◆"},cross:{unicode:"✚"},x:{unicode:"❌"},"triangle-up":{unicode:"▲"},"triangle-down":{unicode:"▼"},"triangle-left":{unicode:"◄"},"triangle-right":{unicode:"►"},"triangle-ne":{unicode:"◥"},"triangle-nw":{unicode:"◤"},"triangle-se":{unicode:"◢"},"triangle-sw":{unicode:"◣"},pentagon:{unicode:"⬟"},hexagon:{unicode:"⬢"},hexagon2:{unicode:"⬣"},star:{unicode:"★"},"diamond-tall":{unicode:"♦"},bowtie:{unicode:"⧓"},"diamond-x":{unicode:"❖"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"✳",noBorder:!0},"y-up":{unicode:"⅄",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"─",noBorder:!0},"line-ns":{unicode:"│",noBorder:!0}},o={},a=Object.keys(i),s=0;s","#62":">",nbsp:" ","#160":" ",times:"×","#215":"×",plusmn:"±","#177":"±",deg:"°","#176":"°"}}},{}],642:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],643:[function(t,e,n){"use strict";var r=t(700);n.version="1.31.1",t(104).polyfill(),t(483),t(644),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t(696),n.register=t(695),n.toImage=t(698),n.downloadImage=t(781),n.validate=t(699),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t(975)),n.register([t(578),t(595),t(528),t(533),t(620),t(586),t(632),t(626),t(613),t(607)]),n.Icons=t(484),n.Plots=r.Plots,n.Fx=t(578),n.Snapshot=t(784),n.PlotSchema=t(694),n.Queue=t(674),n.d3=t(98)},{104:104,483:483,484:484,528:528,533:533,578:578,586:586,595:595,607:607,613:613,620:620,626:626,632:632,644:644,674:674,694:694,695:695,696:696,698:698,699:699,700:700,781:781,784:784,975:975,98:98}],644:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],645:[function(t,e,n){"use strict";var r=t(107),i=t(640).BADNUM,o=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"")),r(t)?Number(t):i}},{107:107,640:640}],646:[function(t,e,n){"use strict";var r=t(107),i=t(1266),o=t(703),a=t(549),s=Object.keys(t(555)),l=t(668),u=t(675).counter;n.valObjectMeta={data_array:{description:["An {array} of data.","The value MUST be an {array}, or we ignore it."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{description:["Enumerated value type. The available values are listed","in `values`."].join(" "),requiredOpts:["values"],otherOpts:["dflt","coerceNumber","arrayOk"],coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ri.max?e.set(n):e.set(+t)}},integer:{description:["An integer or an integer inside a string.","When applicable, values greater (less) than `max` (`min`)","are coerced to the `dflt`."].join(" "),requiredOpts:[],otherOpts:["dflt","min","max","arrayOk"],coerceFunction:function(t,e,n,i){t%1||!r(t)||void 0!==i.min&&ti.max?e.set(n):e.set(+t)}},string:{description:["A string value.","Numbers are converted to strings except for attributes with","`strict` set to true."].join(" "),requiredOpts:[],otherOpts:["dflt","noBlank","strict","arrayOk","values"],coerceFunction:function(t,e,n,r){if("string"!=typeof t){var i="number"==typeof t;!0!==r.strict&&i?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{description:["A string describing color.","Supported formats:","- hex (e.g. '#d3d3d3')","- rgb (e.g. 'rgb(255, 0, 0)')","- rgba (e.g. 'rgb(255, 0, 0, 0.5)')","- hsl (e.g. 'hsl(0, 100%, 50%)')","- hsv (e.g. 'hsv(0, 100%, 100%)')","- named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)"].join(" "),requiredOpts:[],otherOpts:["dflt","arrayOk"],coerceFunction:function(t,e,n){i(t).isValid()?e.set(t):e.set(n)}},colorscale:{description:["A Plotly colorscale either picked by a name:","(any of",s.join(", "),")","customized as an {array} of 2-element {arrays} where","the first element is the normalized color level value","(starting at *0* and ending at *1*),","and the second item is a valid color string."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(t,e,n){e.set(a(t,n))}},angle:{description:["A number (in degree) between -180 and 180."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{description:["An id string of a subplot type (given by dflt), optionally","followed by an integer >1. e.g. if dflt='geo', we can have","'geo', 'geo2', 'geo3', ..."].join(" "),requiredOpts:["dflt"],otherOpts:[],coerceFunction:function(t,e,n){"string"==typeof t&&u(n).test(t)?e.set(t):e.set(n)},validateFunction:function(t,e){var n=e.dflt;return t===n||"string"==typeof t&&!!u(n).test(t)}},flaglist:{description:["A string representing a combination of flags","(order does not matter here).","Combine any of the available `flags` with *+*.","(e.g. ('lines+markers')).","Values in `extras` cannot be combined."].join(" "),requiredOpts:["flags"],otherOpts:["dflt","extras","arrayOk"],coerceFunction:function(t,e,n,r){if("string"==typeof t)if(-1===(r.extras||[]).indexOf(t)){for(var i=t.split("+"),o=0;o0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+o}return r}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function h(t){return t.formatDate("M d, yyyy")}var f=t(98),d=t(107),p=t(665).error,m=t(667),v=t(640),g=v.BADNUM,y=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t(779),k=f.time.format.utc,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,A=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,S=(new Date).getFullYear()-70;n.dateTick0=function(t,e){return r(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},n.dfltRange=function(t){return r(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},n.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var E,C;n.dateTime2ms=function(t,e){if(n.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*b)>=E&&t<=C?t:g;if("string"!=typeof t&&"number"!=typeof t)return g;t=String(t);var i=r(e),o=t.charAt(0);!i||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var a=i&&"chinese"===e.substr(0,7),s=t.match(a?A:T);if(!s)return g;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return g;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(a){var v="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,v),c)}else p=m.newDate(l,Number(u),c)}catch(t){return g}return p?(p.toJD()-w)*y+h*x+f*b+d*_:g}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var k=new Date(Date.UTC(2e3,u,c,h,f));return k.setUTCFullYear(l),k.getUTCMonth()!==u?g:k.getUTCDate()!==c?g:k.getTime()+d*_},E=n.MIN_MS=n.dateTime2ms("-9999"),C=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==g};var L=90*y,P=3*x,I=5*b;n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=E&&t<=C))return g;e||(e=0);var i,a,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(r(n)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(n).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=k("G%Y-%m-%d")(new Date(f))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;a=e=E+y&&t<=C-y))return g;var e=Math.floor(10*m(t+.05,1)),n=new Date(Math.round(t-e/10));return o(f.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,i){if(n.isJSDate(t)||"number"==typeof t){if(r(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,i))return p("unrecognized date",t),e;return t};var O=/%\d?f/g,D=[59,59.9,59.99,59.999,59.9999],z=k("%Y"),j=k("%b %Y"),N=k("%b %-d"),R=k("%b %-d, %Y");n.formatDate=function(t,e,n,i){var o,f;if(i=r(i)&&i,e)return a(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===n?f=l(p):"m"===n?f=u(p):"d"===n?(o=l(p),f=c(p)):(o=h(p),f=s(t,n))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===n?f=z(m):"m"===n?f=j(m):"d"===n?(o=z(m),f=N(m)):(o=R(m),f=s(t,n))}return f+(o?"\n"+o:"")};var F=3*y;n.incrementMonth=function(t,e,n){n=r(n)&&n;var i=m(t,y);if(t=Math.round(t-i),n)try{var o=Math.round(t/y)+w,a=M.getComponentMethod("calendars","getCal")(n),s=a.fromJD(o);return e%12?a.add(s,e,"m"):a.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+n)}var l=new Date(t+F);return l.setUTCMonth(l.getUTCMonth()+e)+i-F},n.findExactDates=function(t,e){for(var n,i,o=0,a=0,s=0,l=0,u=r(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},n.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},n.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),n=0;n1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function i(t,e,n,r,i){var o=r*t+i*e;if(o<0)return r*r+i*i;if(o>n){var a=r-t,s=i-e;return a*a+s*s}var l=r*e-i*t;return l*l/n}var o=t(667);n.segmentsIntersect=r,n.segmentDistance=function(t,e,n,o,a,s,l,u){if(r(t,e,n,o,a,s,l,u))return 0;var c=n-t,h=o-e,f=l-a,d=u-s,p=c*c+h*h,m=f*f+d*d,v=Math.min(i(c,h,p,a-t,s-e),i(c,h,p,l-t,u-e),i(f,d,m,t-a,e-s),i(f,d,m,n-a,o-s));return Math.sqrt(v)};var a,s,l;n.getTextLocation=function(t,e,n,r){if(t===s&&r===l||(a={},s=t,l=r),a[n])return a[n];var i=t.getPointAtLength(o(n-r/2,e)),u=t.getPointAtLength(o(n+r/2,e)),c=Math.atan((u.y-i.y)/(u.x-i.x)),h=t.getPointAtLength(o(n,e)),f={x:(4*h.x+i.x+u.x)/6,y:(4*h.y+i.y+u.y)/6,theta:c};return a[n]=f,f},n.clearLocationCache=function(){s=null},n.getVisibleSegment=function(t,e,n){function r(e){var n=t.getPointAtLength(e);0===e?i=n:e===h&&(o=n);var r=n.xs?n.x-s:0,c=n.yu?n.y-u:0;return Math.sqrt(r*r+c*c)}for(var i,o,a=e.left,s=e.right,l=e.top,u=e.bottom,c=0,h=t.getTotalLength(),f=h,d=r(c);d;){if((c+=d+n)>f)return;d=r(c)}for(d=r(f);d;){if(f-=d+n,c>f)return;d=r(f)}return{min:c,max:f,len:f-c,total:h,isClosed:0===c&&f===h&&Math.abs(i.x-o.x)<.1&&Math.abs(i.y-o.y)<.1}}},{667:667}],656:[function(t,e,n){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],657:[function(t,e,n){"use strict";function r(t,e){var n=t;return n[3]*=e,n}function i(t){if(a(t))return c;var e=s(t);return e.length?e:c}function o(t){return a(t)?t:h}var a=t(107),s=t(70),l=t(551),u=t(536).defaultLine,c=s(u),h=1;e.exports=function(t,e,n){var a,u,f,d,p,m=t.color,v=Array.isArray(m),g=Array.isArray(e),y=[];if(a=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,u=v?function(t,e){return void 0===t[e]?c:s(a(t[e]))}:i,f=g?function(t,e){return void 0===t[e]?h:o(t[e])}:o,v||g)for(var x=0;x",e))>=0;){var n=t.indexOf("
",e);if(n/g,"\n")}function o(t){return t.replace(/\<.*\>/g,"")}function a(t){for(var e=l.entityToUnicode,n=0;(n=t.indexOf("&",n))>=0;){var r=t.indexOf(";",n);if(ra?s:i(t)?Number(t):s:s},l.noop=t(669),l.identity=t(660),l.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var i=0;in?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},l.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},l.simpleMap=function(t,e,n,r){for(var i=t.length,o=new Array(i),a=0;a-1||u!==1/0&&u>=Math.pow(2,n)?t(e,n,r):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var n,r,i,o,a=t.length,s=2*a,l=2*e-1,u=new Array(l),c=new Array(a);for(n=0;n=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=a&&(i=s-1-i),o+=t[i]*u[r];c[n]=o}return c},l.syncOrAsync=function(t,e,n){for(var r,i;t.length;)if(i=t.splice(0,1)[0],(r=i(e))&&r.then)return r.then(function(){return l.syncOrAsync(t,e,n)}).then(void 0,l.promiseError);return n&&n(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,n){if(t){var r,i,o=!1,a=!0;for(r=0;r1?i+a[1]:"";if(o&&(a.length>1||s.length>4||n))for(;r.test(s);)s=s.replace(r,"$1"+o+"$2");return s+l};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var n={};return t.replace(_,function(t,r){return w.test(r)?e[r]||"":(n[r]=n[r]||l.nestedProperty(e,r).get,n[r]()||"")})}},{107:107,640:640,645:645,646:646,647:647,648:648,650:650,651:651,652:652,655:655,656:656,660:660,662:662,663:663,664:664,665:665,666:666,667:667,668:668,669:669,670:670,673:673,675:675,676:676,677:677,678:678,681:681,684:684,685:685,98:98}],662:[function(t,e,n){"use strict";var r="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||r.isView(t)}},{}],663:[function(t,e,n){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],664:[function(t,e,n){"use strict";var r=t(668),i=/^\w*$/;e.exports=function(t,e,n,o){n=n||"name",o=o||"value";var a,s,l={};s=e&&e.length?r(t,e).get():t,e=e||"",s=s||[];var u={};for(a=0;a2)return l[e]=2|l[e],h.set(t,null);if(c){for(a=e;a1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e][0],o=t[e][1],l=!1,d(r))for(n=r.length-1;n>=0;n--)i(r[n],a(o,n))?l?r[n]=void 0:r.pop():l=!0;else if("object"==typeof r&&null!==r)for(l=!1,n=(s=Object.keys(r)).length-1;n>=0;n--)i(r[s[n]],a(o,s[n]))?delete r[s[n]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function h(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var f=t(107),d=t(662),p=t(663),m=t(688);e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var n,i,a,s=0,l=e.split(".");s/g),s=0;sr||u===i||ua||e&&l(t))}:function(t,s){var l=t[0],u=t[1];if(l===i||lr||u===i||ua)return!1;var c,h,f,d,p,m=e.length,v=e[0][0],g=e[0][1],y=0;for(c=1;cMath.max(h,v)||u>Math.max(f,g)))if(uc||Math.abs(r(a,f))>i)return!0;return!1};o.filter=function(t,e){function n(n){t.push(n);var s=r.length,l=i;r.splice(o+1);for(var u=l+1;u1&&n(t.pop()),{addPt:n,raw:t,filtered:r}}},{640:640,666:666}],673:[function(t,e,n){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var n,r=e.toString();for(n=0;no.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,n;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;ne}function a(t,e){return t>=e}var s=t(107),l=t(665);n.findBin=function(t,e,n){if(s(e.start))return n?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,d=0;for(c=e[e.length-1]>=e[0]?n?r:i:n?a:o;h90&&l.log("Long binary search..."),h-1},n.sorterAsc=function(t,e){return t-e},n.sorterDes=function(t,e){return e-t},n.distinctVals=function(t){var e=t.slice();e.sort(n.sorterAsc);for(var r=e.length-1,i=e[r]-e[0]||1,o=i/(r||1)/1e4,a=[e[0]],s=0;se[s]+o&&(i=Math.min(i,e[s+1]-e[s]),a.push(e[s+1]));return{vals:a,minDiff:i}},n.roundUp=function(t,e,n){for(var r,i=0,o=e.length-1,a=0,s=n?0:1,l=n?1:0,u=n?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]}},{107:107}],682:[function(t,e,n){"use strict";var r=t(70);e.exports=function(t){var e=r(t);return e.length?e:[0,0,0,1]}},{70:70}],683:[function(t,e,n){"use strict";function r(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(g,"\\lt ").replace(y,"\\gt ")}function o(t,e,n){var r="math-output-"+f.randstr([],64),o=h.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=h.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())f.log("There was an error in the tex syntax.",t),n();else{var r=o.select("svg").node().getBoundingClientRect();n(o.select(".MathJax_SVG"),e,r)}o.remove()})}function a(t,e){if(!t)return null;var n=t.match(e);return n&&(n[3]||n[4])}function s(t,e){if(!t)return"";for(var n=0;n1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),o=u[u.length-1].node}else f.log("Ignoring unexpected end tag .",e)}(k);else{var z=y[4],j={type:k},N=a(z,L);if(N?(N=N.replace(D,"$1 fill:"),T&&(N+=";"+T)):T&&(N=T),N&&(j.style=N),"a"===k){s=!0;var R=a(z,P);if(R){var F=document.createElement("a");F.href=R,-1!==M.indexOf(F.protocol)&&(j.href=encodeURI(R),j.target=a(z,I)||"_blank",j.popup=a(z,O))}}r(j)}}return s}function c(t,e,n){var r,i,o,a=n.horizontalAlign,s=n.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-r.height}:"middle"===s?function(){return l.top+(l.height-r.height)/2}:function(){return l.top},o="right"===a?function(){return l.right-r.width}:"center"===a?function(){return l.left+(l.width-r.width)/2}:function(){return l.left},function(){return r=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:o()-u.left+"px","z-index":1e3}),this}}var h=t(98),f=t(661),d=t(642),p=t(641),m=t(634).LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;n.convertToTspans=function(t,e,i){function a(){c.empty()||(f=t.attr("class")+"-math",c.select("svg."+f).remove()),t.text("").style("white-space","pre"),u(t.node(),s)&&t.style("pointer-events","all"),n.positionText(t),i&&i.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(v),c=h.select(t.node().parentNode);if(!c.empty()){var f=t.attr("class")?t.attr("class").split(" ")[0]:"text";return f+="-math",c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var n=parseInt(t.node().style.fontSize,10),u={fontSize:n};o(l[2],u,function(o,l,u){c.selectAll("svg."+f).remove(),c.selectAll("g."+f+"-group").remove();var h=o&&o.select("svg");if(!h||!h.node())return a(),void e();var d=c.append("g").classed(f+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});d.node().appendChild(h.node()),l&&l.node()&&h.node().insertBefore(l.node().cloneNode(!0),h.node().firstChild),h.attr({class:f,height:u.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";h.select("g").attr({fill:p,stroke:p});var m=r(h,"width"),v=r(h,"height"),g=+t.attr("x")-m*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=-(n||r(t,"height"))/4;"y"===f[0]?(d.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-m/2,y-v/2]+")"}),h.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===f[0]?h.attr({x:t.attr("x"),y:y-v/2}):"a"===f[0]?h.attr({x:0,y:y}):h.attr({x:g,y:+t.attr("y")+y-v/2}),i&&i.call(t,d),e(d)})})):a(),t}};var g=/(<|<|<)/g,y=/(>|>|>)/g,x={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},b={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="​",M=["http:","https:","mailto:","",void 0,":"],k=new RegExp("]*)?/?>","g"),T=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),A=/(\r\n?|\n)/g,S=/(<[^<>]*>)/,E=/<(\/?)([^ >]*)(\s+(.*))?>/i,C=//i,L=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,P=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,I=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,O=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,D=/(^|;)\s*color:/;n.plainText=function(t){return(t||"").replace(k," ")},n.lineCount=function(t){return t.selectAll("tspan.line").size()||1},n.positionText=function(t,e,n){return t.each(function(){function t(t,e){return void 0===e?null===(e=r.attr(t))&&(r.attr(t,0),e=0):r.attr(t,e),e}var r=h.select(this),i=t("x",e),o=t("y",n);"text"===this.nodeName&&r.selectAll("tspan.line").attr({x:i,y:o})})},n.makeEditable=function(t,e){function n(){i(),t.style({opacity:0});var e,n=l.attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&h.select(t.node().parentNode).select(e).style({opacity:0})}function r(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}function i(){var n=h.select(o).select(".svg-container"),i=n.append("div"),a=t.node().style,l=parseFloat(a.fontSize||12);i.classed("plugin-editable editable",!0).style({position:"absolute","font-family":a.fontFamily||"Arial","font-size":l,color:e.fill||a.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-l/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(c(t,n,e)).on("blur",function(){o._editing=!1,t.text(this.textContent).style({opacity:1});var e,n=h.select(this).attr("class");(e=n?"."+n.split(" ")[0]+"-math-group":"[class*=-math-group]")&&h.select(t.node().parentNode).select(e).style({opacity:0});var r=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on("mouseup",null),s.edit.call(t,r)}).on("focus",function(){var t=this;o._editing=!0,h.select(document).on("mouseup",function(){if(h.event.target===t)return!1;document.activeElement===i.node()&&i.node().blur()})}).on("keyup",function(){27===h.event.which?(o._editing=!1,t.style({opacity:1}),h.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(t,this.textContent)):(s.input.call(t,this.textContent),h.select(this).call(c(t,n,e)))}).on("keydown",function(){13===h.event.which&&this.blur()}).call(r)}var o=e.gd,a=e.delegate,s=h.dispatch("edit","input","cancel"),l=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?n():l.on("click",n),h.rebind(t,s,"on")}},{634:634,641:641,642:642,661:661,98:98}],684:[function(t,e,n){"use strict";function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};n.throttle=function(t,e,n){function o(){n(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}var a=i[t],s=Date.now();if(!a){for(var l in i)i[l].tsa.ts+e?o():a.timer=setTimeout(function(){o(),a.timer=null},e)},n.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var n=e.onDone;e.onDone=function(){n&&n(),t(),e.onDone=null}}):Promise.resolve()},n.clear=function(t){if(t)r(i[t]),delete i[t];else for(var e in i)n.clear(e)}},{}],685:[function(t,e,n){"use strict";var r=t(107);e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}},{107:107}],686:[function(t,e,n){"use strict";var r=e.exports={},i=t(731).locationmodeToLayer,o=t(1268).feature;r.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(t,e){return t+e+".json"},r.getTopojsonFeatures=function(t,e){var n=i[t.locationmode],r=e.objects[n];return o(e,r).features}},{1268:1268,731:731}],687:[function(t,e,n){"use strict";function r(t,e){for(var n=new Float32Array(e),r=0;r0)return t.substr(0,e)}var s=t(107),l=t(177),u=t(779),c=t(661),h=t(764),f=t(705),d=t(537);n.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&c.log("Clearing previous rejected promises from queue."),t._promises=[]},n.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=f.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var g=h.getSubplotIds(t,"gl3d");for(e=0;e1&&a.warn("Full array edits are incompatible with other edits",h);var y=n[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!m&&(f(v,g),d(t),!0)}var x,b,_,w,M,k,T,A=Object.keys(n).map(Number).sort(s),S=e.get(),E=S||[],C=r(g,h).get(),L=[],P=-1,I=E.length;for(x=0;xE.length-(T?0:1))a.warn("index out of range",h,_);else if(void 0!==k)M.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(k)?L.push(_):T?("add"===k&&(k={}),E.splice(_,0,k),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",h,_,k),-1===P&&(P=_);else for(b=0;b=0;x--)E.splice(L[x],1),C&&C.splice(L[x],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(f(v,g),p!==o){var O;if(-1===P)O=A;else{for(I=Math.max(E.length,I),O=[],x=0;x=P);x++)O.push(_);for(x=P;x=t.data.length||i<-t.data.length)throw new Error(n+" must be valid indices for gd.data.");if(e.indexOf(i,r+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+n+" must be unique.")}}function u(t,e,n){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),l(t,e,"currentIndices"),void 0===n||Array.isArray(n)||(n=[n]),void 0!==n&&l(t,n,"newIndices"),void 0!==n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,n){var r,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),r=0;r=0&&lG.range[0]?[1,2]:[2,1]);else{var Z=G.range[0],K=G.range[1];Y?(Z<=0&&K<=0&&n(D+".autorange",!0),Z<=0?Z=K/1e6:K<=0&&(K=Z/1e6),n(D+".range[0]",Math.log(Z)/Math.LN10),n(D+".range[1]",Math.log(K)/Math.LN10)):(n(D+".range[0]",Math.pow(10,Z)),n(D+".range[1]",Math.pow(10,K)))}else n(D+".autorange",!0);T.getComponentMethod("annotations","convertCoords")(t,B,C,n),T.getComponentMethod("images","convertCoords")(t,B,C,n)}else n(D+".autorange",!0),n(D+".range",null);w.nestedProperty(u,D+"._inputRange").set(null)}else if(I.match(F.AX_NAME_PATTERN)){var J=w.nestedProperty(u,k).get(),$=(C||{}).type;$&&"-"!==$||($="linear"),T.getComponentMethod("annotations","convertCoords")(t,J,$,n),T.getComponentMethod("images","convertCoords")(t,J,$,n)}var Q=z.containerArrayMatch(k);if(Q){o=Q.array,a=Q.index;var tt=Q.property,et=(w.nestedProperty(l,o)||[])[a]||{},nt=et,rt=V||{editType:"calc"},it=-1!==rt.editType.indexOf("calcIfAutorange");""===a?(it?y.calc=!0:R.update(y,rt),it=!1):""===tt&&(nt=C,z.isAddVal(C)?b[k]=null:z.isRemoveVal(C)?(b[k]=et,nt=et):w.warn("unrecognized full object value",e)),it&&(r(nt,"x")||r(nt,"y"))?y.calc=!0:R.update(y,rt),f[o]||(f[o]={});var ot=f[o][a];ot||(ot=f[o][a]={}),ot[tt]=C,delete e[k]}else"reverse"===I?(N.range?N.range.reverse():(n(D+".autorange",!0),N.range=[1,0]),B.autorange?y.calc=!0:y.plot=!0):((!u._has("gl2d")||"dragmode"!==k||"lasso"!==C&&"select"!==C||"lasso"===U||"select"===U)&&V?R.update(y,V):y.calc=!0,E.set(C))}}for(o in f)z.applyContainerArrayChanges(t,w.nestedProperty(l,o),f[o],y)||(y.plot=!0);var at=u._axisConstraintGroups;for(g in M)for(a=0;a=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function o(t,e){var n=0;return function(){if(t&&++n===e)return t()}}if(t=w.getGraphDiv(t),!w.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var a=t._transitionData;a._frameQueue||(a._frameQueue=[]);var s=(n=S.supplyAnimationDefaults(n)).transition,l=n.frame;return void 0===a._frameWaitingCnt&&(a._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit("plotly_animated"),window.cancelAnimationFrame(a._animationRaf),a._animationRaf=null}function h(){a._currentFrame&&a._currentFrame.onComplete&&a._currentFrame.onComplete();var e=a._currentFrame=a._frameQueue.shift();if(e){var n=e.name?e.name.toString():null;t._fullLayout._currentFrame=n,a._lastFrameAt=Date.now(),a._timeToNext=e.frameOpts.duration,S.transition(t,e.frame.data,e.frame.layout,j.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:n,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else c()}function f(){t.emit("plotly_animating"),a._lastFrameAt=-1/0,a._timeToNext=0,a._runningTransitions=0,a._currentFrame=null;var e=function(){a._animationRaf=window.requestAnimationFrame(e),Date.now()-a._lastFrameAt>a._timeToNext&&h()};e()}function d(t){return Array.isArray(s)?v>=s.length?t.transitionOpts=s[v]:t.transitionOpts=s[0]:t.transitionOpts=s,v++,t}var p,m,v=0,g=[],y=void 0===e||null===e,x=Array.isArray(e);if(!y&&!x&&w.isPlainObject(e))g.push({type:"object",data:d(w.extendFlat({},e))});else if(y||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&k.push(m);g=k}}g.length>0?function(e){if(0!==e.length){for(var s=0;s=0;i--)if(w.isPlainObject(e[i])){var f=(u[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&u[f]&&(r++,w.warn('addFrames: overwriting frame "'+u[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),r>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:S.supplyFrameDefaults(e[i]),index:n&&void 0!==n[i]&&null!==n[i]?n[i]:c+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(o=h[i].frame).name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!o.name)for(;u[o.name="frame "+t._transitionData._counter++];);if(u[o.name]){for(a=0;a=0;n--)r=e[n],o.push({type:"delete",index:r}),a.unshift({type:"insert",index:r,value:i[r]});var s=S.modifyFrames,l=S.modifyFrames,u=[t,a],c=[t,o];return k&&k.add(t,s,u,l,c),S.modifyFrames(t,o)},_.purge=function(t){var e=(t=w.getGraphDiv(t))._fullLayout||{},n=t._fullData||[];return S.cleanPlot([],{},n,e),S.purge(t),M.purge(t),e._container&&e._container.remove(),delete t._context,t}},{107:107,278:278,537:537,561:561,567:567,642:642,649:649,661:661,674:674,683:683,689:689,690:690,691:691,694:694,697:697,700:700,708:708,710:710,712:712,714:714,764:764,767:767,779:779,98:98}],693:[function(t,e,n){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],694:[function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a=t._basePlotModules;if(a){var s;for(n=0;n=t.items.length)return!1;t=t.items[i]}}return t}function o(t){return t===Math.round(t)&&t>=0}function a(t){var e,n;"area"===t?(e={attributes:w},n={}):n=(e=v.modules[t]._module).basePlotModule;var r={};r.type=null,A(r,y),A(r,e.attributes),n.attributes&&A(r,n.attributes),r.type=t;var i={meta:e.meta||{},attributes:c(r)};if(e.layoutAttributes){var o={};A(o,e.layoutAttributes),i.layoutAttributes=c(o)}return i}function s(){var t,e,n={};A(n,x);for(t in v.subplotsRegistry)(e=v.subplotsRegistry[t]).layoutAttributes&&("cartesian"===e.name?(p(n,e,"xaxis"),p(n,e,"yaxis")):p(n,e,"subplot"===e.attr?e.name:e.attr));n=d(n);for(t in v.componentsRegistry){var r=(e=v.componentsRegistry[t]).schema;if(r&&(r.subplots||r.layout)){var i=r.subplots;if(i&&i.xaxis&&!i.yaxis)for(var o in i.xaxis)delete n.yaxis[o]}else e.layoutAttributes&&m(n,e.layoutAttributes,e.name)}return{layoutAttributes:c(n)}}function l(t){var e=v.transformsRegistry[t],n=A({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var r=v.componentsRegistry[e];r.schema&&r.schema.transforms&&r.schema.transforms[t]&&Object.keys(r.schema.transforms[t]).forEach(function(e){m(n,r.schema.transforms[t][e],e)})}),{attributes:c(n)}}function u(){var t={frames:g.extendDeepAll({},b)};return c(t),t.frames}function c(t){return h(t),f(t),t}function h(t){function e(t){return{valType:"string",role:"info",description:["Sets the source reference on plot.ly for ",t,"."].join(" "),editType:"none"}}n.crawl(t,function(t,r,i){n.isValObject(t)?"data_array"===t.valType?(t.role="data",i[r+"src"]=e(r)):!0===t.arrayOk&&(i[r+"src"]=e(r)):g.isPlainObject(t)&&(t.role="object")})}function f(t){n.crawl(t,function(t,e,n){if(t){var r=t[E];r&&(delete t[E],n[e]={items:{}},n[e].items[r]=t,n[e].role="object")}})}function d(t){return T(t,{radialaxis:M.radialaxis,angularaxis:M.angularaxis}),T(t,M.layout),t}function p(t,e,n){var r=g.nestedProperty(t,n),i=A({},e.layoutAttributes);i[S]=!0,r.set(i)}function m(t,e,n){var r=g.nestedProperty(t,n);r.set(A(r.get()||{},e))}var v=t(779),g=t(661),y=t(703),x=t(755),b=t(730),_=t(701),w=t(765),M=t(766),k=t(689),T=g.extendFlat,A=g.extendDeepAll,S="_isSubplotObj",E="_isLinkedToArray",C=[S,E,"_arrayAttrRegexps","_deprecated"];n.IS_SUBPLOT_OBJ=S,n.IS_LINKED_TO_ARRAY=E,n.DEPRECATED="_deprecated",n.UNDERSCORE_ATTRS=C,n.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=a(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=l(t)}),{defs:{valObjects:g.valObjectMeta,metaKeys:C.concat(["description","role","editType","impliedEdits"]),editType:{traces:k.traces,layout:k.layout},impliedEdits:{description:["Sometimes when an attribute is changed, other attributes","must be altered as well in order to achieve the intended","result. For example, when `range` is specified, it is","important to set `autorange` to `false` or the new `range`","value would be lost in the redraw. `impliedEdits` is the","mechanism to do this: `impliedEdits: {autorange: false}`.","Each key is a relative paths to the attribute string to","change, using *^* to ascend into the parent container,","for example `range[0]` has `impliedEdits: {*^autorange*: false}`.","A value of `undefined` means that the attribute will not be","changed, but its previous value should be recorded in case","we want to reverse this change later. For example, `autorange`","has `impliedEdits: {*range[0]*: undefined, *range[1]*:undefined}","because the range will likely be changed by redraw."].join(" ")}},traces:t,layout:s(),transforms:e,frames:u(),animation:c(_)}},n.crawl=function(t,e,r,i){var o=r||0;i=i||"",Object.keys(t).forEach(function(r){var a=t[r];if(-1===C.indexOf(r)){var s=(i?i+".":"")+r;e(a,r,t,o,s),n.isValObject(a)||g.isPlainObject(a)&&"impliedEdits"!==r&&n.crawl(a,e,o+1,s)}})},n.isValObject=function(t){return t&&void 0!==t.valType},n.findArrayAttributes=function(t){function e(e,n,a,s){if(o=o.slice(0,s).concat([n]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===o[s-1]&&("ticktext"===n||"tickvals"===n))){var l=r(o),u=g.nestedProperty(t,l).get();Array.isArray(u)&&i.push(l)}}function r(t){return t.join(".")}var i=[],o=[];if(n.crawl(y,e),t._module&&t._module.attributes&&n.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,s=0;s=t.transforms.length)return!1;r=(n=(v.transformsRegistry[t.transforms[l].type]||{}).attributes)&&n[e[2]],s=3}else if("area"===t.type)r=w[a];else{var u=t._module;if(u||(u=(v.modules[t.type||y.type.dflt]||{})._module),!u)return!1;if(n=u.attributes,!(r=n&&n[a])){var c=u.basePlotModule;c&&c.attributes&&(r=c.attributes[a])}r||(r=y[a])}return i(r,e,s)},n.getLayoutValObject=function(t,e){return i(r(t,e[0]),e,1)}},{661:661,689:689,701:701,703:703,730:730,755:755,765:765,766:766,779:779}],695:[function(t,e,n){"use strict";function r(t){a.register(t,t.name,t.categories,t.meta),a.subplotsRegistry[t.basePlotModule.name]||a.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,n="function"==typeof t.transform,r="function"==typeof t.calcTransform;if(!n&&!r)throw new Error(e+" is missing a *transform* or *calcTransform* method.");n&&r&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),a.registerTransform(t)}function o(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");a.registerComponent(t)}var a=t(779),s=t(661);e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||i[1]<=t[0])&&(o[0]e[0]))return!0}return!1}function i(t,e,n){return t._anchorAxis===e&&(t.mirror||t.side===n)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+n]}function o(t,e,n){var r=[],i=e._anchorAxis;if(i){var o=i._mainAxis;if(-1===r.indexOf(o)){r.push(o);for(var a=0;a1&&l.push(a("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,v=n.length,g=0;g.3*h||o(r)||o(i))){var f=n.dtick/2;t+=t+f.8){var a=Number(n.substr(1));o.exactYears>.8&&a%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*D:o.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*D:t-=D/2;var s=B.tickIncrement(t,n);if(s<=r)return s}return t}function s(t){var e,n,r=t.tickvals,i=t.ticktext,o=new Array(r.length),a=T.simpleMap(t.range,t.r2l),s=1.0001*a[0]-1e-4*a[1],l=1.0001*a[1]-1e-4*a[0],u=Math.min(s,l),h=Math.max(s,l),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),n=0;nu&&e10||"01-01"!==r.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=D&&i<=10||e>=15*D)t._tickround="d";else if(e>=j&&i<=16||e>=z)t._tickround="M";else if(e>=N&&i<=19||e>=j)t._tickround="S";else{var o=t.l2r(n+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20}}else if(M(e)||"L"===e.charAt(0)){var a=t.range.map(t.r2d||Number);M(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(a[0]),Math.abs(a[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(m(t.exponentformat)&&!v(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function c(t,e,n){var r=t.tickfont||{};return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}function h(t,e,n,r){var i=t._tickround,o=n&&t.hoverformat||t.tickformat;r&&(i=M(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var a,s=T.formatDate(e.x,o,i,t.calendar),l=s.indexOf("\n");-1!==l&&(a=s.substr(l+1),s=s.substr(0,l)),r&&("00:00:00"===s||"00:00"===s?(s=a,a=""):8===s.length&&(s=s.replace(/:00$/,""))),a&&(n?"d"===i?s+=", "+a:s=a+(s?", "+s:""):t._inCalcTicks&&a===t._prevDateHead||(s+="
"+a,t._prevDateHead=a)),e.text=s}function f(t,e,n,r,i){var o=t.dtick,a=e.x;if("never"===i&&(i=""),!r||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=g(Math.pow(10,a),t,i,r);else if(M(o)||"D"===o.charAt(0)&&T.mod(a+.01,1)<.1){var s=Math.round(a);-1!==["e","E","power"].indexOf(t.exponentformat)||m(t.exponentformat)&&v(s)?(e.text=0===s?1:1===s?"10":s>1?"10"+s+"":"10"+R+-s+"",e.fontSize*=1.25):(e.text=g(Math.pow(10,a),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,T.mod(a,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(a<0?.5:.25)))}}function d(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n=""),e.text=String(n)}function p(t,e,n,r,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=g(e.x,t,i,r)}function m(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function g(t,e,n,r){var i=t<0,o=e._tickround,a=n||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat,c=e.separatethousands;if(r){var h={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:M(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};u(h),o=(Number(h._tickround)||0)+4,s=h._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return w.format(l)(t).replace(/-/g,R);var f=Math.pow(10,-o)/2;if("none"===a&&(s=0),(t=Math.abs(t))"+g+"":"B"===a&&9===s?t+="B":m(a)&&(t+=K[s/3+5])}return i?R+t:t}function y(t,e){var n,r,i=[];for(n=0;n1)for(r=1;r2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},B.getAutoRange=function(t){var e,n=[],r=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&h/c>f&&(l=a,u=s,f=h/c);if(r===i){var m=r-1,v=r+1;n="tozero"===t.rangemode?r<0?[m,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,v)]:[m,v]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),n=[l.val-f*l.pad,u.val+f*u.pad]);return n[0]===n[1]&&("tozero"===t.rangemode?n=n[0]<0?[n[0],0]:n[0]>0?[0,n[0]]:[0,1]:(n=[n[0]-1,n[0]+1],"nonnegative"===t.rangemode&&(n[0]=Math.max(0,n[0])))),d&&n.reverse(),T.simpleMap(n,t.l2r||Number)},B.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=B.getAutoRange(t),t._r=t.range.slice(),t._rl=T.simpleMap(t._r,t.r2l);var n=t._input;n.range=t.range.slice(),n.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var n=B.list(t,"",!0),r=!1,i=0;i=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(a,1),a--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(r(c)){for(d=!0,a=0;a=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(a,1),a--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||!!T.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),n||(n={}),t._m||t.setScale();var o,a,s,l,u,c,h,f,d,p,m,v=e.length,g=n.padded?.05*t._length:0,y=n.tozero&&("linear"===t.type||"-"===t.type);g&&"domain"===t.constrain&&t._inputDomain&&(g*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=r((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),b=r((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),_=r(n.vpadplus||n.vpad),w=r(n.vpadminus||n.vpad);for(o=0;o<6;o++)i(o);for(o=v-1;o>5;o--)i(o)}},B.autoBin=function(t,e,n,r,i){var s=T.aggNums(Math.min,null,t),l=T.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1,_count:l-s+1};var u;if(n)u=(l-s)/n;else{var c=T.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*T.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);u=Math.max(f,2*T.stdev(t)/Math.pow(t.length,r?.25:.4)),M(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:T.simpleMap([s,l],e.c2r,0,i),calendar:i},B.setConvert(d),B.autoTicks(d,u);var p,m,v=B.tickIncrement(B.tickFirst(d),d.dtick,"reverse",i);if("number"==typeof d.dtick)p=(v=o(v,t,d,s,l))+(m=1+Math.floor((l-v)/d.dtick))*d.dtick;else for("M"===d.dtick.charAt(0)&&(v=a(v,t,d.dtick,s,i)),p=v,m=0;p<=l;)p=B.tickIncrement(p,d.dtick,!1,i),m++;return{start:e.c2r(v,0,i),end:e.c2r(p,0,i),size:d.dtick,_count:m}},B.calcTicks=function(t){var e=T.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var n,r=t.nticks;r||("category"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/n):(n="y"===t._id.charAt(0)?40:80,r=T.constrain(t._length/n,4,9)+1)),"array"===t.tickmode&&(r*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),u(t),"array"===t.tickmode)return s(t);t._tmin=B.tickFirst(t);var i=e[1]=a:h<=a)&&!(o.length>c||h===l);h=B.tickIncrement(h,t.dtick,i,t.calendar))l=h,o.push(h);t._tmax=o[o.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(o.length),d=0;dI?(e/=I,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*l(e,n,q)):r>O?(e/=O,t.dtick="M"+l(e,1,W)):r>D?(t.dtick=l(e,D,Y),t.tick0=T.dateTick0(t.calendar,!0)):r>z?t.dtick=l(e,z,W):r>j?t.dtick=l(e,j,G):r>N?t.dtick=l(e,N,G):(n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,n,q))}else if("log"===t.type){t.tick0=0;var i=T.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var o=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/o,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+l(e,n,q)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,n,q));if(0===t.dtick&&(t.dtick=1),!M(t.dtick)&&"string"!=typeof t.dtick){var a=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(a)}},B.tickIncrement=function(t,e,n,r){var i=n?-1:1;if(M(e))return t+i*e;var o=e.charAt(0),a=i*Number(e.substr(1));if("M"===o)return T.incrementMonth(t,a,r);if("L"===o)return Math.log(Math.pow(10,t)+a)/Math.LN10;if("D"===o){var s="D2"===e?Z:X,l=t+.01*i,u=T.roundUp(T.mod(l,1),s,n);return Math.floor(l)+Math.log(w.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,n=T.simpleMap(t.range,e),r=n[1]1&&e2*i}function o(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,i=0,o=0;o2*r}var a=t(107),s=t(661),l=t(640).BADNUM;e.exports=function(t,e){return i(t,e)?"date":o(t)?"category":r(t)?"linear":"-"}},{107:107,640:640,661:661}],707:[function(t,e,n){"use strict";var r=t(1266).mix,i=t(779),o=t(661),a=t(536).lightFraction,s=t(716),l=t(725),u=t(724),c=t(723),h=t(709),f=t(722),d=t(718);e.exports=function(t,e,n,p,m){function v(n,r){return o.coerce2(t,e,s,n,r)}var g=p.letter,y=p.font||{},x="Click to enter "+(p.title||g.toUpperCase()+" axis")+" title",b=n("visible",!p.cheateronly),_=e.type;if("date"===_&&i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar),f(e,m),n("autorange",!e.isValidRange(t.range))&&n("rangemode"),n("range"),e.cleanRange(),h(t,e,n),e._initialCategories="category"===_?d(g,e.categoryorder,e.categoryarray,p.data):[],!b)return e;var w=n("color"),M=w===t.color?w:y.color;n("title",x),o.coerceFont(n,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:M}),l(t,e,n,_),c(t,e,n,_,p),u(t,e,n,p);var k=v("linecolor",w),T=v("linewidth"),A=n("showline",!!k||!!T);A||(delete e.linecolor,delete e.linewidth),(A||e.ticks)&&n("mirror");var S=v("gridcolor",r(w,p.bgColor,a).toRgbString()),E=v("gridwidth");n("showgrid",p.showGrid||!!S||!!E)||(delete e.gridcolor,delete e.gridwidth);var C=v("zerolinecolor",w),L=v("zerolinewidth");return n("zeroline",p.showGrid||!!C||!!L)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{1266:1266,536:536,661:661,709:709,716:716,718:718,722:722,723:723,724:724,725:725,779:779}],708:[function(t,e,n){"use strict";function r(t,e,n){function r(t,n){for(var r=Object.keys(t),i=/^[xyz]axis[0-9]*/,o=[],a=0;a0;o&&(r="array");var a=n("categoryorder",r);"array"===a&&n("categoryarray"),o||"array"!==a||(e.categoryorder="trace")}}},{}],710:[function(t,e,n){"use strict";var r=t(661).counterRegex;e.exports={idRegex:{x:r("x"),y:r("y")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{661:661}],711:[function(t,e,n){"use strict";function r(t,e,n,r){var i,o,s,l,u=r[a(e)].type,c=[];for(o=0;oa*g)||_)for(n=0;nP&&OC&&(C=O);h/=(C-E)/(2*L),E=l.l2r(E),C=l.l2r(C),l.range=l._input.range=T=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function c(t,e,n,r,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+n+", "+r+")").attr("d",i+"Z")}function h(t,e,n){return t.append("path").attr("class","zoombox-corners").style({fill:A.background,stroke:A.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+n+")").attr("d","M0,0Z")}function f(t){t.selectAll(".select-outline").remove()}function d(t,e,n,r,i,o){t.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),i||(t.transition().style("fill",o>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function m(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-R-.5)+"h-3v"+(2*R+1)+"h3ZM"+(t.r+.5)+","+(e-R-.5)+"h3v"+(2*R+1)+"h-3Z"}function g(t,e){return"M"+(e-R-.5)+","+(t.t-.5)+"v-3h"+(2*R+1)+"v3ZM"+(e-R-.5)+","+(t.b+.5)+"v3h"+(2*R+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,R)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,n){var r,i,o,a,s,l,u=!1,c={},h={};for(r=0;rR||s>R?(kt="xy",a/ot>s/at?(s=a*at/ot,xt>o?bt.t=xt-s:bt.b=xt+s):(a=s*ot/at,yt>i?bt.l=yt-a:bt.r=yt+a),At.attr("d",y(bt))):r():!lt||szoom back out","long"),F=!1)}function Y(e,n){var r=1===(U+V).length;if(e)$();else if(2!==n||r){if(1===n&&r){var i=U?nt[0]:et[0],a="s"===U||"w"===V?0:1,s=i._name+".range["+a+"]",l=o(i,a),u="left",c="middle";if(i.fixedrange)return;U?(c="n"===U?"top":"bottom","right"===i.side&&(u="right")):"e"===V&&(u="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(T.makeEditable,{gd:t,immediate:!0,background:dt.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:u,verticalAlign:c}).on("edit",function(e){var n=i.d2r(e);void 0!==n&&w.relayout(t,s,n)})}}else J()}function X(e){function n(t,e,n){if(!t.fixedrange){var r=k.simpleMap(t.range,t.r2l),i=r[0]+(r[1]-r[0])*e;t.range=r.map(function(e){return t.l2r(i+(e-i)*n)})}}if(t._context.scrollZoom||dt._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var r=t.querySelector(".plotly");if(H(),!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(Ct);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var o,a=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=Pt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(V||ct){for(V||(l=.5),o=0;o rect").call(S.setTranslate,s,l).call(S.setScale,o,a);var w=m.plot.selectAll(".scatterlayer .points, .boxlayer .points");m.plot.call(S.setTranslate,b,_).call(S.setScale,1/o,1/a),w.selectAll(".point").call(S.setPointGroupScale,o,a).call(S.hideOutsideRangePoints,m),w.selectAll(".textpoint").call(S.setTextPointsScale,o,a).call(S.hideOutsideRangePoints,m)}}}var tt,et,nt,rt,it,ot,at,st,lt,ut,ct,ht,ft,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,mt=U+V==="nsew";H();var vt=r(e,U+V+"drag",ut,n,A,E,B);if(!lt&&!st&&!m(dt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=mt?"all":"none",vt;var gt={element:vt,gd:t,plotinfo:e,prepFn:function(e,n,r){var i=t._fullLayout.dragmode;mt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",gt.minDrag="lasso"===i?1:void 0,"zoom"===i?(gt.moveFn=W,gt.doneFn=G,gt.minDrag=1,q(0,n,r)):"pan"===i?(gt.moveFn=Z,gt.doneFn=Y,f(pt)):m(i)&&(gt.xaxes=et,gt.yaxes=nt,D(e,n,r,gt,i))}};C.init(gt);var yt,xt,bt,_t,wt,Mt,kt,Tt,At,St={},Et=[0,0,ot,at],Ct=null,Lt=j.REDRAWDELAY,Pt=e.mainplot?dt._plots[e.mainplot]:e;return U.length*V.length!=1&&(void 0!==vt.onwheel?vt.onwheel=X:void 0!==vt.onmousewheel&&(vt.onmousewheel=X)),vt}},{1266:1266,537:537,558:558,561:561,634:634,661:661,679:679,683:683,700:700,705:705,708:708,710:710,720:720,721:721,764:764,779:779,98:98}],714:[function(t,e,n){"use strict";var r=t(107),i=t(578),o=t(558),a=t(710),s=t(713);e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,n){if((e._plots[t].mainplot&&!0)===(e._plots[n].mainplot&&!0)){var r=t.split("y"),i=n.split("y");return r[0]===i[0]?Number(r[1]||1)-Number(i[1]||1):Number(r[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(n){var l=e._plots[n],u=l.xaxis,c=l.yaxis,h=(u._linepositions[n]||[])[3],f=(c._linepositions[n]||[])[3],d=a.DRAGGERSIZE;if(r(h)&&"top"===u.side&&(h-=d),r(f)&&"right"!==c.side&&(f-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===n&&i.hover(t,e,n)},i.hover(t,e,n),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=n},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},p.onclick=function(e){i.click(t,e,n)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(r(h)&&("free"===u.anchor&&(h-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,h,.8*u._length,d,"","ew"),s(t,l,0,h,.1*u._length,d,"","w"),s(t,l,.9*u._length,h,.1*u._length,d,"","e")),r(f)&&("free"===c.anchor&&(f-=e._size.w*u.domain[0]),s(t,l,f,.1*c._length,d,.8*c._length,"ns",""),s(t,l,f,.9*c._length,d,.1*c._length,"s",""),s(t,l,f,0,d,.1*c._length,"n","")))});var n=e._hoverlayer.node();n.onmousemove=function(n){n.target=e._lasthover,i.hover(t,n,e._hoversubplot)},n.onclick=function(n){n.target=e._lasthover,i.click(t,n)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{107:107,558:558,578:578,710:710,713:713}],715:[function(t,e,n){"use strict";function r(t,e,n,r,i){var o=t._fullLayout._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var a=0;a* (see `dtick` for more info).","If the axis `type` is *date*, it should be a date string, like date data.","If the axis `type` is *category*, it should be a number, using the scale where","each category is assigned a serial number from zero in the order it appears."].join(" ")},dtick:{valType:"any",role:"style",editType:"ticks",impliedEdits:{tickmode:"linear"},description:["Sets the step in-between ticks on this axis. Use with `tick0`.","Must be a positive number, or special strings available to *log* and *date* axes.","If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n","is the tick number. For example,","to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1.","To set tick marks at 1, 100, 10000, ... set dtick to 2.","To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433.","*log* has several special values; *L*, where `f` is a positive number,","gives ticks linearly spaced in value (but not position).","For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc.","To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5).","`tick0` is ignored for *D1* and *D2*.","If the axis `type` is *date*, then you must convert the time to milliseconds.","For example, to set the interval between ticks to one day,","set `dtick` to 86400000.0.","*date* also has special values *M* gives ticks spaced by a number of months.","`n` must be a positive integer.","To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*.","To set ticks every 4 years, set `dtick` to *M48*"].join(" ")},tickvals:{valType:"data_array",editType:"ticks",description:["Sets the values at which ticks on this axis appear.","Only has an effect if `tickmode` is set to *array*.","Used with `ticktext`."].join(" ")},ticktext:{valType:"data_array",editType:"ticks",description:["Sets the text displayed at the ticks position via `tickvals`.","Only has an effect if `tickmode` is set to *array*.","Used with `tickvals`."].join(" ")},ticks:{valType:"enumerated",values:["outside","inside",""],role:"style",editType:"ticks",description:["Determines whether ticks are drawn or not.","If **, this axis' ticks are not drawn.","If *outside* (*inside*), this axis' are drawn outside (inside)","the axis lines."].join(" ")},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,role:"style",editType:"ticks+layoutstyle",description:["Determines if the axis lines or/and ticks are mirrored to","the opposite side of the plotting area.","If *true*, the axis lines are mirrored.","If *ticks*, the axis lines and ticks are mirrored.","If *false*, mirroring is disable.","If *all*, axis lines are mirrored on all shared-axes subplots.","If *allticks*, axis lines and ticks are mirrored","on all shared-axes subplots."].join(" ")},ticklen:{valType:"number",min:0,dflt:5,role:"style",editType:"ticks",description:"Sets the tick length (in px)."},tickwidth:{valType:"number",min:0,dflt:1,role:"style",editType:"ticks",description:"Sets the tick width (in px)."},tickcolor:{valType:"color",dflt:i.defaultLine,role:"style",editType:"ticks",description:"Sets the tick color."},showticklabels:{valType:"boolean",dflt:!0,role:"style",editType:"ticks",description:"Determines whether or not the tick labels are drawn."},showspikes:{valType:"boolean",dflt:!1,role:"style",editType:"modebar",description:["Determines whether or not spikes (aka droplines) are drawn for this axis.","Note: This only takes affect when hovermode = closest"].join(" ")},spikecolor:{valType:"color",dflt:null,role:"style",editType:"none",description:"Sets the spike color. If undefined, will use the series color"},spikethickness:{valType:"number",dflt:3,role:"style",editType:"none",description:"Sets the width (in px) of the zero line."},spikedash:a({},o,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],role:"style",dflt:"toaxis",editType:"none",description:["Determines the drawing mode for the spike line","If *toaxis*, the line is drawn from the data point to the axis the ","series is plotted on.","If *across*, the line is drawn across the entire plot area, and","supercedes *toaxis*.","If *marker*, then a marker dot is drawn on the axis the series is","plotted on"].join(" ")},tickfont:r({editType:"ticks",description:"Sets the tick font."}),tickangle:{valType:"angle",dflt:"auto",role:"style",editType:"ticks",description:["Sets the angle of the tick labels with respect to the horizontal.","For example, a `tickangle` of -90 draws the tick labels","vertically."].join(" ")},tickprefix:{valType:"string",dflt:"",role:"style",editType:"ticks",description:"Sets a tick label prefix."},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",role:"style",editType:"ticks",description:["If *all*, all tick labels are displayed with a prefix.","If *first*, only the first tick is displayed with a prefix.","If *last*, only the last tick is displayed with a suffix.","If *none*, tick prefixes are hidden."].join(" ")},ticksuffix:{valType:"string",dflt:"",role:"style",editType:"ticks",description:"Sets a tick label suffix."},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",role:"style",editType:"ticks",description:"Same as `showtickprefix` but for tick suffixes."},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",role:"style",editType:"ticks",description:["If *all*, all exponents are shown besides their significands.","If *first*, only the exponent of the first tick is shown.","If *last*, only the exponent of the last tick is shown.","If *none*, no exponents appear."].join(" ")},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",role:"style",editType:"ticks",description:["Determines a formatting rule for the tick exponents.","For example, consider the number 1,000,000,000.","If *none*, it appears as 1,000,000,000.","If *e*, 1e+9.","If *E*, 1E+9.","If *power*, 1x10^9 (with 9 in a super script).","If *SI*, 1G.","If *B*, 1B."].join(" ")},separatethousands:{valType:"boolean",dflt:!1,role:"style",editType:"ticks",description:['If "true", even 4-digit integers are separated'].join(" ")},tickformat:{valType:"string",dflt:"",role:"style",editType:"ticks",description:["Sets the tick label formatting rule using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see:","https://github.com/d3/d3-format/blob/master/README.md#locale_format","And for dates see:","https://github.com/d3/d3-time-format/blob/master/README.md#locale_format","We add one item to d3's date formatter: *%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")},hoverformat:{valType:"string",dflt:"",role:"style",editType:"none",description:["Sets the hover text formatting rule using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see:","https://github.com/d3/d3-format/blob/master/README.md#locale_format","And for dates see:","https://github.com/d3/d3-time-format/blob/master/README.md#locale_format","We add one item to d3's date formatter: *%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")},showline:{valType:"boolean",dflt:!1,role:"style",editType:"layoutstyle",description:["Determines whether or not a line bounding this axis is drawn."].join(" ")},linecolor:{valType:"color",dflt:i.defaultLine,role:"style",editType:"layoutstyle",description:"Sets the axis line color."},linewidth:{valType:"number",min:0,dflt:1,role:"style",editType:"ticks+layoutstyle",description:"Sets the width (in px) of the axis line."},showgrid:{valType:"boolean",role:"style",editType:"ticks",description:["Determines whether or not grid lines are drawn.","If *true*, the grid lines are drawn at every tick mark."].join(" ")},gridcolor:{valType:"color",dflt:i.lightLine,role:"style",editType:"ticks",description:"Sets the color of the grid lines."},gridwidth:{valType:"number",min:0,dflt:1,role:"style",editType:"ticks",description:"Sets the width (in px) of the grid lines."},zeroline:{valType:"boolean",role:"style",editType:"ticks",description:["Determines whether or not a line is drawn at along the 0 value","of this axis.","If *true*, the zero line is drawn on top of the grid lines."].join(" ")},zerolinecolor:{valType:"color",dflt:i.defaultLine,role:"style",editType:"ticks",description:"Sets the line color of the zero line."},zerolinewidth:{valType:"number",dflt:1,role:"style",editType:"ticks",description:"Sets the width (in px) of the zero line."},anchor:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],role:"info",editType:"plot",description:["If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to","the corresponding opposite-letter axis.","If set to *free*, this axis' position is determined by `position`."].join(" ")},side:{valType:"enumerated",values:["top","bottom","left","right"],role:"info",editType:"plot",description:["Determines whether a x (y) axis is positioned","at the *bottom* (*left*) or *top* (*right*)","of the plotting area."].join(" ")},overlaying:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()],role:"info",editType:"calc",description:["If set a same-letter axis id, this axis is overlaid on top of","the corresponding same-letter axis.","If *false*, this axis does not overlay any same-letter axes."].join(" ")},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",role:"info",editType:"plot",description:["Sets the layer on which this axis is displayed.","If *above traces*, this axis is displayed above all the subplot's traces","If *below traces*, this axis is displayed below all the subplot's traces,","but above the grid lines.","Useful when used together with scatter-like traces with `cliponaxis`","set to *false* to show markers and/or text nodes above this axis."].join(" ")},domain:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc",description:["Sets the domain of this axis (in plot fraction)."].join(" ")},position:{valType:"number",min:0,max:1,dflt:0,role:"style",editType:"plot",description:["Sets the position of this axis in the plotting space","(in normalized coordinates).","Only has an effect if `anchor` is set to *free*."].join(" ")},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",role:"info",editType:"calc",description:["Specifies the ordering logic for the case of categorical variables.","By default, plotly uses *trace*, which specifies the order that is present in the data supplied.","Set `categoryorder` to *category ascending* or *category descending* if order should be determined by","the alphanumerical order of the category names.","Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category","is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to","the *trace* mode. The unspecified categories will follow the categories in `categoryarray`."].join(" ")},categoryarray:{valType:"data_array",role:"info",editType:"calc",description:["Sets the order in which categories on this axis appear.","Only has an effect if `categoryorder` is set to *array*.","Used with `categoryorder`."].join(" ")},editType:"calc",_deprecated:{autotick:{valType:"boolean",role:"info",editType:"ticks",description:["Obsolete.","Set `tickmode` to *auto* for old `autotick` *true* behavior.","Set `tickmode` to *linear* for `autotick` *false*."].join(" ")}}}},{536:536,560:560,650:650,710:710,729:729}],717:[function(t,e,n){"use strict";var r=t(779),i=t(661),o=t(537),a=t(755),s=t(710),l=t(716),u=t(727),c=t(707),h=t(711),f=t(719),d=t(708);e.exports=function(t,e,n){function p(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function m(t,e){return i.coerce(F,B,l,t,e)}function v(t){var e={x:D,y:O}[t];return i.simpleMap(e,d.name2id)}var g,y=Object.keys(t),x=[],b=[],_=[],w=[],M=[],k=[],T={},A={};for(g=0;gc[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{107:107,661:661}],720:[function(t,e,n){"use strict";var r=t(634).FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],o=i[0]+(i[1]-i[0])*n;t.range=t._input.range=[t.l2r(o+(i[0]-o)*e),t.l2r(o+(i[1]-o)*e)]}},{634:634}],721:[function(t,e,n){"use strict";function r(t){return t._id}function i(t,e){if(Array.isArray(t))for(var n=e.cd[0].trace,r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&n&&t.range&&2===t.range.length){var r=t.range[0],i=t.range[1];return.5*(r+i-3*w*Math.abs(r-i))}return d}function h(e,n,r){var i=u(e,r||t.calendar);if(i===d){if(!o(e))return d;i=u(new Date(+e))}return i}function v(e,n,r){return l(e,n,r||t.calendar)}function g(e){return t._categories[Math.round(e)]}function y(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(o(e))return+e}function x(e){return o(e)?i.round(t._b+t._m*e,2):d}function b(e){return(e-t._b)/t._m}e=e||{};var _=(t._id||"x").charAt(0),w=10;t.c2l="log"===t.type?n:c,t.l2c="log"===t.type?r:c,t.l2p=x,t.p2l=b,t.c2p="log"===t.type?function(t,e){return x(n(t,e))}:x,t.p2c="log"===t.type?function(t){return r(b(t))}:b,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=b,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return n(s(t),e)},t.r2d=t.r2c=function(t){return r(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=n,t.l2d=r,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return r(b(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=b,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,n,r){return t.l2p(h(e,0,r))},t.p2d=t.p2r=function(t,e,n){return v(b(t),e,n)},t.cleanPos=function(e){return a.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return d},t.r2d=t.c2d=t.l2d=g,t.d2r=t.d2l_noadd=y,t.r2c=function(e){var n=y(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=y,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return g(b(t))},t.r2p=t.d2p,t.p2r=b,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e){e||(e="range");var n,r,i=a.nestedProperty(t,e).get();if(r="date"===t.type?a.dfltRange(t.calendar):"y"===_?p.DFLTRANGEY:p.DFLTRANGEX,r=r.slice(),i&&2===i.length)for("date"===t.type&&(i[0]=a.cleanDate(i[0],d,t.calendar),i[1]=a.cleanDate(i[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!a.isDateTime(i[n],t.calendar)){t[e]=r;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=a.constrain(t.r2l(i[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!o(i[n])){if(!o(i[1-n])){t[e]=r;break}i[n]=i[1-n]*(n?10:.1)}if(i[n]<-f?i[n]=-f:i[n]>f&&(i[n]=f),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}else a.nestedProperty(t,e).set(r)},t.setScale=function(n){var r=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var o=n&&t._r?"_r":"range",s=t.calendar;t.cleanRange(o);var l=t.r2l(t[o][0],s),u=t.r2l(t[o][1],s);if("y"===_?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw a.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,n){var r,i,o,a="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],i=new Array(r.length),o=0;o=t.range[0]&&n<=t.range[1]}:function(e){var n=e.y;return n>=t.range[0]&&n<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{107:107,640:640,661:661,708:708,710:710,98:98}],723:[function(t,e,n){"use strict";function r(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(n){return t[n]===t[e[0]]})||1===e.length)return t[e[0]]}var i=t(661);e.exports=function(t,e,n,o,a){var s=r(t);if(n("tickprefix")&&n("showtickprefix",s),n("ticksuffix")&&n("showticksuffix",s),n("showticklabels")){var l=a.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(n,"tickfont",{family:l.family,size:l.size,color:u}),n("tickangle"),"category"!==o&&(n("tickformat")||"date"===o||(n("showexponent",s),n("exponentformat"),n("separatethousands")))}"category"===o||a.noHover||n("hoverformat")}},{661:661}],724:[function(t,e,n){"use strict";var r=t(661),i=t(716);e.exports=function(t,e,n,o){var a=r.coerce2(t,e,i,"ticklen"),s=r.coerce2(t,e,i,"tickwidth"),l=r.coerce2(t,e,i,"tickcolor",e.color);n("ticks",o.outerTicks||a||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{661:661,716:716}],725:[function(t,e,n){"use strict";var r=t(107),i=t(661),o=t(640).ONEDAY;e.exports=function(t,e,n,a){var s="auto";"array"!==t.tickmode||"log"!==a&&"date"!==a||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=n("tickmode",s);if("auto"===l)n("nticks");else if("linear"===l){var u="date"===a?o:1,c=n("dtick",u);if(r(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);((f=r(f)?Number(f):0)<=0||!("date"===a&&"M"===h&&f===Math.round(f)||"log"===a&&"L"===h||"log"===a&&"D"===h&&(1===f||2===f)))&&(e.dtick=u)}var d="date"===a?i.dateTick0(e.calendar):0,p=n("tick0",d);"date"===a?e.tick0=i.cleanDate(p,d):r(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else void 0===n("tickvals")?e.tickmode="auto":n("ticktext")}},{107:107,640:640,661:661}],726:[function(t,e,n){"use strict";var r=t(98),i=t(700),o=t(779),a=t(561),s=t(705),l=t(710).attrRegex;e.exports=function(t,e,n,u){function c(e,n){function r(e,n,r){for(i=0;i rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,n._offset).call(a.setScale,1,1);var r=t.plot.select(".scatterlayer").selectAll(".points");r.selectAll(".point").call(a.setPointGroupScale,1,1).call(a.hideOutsideRangePoints,t),r.selectAll(".textpoint").call(a.setTextPointsScale,1,1).call(a.hideOutsideRangePoints,t)}function f(e,n){var r,i,o,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){i=(r=t._fullLayout[s.axisName])._r,o=s.to,u[0]=(i[0]*(1-n)+n*o[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],f=o[1]-o[0];r.range[0]=i[0]*(1-n)+n*o[0],r.range[1]=i[1]*(1-n)+n*o[1],u[2]=e.xaxis._length*(1-n+n*f/h)}else u[0]=0,u[2]=e.xaxis._length;if(l){i=(r=t._fullLayout[l.axisName])._r,o=l.to,u[1]=(i[1]*(1-n)+n*o[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=o[1]-o[0];r.range[0]=i[0]*(1-n)+n*o[0],r.range[1]=i[1]*(1-n)+n*o[1],u[3]=e.yaxis._length*(1-n+n*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,g=e.yaxis,x=!!s,b=!!l,_=x?m._length/u[2]:1,w=b?g._length/u[3]:1,M=x?u[0]:0,k=b?u[1]:0,T=x?u[0]/u[2]*m._length:0,A=b?u[1]/u[3]*g._length:0,S=m._offset-T,E=g._offset-A;v._defs.select("#"+e.clipId+"> rect").call(a.setTranslate,M,k).call(a.setScale,1/_,1/w),e.plot.call(a.setTranslate,S,E).call(a.setScale,_,w).selectAll(".points").selectAll(".point").call(a.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(a.setTextPointsScale,1/_,1/w)}function d(){for(var e={},n=0;nn.duration?(d(),k=window.cancelAnimationFrame(m)):k=window.requestAnimationFrame(m)}var v=t._fullLayout,g=[],y=function(t){var e,n,r,i,o={};for(e in t)if((n=e.split("."))[0].match(l)){var a=e.charAt(0),s=n[0];if(r=v[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=r._length,g.push(a),o[a]=i}return o}(e),x=Object.keys(y),b=function(t,e,n){var r,i,o,a=t._plots,s=[];for(r in a){var l=a[r];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=n[u]?n[u].to:h,o=n[c]?n[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===o[0]&&f[1]===o[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(v,x,y);if(!b.length)return function(){function e(e,n,r){for(var i=0;i0?".":"")+i;u.isPlainObject(o)?s(o,e,a,r+1):e(a,i,o)}})}var l=t(700),u=t(661);n.manageCommandObserver=function(t,e,i,o){var a={},s=!0;e&&e._commandObserver&&(a=e._commandObserver),a.cache||(a.cache={}),a.lookupTable={};var l=n.hasSimpleAPICommandBindings(t,i,a.lookupTable);if(e&&e._commandObserver){if(l)return a;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,a}if(l){r(t,l,a.cache),a.check=function(){if(s){var e=r(t,l,a.cache);return e.changed&&o&&void 0!==a.lookupTable[e.value]&&(a.disable(),Promise.resolve(o({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:a.lookupTable[e.value]})).then(a.enable,a.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;hr*Math.PI/180}return!1},n.getPath=function(){return s.geo.path().projection(n)},n.getBounds=function(t){return n.getPath().bounds(t)},n.fitExtent=function(t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),o&&n.clipExtent(null);var a=n.getBounds(e),s=Math.min(r/(a[1][0]-a[0][0]),i/(a[1][1]-a[0][1])),l=+t[0][0]+(r-s*(a[1][0]+a[0][0]))/2,u=+t[0][1]+(i-s*(a[1][1]+a[0][1]))/2;return o&&n.clipExtent(o),n.scale(150*s).translate([l,u])},n.precision(y.precision),r&&n.clipAngle(r-y.clipPad),n}function o(t,e){var n=e[t].dtick,r=y.scopeDefaults[e.scope],i=r.lonaxisRange,o=r.lataxisRange,a="lonaxis"===t?[n]:[0,n];return s.geo.graticule().extent([[i[0],o[0]],[i[1],o[1]]]).step(a)}function a(t,e){var n=y.clipPad,r=t[0]+n,i=t[1]-n,o=e[0]+n,a=e[1]-n;r>0&&i<0&&(i+=360);var s=(i-r)/4;return{type:"Polygon",coordinates:[[[r,o],[r,a],[r+s,a],[r+2*s,a],[r+3*s,a],[i,a],[i,o],[i-s,o],[i-2*s,o],[i-3*s,o],[r,o]]]}}var s=t(98),l=t(700),u=t(661),c=t(537),h=t(561),f=t(578),d=t(764),p=t(705),m=t(558),v=t(721),g=t(738),y=t(731),x=t(686),b=t(1268).feature;t(737)(s);var _=r.prototype;e.exports=function(t){return new r(t)},_.plot=function(t,e,n){var r=this,i=e[this.id],o=x.getTopojsonName(i);null===r.topojson||o!==r.topojsonName?(r.topojsonName=o,void 0===PlotlyGeoAssets.topojson[r.topojsonName]?n.push(r.fetchTopojson().then(function(n){PlotlyGeoAssets.topojson[r.topojsonName]=n,r.topojson=n,r.update(t,e)})):(r.topojson=PlotlyGeoAssets.topojson[r.topojsonName],r.update(t,e))):r.update(t,e)},_.fetchTopojson=function(){var t=x.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(e,n){s.json(t,function(r,i){if(r)return n(404===r.status?new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(i)})})},_.update=function(t,e){var n=e[this.id];if(!this.updateProjection(e,n)){this.hasChoropleth=!1;for(var r=0;r0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!u){var T=c?a.projRotate:[k,0,0];M=n("projection.rotation.lon",T[0]),n("projection.rotation.lat",T[1]),n("projection.rotation.roll",T[2]),n("showcoastlines",!c)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean")&&n("oceancolor")}var A,S;u?(A=-96.6,S=38.7):(A=c?k:M,S=(b[0]+b[1])/2),n("center.lon",A),n("center.lat",S),h&&n("projection.parallels",a.projParallels||[0,60]),n("projection.scale"),n("showland")&&n("landcolor"),n("showlakes")&&n("lakecolor"),n("showrivers")&&(n("rivercolor"),n("riverwidth")),n("showcountries",c&&"usa"!==i)&&(n("countrycolor"),n("countrywidth")),("usa"===i||"north america"===i&&50===r)&&(n("showsubunits",!0),n("subunitcolor"),n("subunitwidth")),c||n("showframe",!0)&&(n("framecolor"),n("framewidth")),n("bgcolor")}var i=t(771),o=t(731),a=t(736),s=o.axesNames;e.exports=function(t,e,n){i(t,e,n,{type:"geo",attributes:a,handleDefaults:r,partition:"y"})}},{731:731,736:736,771:771}],736:[function(t,e,n){"use strict";var r=t(536),i=t(731),o=t(689).overrideAll,a={range:{valType:"info_array",role:"info",items:[{valType:"number"},{valType:"number"}],description:["Sets the range of this axis (in degrees),","sets the map's clipped coordinates."].join(" ")},showgrid:{valType:"boolean",role:"info",dflt:!1,description:"Sets whether or not graticule are shown on the map."},tick0:{valType:"number",role:"info",description:["Sets the graticule's starting tick longitude/latitude."].join(" ")},dtick:{valType:"number",role:"info",description:["Sets the graticule's longitude/latitude tick step."].join(" ")},gridcolor:{valType:"color",role:"style",dflt:r.lightLine,description:["Sets the graticule's stroke color."].join(" ")},gridwidth:{valType:"number",role:"style",min:0,dflt:1,description:["Sets the graticule's stroke width (in px)."].join(" ")}};e.exports=o({domain:{x:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the maximum horizontal domain of this map","(in plot fraction).","Note that geo subplots are constrained by domain.","In general, when `projection.scale` is set to 1.","a map will fit either its x or y domain, but not both. "].join(" ")},y:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the maximum vertical domain of this map","(in plot fraction).","Note that geo subplots are constrained by domain.","In general, when `projection.scale` is set to 1.","a map will fit either its x or y domain, but not both. "].join(" ")}},resolution:{valType:"enumerated",values:[110,50],role:"info",dflt:110,coerceNumber:!0,description:["Sets the resolution of the base layers.","The values have units of km/mm","e.g. 110 corresponds to a scale ratio of 1:110,000,000."].join(" ")},scope:{valType:"enumerated",role:"info",values:Object.keys(i.scopeDefaults),dflt:"world",description:"Set the scope of the map."},projection:{type:{valType:"enumerated",role:"info",values:Object.keys(i.projNames),description:"Sets the projection type."},rotation:{lon:{valType:"number",role:"info",description:["Rotates the map along parallels","(in degrees East).","Defaults to the center of the `lonaxis.range` values."].join(" ")},lat:{valType:"number",role:"info",description:["Rotates the map along meridians","(in degrees North)."].join(" ")},roll:{valType:"number",role:"info",description:["Roll the map (in degrees)","For example, a roll of *180* makes the map appear upside down."].join(" ")}},parallels:{valType:"info_array",role:"info",items:[{valType:"number"},{valType:"number"}],description:["For conic projection types only.","Sets the parallels (tangent, secant)","where the cone intersects the sphere."].join(" ")},scale:{valType:"number",role:"info",min:0,dflt:1,description:["Zooms in or out on the map view.","A scale of *1* corresponds to the largest zoom level","that fits the map's lon and lat ranges. "].join(" ")}},center:{lon:{valType:"number",role:"info",description:["Sets the longitude of the map's center.","By default, the map's longitude center lies at the middle of the longitude range","for scoped projection and above `projection.rotation.lon` otherwise."].join(" ")},lat:{valType:"number",role:"info",description:["Sets the latitude of the map's center.","For all projection types, the map's latitude center lies","at the middle of the latitude range by default."].join(" ")}},showcoastlines:{valType:"boolean",role:"info",description:"Sets whether or not the coastlines are drawn."},coastlinecolor:{valType:"color",role:"style",dflt:r.defaultLine,description:"Sets the coastline color."},coastlinewidth:{valType:"number",role:"style",min:0,dflt:1,description:"Sets the coastline stroke width (in px)."},showland:{valType:"boolean",role:"info",dflt:!1,description:"Sets whether or not land masses are filled in color."},landcolor:{valType:"color",role:"style",dflt:i.landColor,description:"Sets the land mass color."},showocean:{valType:"boolean",role:"info",dflt:!1,description:"Sets whether or not oceans are filled in color."},oceancolor:{valType:"color",role:"style",dflt:i.waterColor,description:"Sets the ocean color"},showlakes:{valType:"boolean",role:"info",dflt:!1,description:"Sets whether or not lakes are drawn."},lakecolor:{valType:"color",role:"style",dflt:i.waterColor,description:"Sets the color of the lakes."},showrivers:{valType:"boolean",role:"info",dflt:!1,description:"Sets whether or not rivers are drawn."},rivercolor:{valType:"color",role:"style",dflt:i.waterColor,description:"Sets color of the rivers."},riverwidth:{valType:"number",role:"style",min:0,dflt:1,description:"Sets the stroke width (in px) of the rivers."},showcountries:{valType:"boolean",role:"info",description:"Sets whether or not country boundaries are drawn."},countrycolor:{valType:"color",role:"style",dflt:r.defaultLine,description:"Sets line color of the country boundaries."},countrywidth:{valType:"number",role:"style",min:0,dflt:1,description:"Sets line width (in px) of the country boundaries."},showsubunits:{valType:"boolean",role:"info",description:["Sets whether or not boundaries of subunits within countries","(e.g. states, provinces) are drawn."].join(" ")},subunitcolor:{valType:"color",role:"style",dflt:r.defaultLine,description:"Sets the color of the subunits boundaries."},subunitwidth:{valType:"number",role:"style",min:0,dflt:1,description:"Sets the stroke width (in px) of the subunits boundaries."},showframe:{valType:"boolean",role:"info",description:"Sets whether or not a frame is drawn around the map."},framecolor:{valType:"color",role:"style",dflt:r.defaultLine,description:"Sets the color the frame."},framewidth:{valType:"number",role:"style",min:0,dflt:1,description:"Sets the stroke width (in px) of the frame."},bgcolor:{valType:"color",role:"style",dflt:r.background,description:"Set the background color of the map"},lonaxis:a,lataxis:a},"plot","from-root")},{536:536,689:689,731:731}],737:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:n(t.geometry,e)}}function n(e,r){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return n(t,r)})};if(!A.hasOwnProperty(e.type))return null;var i=A[e.type];return t.geo.stream(e,r(i)),i.result()}function r(){}function i(t){if((e=t.length)<4)return!1;for(var e,n=0,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++nr^d>r&&n<(f-u)*(r-c)/(d-c)+u&&(i=!i)}return i}function a(t){return t?t/Math.sin(t):1}function s(t){return t>1?L:t<-1?-L:Math.asin(t)}function l(t){return t>1?0:t<-1?C:Math.acos(t)}function u(t,e){var n=(2+L)*Math.sin(e);e/=2;for(var r=0,i=1/0;r<10&&Math.abs(i)>S;r++){var o=Math.cos(e);e-=i=(e+Math.sin(e)*(o+2)-n)/(2*o*(1+o))}return[2/Math.sqrt(C*(4+C))*t*(1+Math.cos(e)),2*Math.sqrt(C/(4+C))*Math.sin(e)]}function c(t,e){function n(n,r){var i=z(n/e,r);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?z:e===1/0?h:(n.invert=function(n,r){var i=z.invert(n/t,r);return i[0]*=e,i},n)}function h(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function f(t,e){return[3*t/(2*C)*Math.sqrt(C*C/3-e*e),e]}function d(t,e){return[t,1.25*Math.log(Math.tan(C/4+.4*e))]}function p(t){return function(e){var n,r=t*Math.sin(e),i=30;do{e-=n=(e+Math.sin(e)-r)/(1+Math.cos(e))}while(Math.abs(n)>S&&--i>0);return e/2}}function m(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function v(t,e){var n,r=Math.min(18,36*Math.abs(e)/C),i=Math.floor(r),o=r-i,a=(n=N[i])[0],s=n[1],l=(n=N[++i])[0],u=n[1],c=(n=N[Math.min(19,++i)])[0],h=n[1];return[t*(l+o*(c-a)/2+o*o*(c-2*l+a)/2),(e>0?L:-L)*(u+o*(h-s)/2+o*o*(h-2*u+s)/2)]}function g(t,e){return[t*Math.cos(e),e]}function y(t,e){var n=Math.cos(e),r=a(l(n*Math.cos(t/=2)));return[2*n*Math.sin(t)*r,Math.sin(e)*r]}function x(t,e){var n=y(t,e);return[(n[0]+t/L)/2,(n[1]+e)/2]}t.geo.project=function(t,e){var r=e.stream;if(!r)throw new Error("not yet supported");return(t&&b.hasOwnProperty(t.type)?b[t.type]:n)(t,r)};var b={Feature:e,FeatureCollection:function(t,n){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,n)})}}},_=[],w=[],M={point:function(t,e){_.push([t,e])},result:function(){var t=_.length?_.length<2?{type:"Point",coordinates:_[0]}:{type:"MultiPoint",coordinates:_}:null;return _=[],t}},k={lineStart:r,point:function(t,e){_.push([t,e])},lineEnd:function(){_.length&&(w.push(_),_=[])},result:function(){var t=w.length?w.length<2?{type:"LineString",coordinates:w[0]}:{type:"MultiLineString",coordinates:w}:null;return w=[],t}},T={polygonStart:r,lineStart:r,point:function(t,e){_.push([t,e])},lineEnd:function(){var t=_.length;if(t){do{_.push(_[0].slice())}while(++t<4);w.push(_),_=[]}},polygonEnd:r,result:function(){if(!w.length)return null;var t=[],e=[];return w.forEach(function(n){i(n)?t.push([n]):e.push(n)}),e.forEach(function(e){var n=e[0];t.some(function(t){if(o(t[0],n))return t.push(e),!0})||t.push([e])}),w=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},A={Point:M,MultiPoint:M,LineString:k,MultiLineString:k,Polygon:T,MultiPolygon:T,Sphere:T},S=1e-6,E=S*S,C=Math.PI,L=C/2,P=(Math.sqrt(C),C/180),I=180/C,O=t.geo.projection,D=t.geo.projectionMutator;t.geo.interrupt=function(e){function n(t,n){for(var r=n<0?-1:1,i=l[+(n<0)],o=0,a=i.length-1;oi[o][2][0];++o);var s=e(t-i[o][1][0],n);return s[0]+=e(i[o][1][0],r*n>r*i[o][0][1]?i[o][0][1]:n)[0],s}function r(){s=l.map(function(t){return t.map(function(t){var n,r=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],o=e(t[1][0],t[0][1])[1],a=e(t[1][0],t[1][1])[1];return o>a&&(n=o,o=a,a=n),[[r,o],[i,a]]})})}function i(){for(var e=1e-6,n=[],r=0,i=l[0].length;r=0;--r){var f=l[1][r],a=180*f[0][0]/C,s=180*f[0][1]/C,u=180*f[1][1]/C,c=180*f[2][0]/C,h=180*f[2][1]/C;n.push(o([[c-e,h-e],[c-e,u+e],[a+e,u+e],[a+e,s-e]],30))}return{type:"Polygon",coordinates:[t.merge(n)]}}function o(t,e){for(var n,r,i,o=-1,a=t.length,s=t[0],l=[];++oS&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},(t.geo.naturalEarth=function(){return O(m)}).raw=m;var N=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];N.forEach(function(t){t[1]*=1.0144}),v.invert=function(t,e){var n=e/L,r=90*n,i=Math.min(18,Math.abs(r/5)),o=Math.max(0,Math.floor(i));do{var a=N[o][1],s=N[o+1][1],l=N[Math.min(19,o+2)][1],u=l-a,c=l-2*s+a,h=2*(Math.abs(n)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===o){r=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(r)/5))-(o=Math.floor(i)),a=N[o][1],s=N[o+1][1],l=N[Math.min(19,o+2)][1],r-=(p=(e>=0?L:-L)*(s+d*(l-a)/2+d*d*(l-2*s+a)/2)-e)*I}while(Math.abs(p)>E&&--m>0);break}}while(--o>=0);var v=N[o][0],g=N[o+1][0],y=N[Math.min(19,o+2)][0];return[t/(g+d*(y-v)/2+d*d*(y-2*g+v)/2),r*P]},(t.geo.robinson=function(){return O(v)}).raw=v,g.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return O(g)}).raw=g,y.invert=function(t,e){if(!(t*t+4*e*e>C*C+S)){var n=t,r=e,i=25;do{var o,a=Math.sin(n),s=Math.sin(n/2),u=Math.cos(n/2),c=Math.sin(r),h=Math.cos(r),f=Math.sin(2*r),d=c*c,p=h*h,m=s*s,v=1-p*u*u,g=v?l(h*u)*Math.sqrt(o=1/v):o=0,y=2*g*h*s-t,x=g*c-e,b=o*(p*m+g*h*u*d),_=o*(.5*a*f-2*g*c*s),w=.25*o*(f*s-g*c*p*a),M=o*(d*u+g*m*h),k=_*w-M*b;if(!k)break;var T=(x*_-y*M)/k,A=(y*w-x*b)/k;n-=T,r-=A}while((Math.abs(T)>S||Math.abs(A)>S)&&--i>0);return[n,r]}},(t.geo.aitoff=function(){return O(y)}).raw=y,x.invert=function(t,e){var n=t,r=e,i=25;do{var o,a=Math.cos(r),s=Math.sin(r),u=Math.sin(2*r),c=s*s,h=a*a,f=Math.sin(n),d=Math.cos(n/2),p=Math.sin(n/2),m=p*p,v=1-h*d*d,g=v?l(a*d)*Math.sqrt(o=1/v):o=0,y=.5*(2*g*a*p+n/L)-t,x=.5*(g*s+r)-e,b=.5*o*(h*m+g*a*d*c)+.5/L,_=o*(f*u/4-g*s*p),w=.125*o*(u*p-g*s*h*f),M=.5*o*(c*d+g*m*a)+.5,k=_*w-M*b,T=(x*_-y*M)/k,A=(y*w-x*b)/k;n-=T,r-=A}while((Math.abs(T)>S||Math.abs(A)>S)&&--i>0);return[n,r]},(t.geo.winkel3=function(){return O(x)}).raw=x}},{}],738:[function(t,e,n){"use strict";function r(t,e){return _.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,n){function r(t,e){var n=w.nestedProperty(s,t);n.get()!==e&&(n.set(e),w.nestedProperty(a,t).set(e),l[i+"."+t]=e)}var i=t.id,o=t.graphDiv,a=o.layout[i],s=o._fullLayout[i],l={};n(r),r("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",l)}function o(t,e){function n(n){var r=e.invert(t.midPt);n("center.lon",r[0]),n("center.lat",r[1])}var o=r(t,e);return o.on("zoomstart",function(){_.select(this).style(T)}).on("zoom",function(){e.scale(_.event.scale).translate(_.event.translate),t.render()}).on("zoomend",function(){_.select(this).style(A),i(t,e,n)}),o}function a(t,e){function n(t){return e.invert(t)}function o(t){var r=e(n(t));return Math.abs(r[0]-t[0])>v||Math.abs(r[1]-t[1])>v}function a(n){var r=e.rotate(),i=e.invert(t.midPt);n("projection.rotation.lon",-r[0]),n("center.lon",i[0]),n("center.lat",i[1])}var s,l,u,c,h,f,d,p,m=r(t,e),v=2;return m.on("zoomstart",function(){_.select(this).style(T),s=_.mouse(this),l=e.rotate(),u=e.translate(),c=l,h=n(s)}).on("zoom",function(){if(f=_.mouse(this),o(s))return m.scale(e.scale()),void m.translate(e.translate());e.scale(_.event.scale),e.translate([u[0],_.event.translate[1]]),h?n(f)&&(p=n(f),d=[c[0]+(p[0]-h[0]),l[1],l[2]],e.rotate(d),c=d):h=n(s=f),t.render()}).on("zoomend",function(){_.select(this).style(A),i(t,e,a)}),m}function s(t,e){function n(t){y++||t({type:"zoomstart"})}function o(t){t({type:"zoom"})}function a(t){--y||t({type:"zoomend"})}function s(t){var n=e.rotate();t("projection.rotation.lon",-n[0]),t("projection.rotation.lat",-n[1])}var d,p={r:e.rotate(),k:e.scale()},m=r(t,e),g=b(m,"zoomstart","zoom","zoomend"),y=0,x=m.on;return m.on("zoomstart",function(){_.select(this).style(T);var t=_.mouse(this),r=e.rotate(),i=r,a=e.translate(),s=u(r);d=l(e,t),x.call(m,"zoom",function(){var n=_.mouse(this);if(e.scale(p.k=_.event.scale),d){if(l(e,n)){e.rotate(r).translate(a);var u=l(e,n),m=h(d,u),y=v(c(s,m)),x=p.r=f(y,d,i);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=i),e.rotate(x),i=x}}else d=l(e,t=n);o(g.of(this,arguments))}),n(g.of(this,arguments))}).on("zoomend",function(){_.select(this).style(A),x.call(m,"zoom",null),a(g.of(this,arguments)),i(t,e,s)}).on("zoom.redraw",function(){t.render()}),_.rebind(m,g,"on")}function l(t,e){var n=t.invert(e);return n&&isFinite(n[0])&&isFinite(n[1])&&g(n)}function u(t){var e=.5*t[0]*M,n=.5*t[1]*M,r=.5*t[2]*M,i=Math.sin(e),o=Math.cos(e),a=Math.sin(n),s=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return[o*s*u+i*a*l,i*s*u-o*a*l,o*a*u+i*s*l,o*s*l-i*a*u]}function c(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=e[2],u=e[3];return[n*a-r*s-i*l-o*u,n*s+r*a+i*u-o*l,n*l-r*u+i*a+o*s,n*u+r*l-i*s+o*a]}function h(t,e){if(t&&e){var n=x(t,e),r=Math.sqrt(y(n,n)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),o=Math.sin(i)/r;return r&&[Math.cos(i),n[2]*o,-n[1]*o,n[0]*o]}}function f(t,e,n){var r=m(e,2,t[0]);r=m(r=m(r,1,t[1]),0,t[2]-n[2]);var i,o,a=e[0],s=e[1],l=e[2],u=r[0],c=r[1],h=r[2],f=Math.atan2(s,a)*k,p=Math.sqrt(a*a+s*s);Math.abs(c)>p?(o=(c>0?90:-90)-f,i=0):(o=Math.asin(c/p)*k-f,i=Math.sqrt(p*p-c*c));var v=180-o-2*f,g=(Math.atan2(h,u)-Math.atan2(l,i))*k,y=(Math.atan2(h,u)-Math.atan2(l,-i))*k;return d(n[0],n[1],o,g)<=d(n[0],n[1],v,y)?[o,g,n[2]]:[v,y,n[2]]}function d(t,e,n,r){var i=p(n-t),o=p(r-e);return Math.sqrt(i*i+o*o)}function p(t){return(t%360+540)%360-180}function m(t,e,n){var r=n*M,i=t.slice(),o=0===e?1:0,a=2===e?1:2,s=Math.cos(r),l=Math.sin(r);return i[o]=t[o]*s-t[a]*l,i[a]=t[a]*s+t[o]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*k,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*k,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*k]}function g(t){var e=t[0]*M,n=t[1]*M,r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function y(t,e){for(var n=0,r=0,i=t.length;rMath.abs(u)?(h.boxEnd[1]=h.boxStart[1]+Math.abs(l)*w*(u>=0?1:-1),h.boxEnd[1]f[3]&&(h.boxEnd[1]=f[3],h.boxEnd[0]=h.boxStart[0]+(f[3]-h.boxStart[1])/Math.abs(w))):(h.boxEnd[0]=h.boxStart[0]+Math.abs(u)/w*(l>=0?1:-1),h.boxEnd[0]f[2]&&(h.boxEnd[0]=f[2],h.boxEnd[1]=h.boxStart[1]+(f[2]-h.boxStart[0])*Math.abs(w)))}}else h.boxEnabled?(l=h.boxStart[0]!==h.boxEnd[0],u=h.boxStart[1]!==h.boxEnd[1],l||u?(l&&(a(0,h.boxStart[0],h.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(1,h.boxStart[1],h.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),h.boxEnabled=!1,h.boxInited=!1):h.boxInited&&(h.boxInited=!1);break;case"pan":h.boxEnabled=!1,h.boxInited=!1,r?(h.panning||(h.dragStart[0]=i,h.dragStart[1]=o),Math.abs(h.dragStart[0]-i)f[p+2]&&(f[p]=-1,f[p+2]=1),(d=this[_[p]])._length=a.viewBox[p+2]-a.viewBox[p],l.doAutoRange(d),d.setScale();x(s),a.ticks=this.computeTickMarks(),a.dataBox=this.calcDataBox(),a.merge(n),r.update(a),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,n=t.range,r=e.range,i=t.r2l,o=e.r2l;return[i(n[0]),o(r[0]),i(n[1]),o(r[1])]},w.setRanges=function(t){var e=this.xaxis,n=this.yaxis,r=e.l2r,i=n.l2r;e.range=[r(t[0]),r(t[2])],n.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var n,r,i,o=Object.keys(this.traces);this.fullData=t;t:for(n=0;nMath.abs(e))u.rotate(o,0,0,-t*n*Math.PI*p.rotateSpeed/window.innerWidth);else{var a=-p.zoomSpeed*i*e/window.innerHeight*(o-u.lastT())/20;u.pan(o,0,0,h*(Math.exp(a)-1))}}},!0),p};var r=t(1234),i=t(9),o=t(452),a=t(455),s=t(453)},{1234:1234,452:452,453:453,455:455,9:9}],744:[function(t,e,n){"use strict";var r=t(689).overrideAll,i=t(579),o=t(754),a=t(764),s=t(661),l=t(642);n.name="gl3d",n.attr="scene",n.idRoot="scene",n.idRegex=n.attrRegex=s.counterRegex("scene"),n.attributes=t(745),n.layoutAttributes=t(750),n.baseLayoutAttrOverrides=r({hoverlabel:i.hoverlabel},"plot","nested"),n.supplyLayoutDefaults=t(749),n.plot=function(t){for(var e=t._fullLayout,n=t._fullData,r=a.getSubplotIds(e,"gl3d"),i=0;i1;s(t,e,n,{type:"gl3d",attributes:u,handleDefaults:r,fullLayout:e,font:e.font,fullData:n,getDfltFromLayout:function(e){if(!o)return i.validate(t[e],u[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{537:537,661:661,747:747,750:750,771:771,779:779}],750:[function(t,e,n){"use strict";function r(t,e,n){return{x:{valType:"number",role:"info",dflt:t,editType:"camera"},y:{valType:"number",role:"info",dflt:e,editType:"camera"},z:{valType:"number",role:"info",dflt:n,editType:"camera"},editType:"camera"}}var i=t(746),o=t(650).extendFlat,a=t(661).counterRegex;e.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",role:"style",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:o(r(0,0,1),{description:["Sets the (x,y,z) components of the 'up' camera vector.","This vector determines the up direction of this scene","with respect to the page.","The default is *{x: 0, y: 0, z: 1}* which means that","the z axis points up."].join(" ")}),center:o(r(0,0,0),{description:["Sets the (x,y,z) components of the 'center' camera vector","This vector determines the translation (x,y,z) space","about the center of this scene.","By default, there is no such translation."].join(" ")}),eye:o(r(1.25,1.25,1.25),{description:["Sets the (x,y,z) components of the 'eye' camera vector.","This vector determines the view point about the origin","of this scene."].join(" ")}),editType:"camera"},domain:{x:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot",description:["Sets the horizontal domain of this scene","(in plot fraction)."].join(" ")},y:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot",description:["Sets the vertical domain of this scene","(in plot fraction)."].join(" ")},editType:"plot"},aspectmode:{valType:"enumerated",role:"info",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0},description:["If *cube*, this scene's axes are drawn as a cube,","regardless of the axes' ranges.","If *data*, this scene's axes are drawn","in proportion with the axes' ranges.","If *manual*, this scene's axes are drawn","in proportion with the input of *aspectratio*","(the default behavior if *aspectratio* is provided).","If *auto*, this scene's axes are drawn","using the results of *data* except when one axis","is more than four times the size of the two others,","where in that case the results of *cube* are used."].join(" ")},aspectratio:{x:{valType:"number",role:"info",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",role:"info",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",role:"info",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"},description:["Sets this scene's axis aspectratio."].join(" ")},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",role:"info",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot",description:["Determines the mode of drag interactions for this scene."].join(" ")},hovermode:{valType:"enumerated",role:"info",values:["closest",!1],dflt:"closest",editType:"modebar",description:["Determines the mode of hover interactions for this scene."].join(" ")},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",role:"info",editType:"camera",description:"Obsolete. Use `camera` instead."}}}},{650:650,661:661,746:746}],751:[function(t,e,n){"use strict";function r(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var i=t(682),o=["xaxis","yaxis","zaxis"];r.prototype.merge=function(t){for(var e=0;e<3;++e){var n=t[o[e]];n.visible?(this.enabled[e]=n.showspikes,this.colors[e]=i(n.spikecolor),this.drawSides[e]=n.spikesides,this.lineWidth[e]=n.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new r;return e.merge(t),e}},{682:682}],752:[function(t,e,n){"use strict";function r(t){for(var e=new Array(3),n=0;n<3;++n){for(var r=t[n],i=new Array(r.length),o=0;of[1][a]?d[a]=1:f[1][a]===f[0][a]?d[a]=1:d[a]=1/(f[1][a]-f[0][a]);for(this.dataScale=d,this.convertAnnotations(this),o=0;om[1][o])m[0][o]=-1,m[1][o]=1;else{var T=m[1][o]-m[0][o];m[0][o]-=T/32,m[1][o]+=T/32}}else{var S=l.range;m[0][o]=l.r2l(S[0]),m[1][o]=l.r2l(S[1])}m[0][o]===m[1][o]&&(m[0][o]-=1,m[1][o]+=1),v[o]=m[1][o]-m[0][o],this.glplot.bounds[0][o]=m[0][o]*d[o],this.glplot.bounds[1][o]=m[1][o]*d[o]}var E=[1,1,1];for(o=0;o<3;++o){var C=g[u=(l=c[A[o]]).type];E[o]=Math.pow(C.acc,1/C.count)/d[o]}var L;if("auto"===c.aspectmode)L=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===c.aspectmode)L=[1,1,1];else if("data"===c.aspectmode)L=E;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=c.aspectratio;L=[P.x,P.y,P.z]}c.aspectratio.x=h.aspectratio.x=L[0],c.aspectratio.y=h.aspectratio.y=L[1],c.aspectratio.z=h.aspectratio.z=L[2],this.glplot.aspect=L;var I=c.domain||null,O=e._size||null;if(I&&O){var D=this.container.style;D.position="absolute",D.left=O.l+I.x[0]*O.w+"px",D.top=O.t+(1-I.y[1])*O.h+"px",D.width=O.w*(I.x[1]-I.x[0])+"px",D.height=O.h*(I.y[1]-I.y[0])+"px"}this.glplot.redraw()}},T.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},T.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},T.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},T.saveCamera=function(t){var e=this.getCamera(),n=m.nestedProperty(t,this.id+".camera"),r=n.get(),i=!1;if(void 0===r)i=!0;else for(var o=0;o<3;o++)for(var a=0;a<3;a++)if(!function(t,e,n,r){var i=["up","center","eye"],o=["x","y","z"];return e[i[n]]&&t[i[n]][o[r]]===e[i[n]][o[r]]}(e,r,o,a)){i=!0;break}return i&&n.set(e),i},T.updateFx=function(t,e){var n=this.camera;n&&("orbit"===t?(n.mode="orbit",n.keyBindingMode="rotate"):"turntable"===t?(n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate"):n.keyBindingMode=t),this.fullSceneLayout.hovermode=e},T.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,n=e.drawingBufferWidth,r=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(n*r*4);e.readPixels(0,0,n,r,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,a=r-1;o0}function o(t){var e={},n={};switch(t.type){case"circle":s.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var r=t.symbol,i=l(r.textposition,r.iconsize);s.extendFlat(e,{"icon-image":r.icon+"-15","icon-size":r.iconsize/10,"text-field":r.text,"text-size":r.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(n,{"icon-color":t.color,"text-color":r.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:n}}function a(t){var e,n=t.sourcetype,r=t.source,i={type:n},o="string"==typeof r;return"geojson"===n?e="data":"vector"===n&&(e=o?"url":"tiles"),i[e]=r,i}var s=t(661),l=t(757),u=r.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var n=a(t);e.addSource(this.idSource,n)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var n={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",n)}},u.updateStyle=function(t){var e=o(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,n){var i=new r(t,e);return i.update(n),i}},{661:661,757:757}],760:[function(t,e,n){"use strict";var r=t(661),i=t(537).defaultLine,o=t(729),a=t(964).textposition,s=t(689).overrideAll,l=o({description:["Sets the icon text font.","Has an effect only when `type` is set to *symbol*."].join(" ")});l.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:{x:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the horizontal domain of this subplot","(in plot fraction)."].join(" ")},y:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the vertical domain of this subplot","(in plot fraction)."].join(" ")}},accesstoken:{valType:"string",noBlank:!0,strict:!0,role:"info",description:["Sets the mapbox access token to be used for this mapbox map.","Alternatively, the mapbox access token can be set in the","configuration options under `mapboxAccessToken`."].join(" ")},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic",role:"style",description:["Sets the Mapbox map style.","Either input one of the default Mapbox style names or the URL to a custom style","or a valid Mapbox style JSON."].join(" ")},center:{lon:{valType:"number",dflt:0,role:"info",description:"Sets the longitude of the center of the map (in degrees East)."},lat:{valType:"number",dflt:0,role:"info",description:"Sets the latitude of the center of the map (in degrees North)."}},zoom:{valType:"number",dflt:1,role:"info",description:"Sets the zoom level of the map."},bearing:{valType:"number",dflt:0,role:"info",description:"Sets the bearing angle of the map (in degrees counter-clockwise from North)."},pitch:{valType:"number",dflt:0,role:"info",description:["Sets the pitch angle of the map","(in degrees, where *0* means perpendicular to the surface of the map)."].join(" ")},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson",role:"info",description:["Sets the source type for this layer.","Support for *raster*, *image* and *video* source types is coming soon."].join(" ")},source:{valType:"any",role:"info",description:["Sets the source data for this layer.","Source can be either a URL,","a geojson object (with `sourcetype` set to *geojson*)","or an array of tile URLS (with `sourcetype` set to *vector*)."].join(" ")},sourcelayer:{valType:"string",dflt:"",role:"info",description:["Specifies the layer to use from a vector tile source.","Required for *vector* source type that supports multiple layers."].join(" ")},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle",role:"info",description:["Sets the layer type.","Support for *raster*, *background* types is coming soon.","Note that *line* and *fill* are not compatible with Point","GeoJSON geometries."].join(" ")},below:{valType:"string",dflt:"",role:"info",description:["Determines if the layer will be inserted","before the layer with the specified ID.","If omitted or set to '',","the layer will be inserted above every existing layer."].join(" ")},color:{valType:"color",dflt:i,role:"style",description:["Sets the primary layer color.","If `type` is *circle*, color corresponds to the circle color","If `type` is *line*, color corresponds to the line color","If `type` is *fill*, color corresponds to the fill color","If `type` is *symbol*, color corresponds to the icon color"].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,role:"info",description:"Sets the opacity of the layer."},circle:{radius:{valType:"number",dflt:15,role:"style",description:["Sets the circle radius.","Has an effect only when `type` is set to *circle*."].join(" ")}},line:{width:{valType:"number",dflt:2,role:"style",description:["Sets the line width.","Has an effect only when `type` is set to *line*."].join(" ")}},fill:{outlinecolor:{valType:"color",dflt:i,role:"style",description:["Sets the fill outline color.","Has an effect only when `type` is set to *fill*."].join(" ")}},symbol:{icon:{valType:"string",dflt:"marker",role:"style",description:["Sets the symbol icon image.","Full list: https://www.mapbox.com/maki-icons/"].join(" ")},iconsize:{valType:"number",dflt:10,role:"style",description:["Sets the symbol icon size.","Has an effect only when `type` is set to *symbol*."].join(" ")},text:{valType:"string",dflt:"",role:"info",description:["Sets the symbol text."].join(" ")},textfont:l,textposition:r.extendFlat({},a,{arrayOk:!1})}}},"plot","from-root")},{537:537,661:661,689:689,729:729,964:964}],761:[function(t,e,n){"use strict";function r(t,e,n){n("accesstoken"),n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch"),i(t,e),e._input=t}function i(t,e){function n(t,e){return o.coerce(r,i,s.layers,t,e)}for(var r,i,a=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),n.attr(o);var a=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),u=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&r(t,a),s.text(a.text()&&u.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=l.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return r.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},o=t.layout||{},a=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||v.createTransitionData(t),n._initialAutoSizeIsDone){var u=n.width,h=n.height;v.supplyLayoutGlobalDefaults(o,r),o.width||(r.width=u),o.height||(r.height=h)}else{v.supplyLayoutGlobalDefaults(o,r);var f=!o.width||!o.height,d=r.autosize,p=t._context&&t._context.autosizable;f&&(d||p)?v.plotAutoSize(t,o,r):f&&v.sanitizeMargins(t),!d&&f&&(o.width=r.width,o.height=r.height)}r._initialAutoSizeIsDone=!0,r._dataLength=l.length,r._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(l,s,o,r),r._has=v._hasPlotType.bind(r);var m=r._modules;for(e=0;e0){var c=a(t._boundingBoxMargins),h=c.left+c.right,f=c.bottom+c.top,p=1-2*s,m=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(p*(m.width-h)),i=Math.round(p*(m.height-f))}else{var g=l?window.getComputedStyle(t):{};r=parseFloat(g.width)||n.width,i=parseFloat(g.height)||n.height}var y=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;r1,_=!e.height&&Math.abs(n.height-i)>1;(_||b)&&(b&&(n.width=r),_&&(n.height=i)),t._initialAutoSize||(t._initialAutoSize={width:r,height:i}),v.sanitizeMargins(n)},v.supplyLayoutModuleDefaults=function(t,e,n,r){var i,o;c.Axes.supplyLayoutDefaults(t,e,n);var a=e._basePlotModules;for(i=0;i.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+i},r:{val:n.x,size:n.r+i},b:{val:n.y,size:n.b+i},t:{val:n.y,size:n.t+i}}}else delete r._pushmargin[e];r._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),i=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),a=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(!1!==e.margin.autoexpand){l.base={l:{val:0,size:i},r:{val:1,size:o},t:{val:1,size:a},b:{val:0,size:s}};for(var h=Object.keys(l),f=0;fv){var k=(g*w+(M-e.width)*v)/(w-v),T=(M*(1-v)+(g-e.width)*(1-w))/(w-v);k>=0&&T>=0&&k+T>i+o&&(i=k,o=T)}}if(u(x)&&l[_].t){var A=l[_].t.val,S=l[_].t.size;if(A>y){var E=(x*A+(S-e.height)*y)/(A-y),C=(S*(1-y)+(x-e.height)*(1-A))/(A-y);E>=0&&C>=0&&E+C>s+a&&(s=E,a=C)}}}}if(n.l=Math.round(i),n.r=Math.round(o),n.t=Math.round(a),n.b=Math.round(s),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!e._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return c.plot(t)},v.graphJson=function(t,e,n,r,i){function o(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,r,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if("string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==n&&"string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0)continue;i[e]=o(t[e])}return i}return Array.isArray(t)?t.map(o):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var a=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(a||[]).map(function(t){var n=o(t);return e&&delete n.fit,n})};return e||(u.layout=o(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=o(l)),"object"===r?u:JSON.stringify(u)},v.modifyFrames=function(t,e){var n,r,i,o=t._transitionData._frames,a=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){g=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var a,s,u=0,h=0,f=t._fullLayout._basePlotModules,p=!1;if(n)for(s=0;s=0?f.angularAxis.domain:r.extent(M),E=Math.abs(M[1]-M[0]);T&&!k&&(E=0);var C=S.slice();A&&k&&(C[1]+=E);var L=f.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),f.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var P=f.angularAxis.ticksStep||(C[1]-C[0])/(L*(f.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),C[2]||(C[2]=P);var I=r.range.apply(this,C);if(I=I.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=r.scale.linear().domain(C.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),h.layout.angularAxis.domain=l.domain(),h.layout.angularAxis.endPadding=A?E:0,void 0===(e=r.select(this).select("svg.chart-root"))||e.empty()){var O=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),D=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=r.select(D)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var z,j=e.select(".chart-group"),N={fill:"none",stroke:f.tickColor},R={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){z=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var F=p.map(function(t,e){var n=a.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});a.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},a.Legend.defaultConfig().legendConfig,{container:z,elements:F,reverseOrder:f.legend.reverseOrder})})();var B=z.node().getBBox();x=Math.min(f.width-B.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],s.range([0,x]),h.layout.radialAxis.domain=s.domain(),z.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else z=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),j.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(f.width-(f.margin.left+f.margin.right+2*x+(B?B.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),e.select(".outer-group").attr("transform","translate("+U+")"),f.title){var V=e.select("g.title-group text").style(R).text(f.title),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-x-20})}var q=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var W=q.selectAll("circle.grid-circle").data(s.ticks(5));W.enter().append("circle").attr({class:"grid-circle"}).style(N),W.attr("r",s),W.exit().remove()}q.select("circle.outside-circle").attr({r:x}).style(N);var G=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Y=r.svg.axis().scale(s).ticks(5).tickSize(5);q.call(Y).attr({transform:"rotate("+f.radialAxis.orientation+")"}),q.selectAll(".domain").style(N),q.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(R).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,R["font-size"]]+")":"translate("+[0,R["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var X=e.select(".angular.axis-group").selectAll("g.angular-tick").data(I),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+u(t)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(N),Z.selectAll(".minor").style({stroke:f.minorTickColor}),X.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(R);var K=X.select("text.axis-text").attr({x:x+f.labelOffset,dy:o+"em",transform:function(t,e){var n=u(t),r=x+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-n+" "+r+" 0)":"radial"==i?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(R);f.angularAxis.rewriteTicks&&K.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var J=r.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));z.attr({transform:"translate("+[x+J,f.margin.top]+")"});var $=e.select("g.geometry-group").selectAll("g").size()>0,Q=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(Q.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),Q.exit().remove(),p[0]||$){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=s,n.angularScale=l,n.container=Q.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];r.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return i(a[n].defaultConfig(),t)});a[n]().config(r)()})}var nt,rt,it=e.select(".guides-group"),ot=e.select(".tooltips-group"),at=a.tooltipPanel().config({container:ot,fontSize:8})(),st=a.tooltipPanel().config({container:ot,fontSize:8})(),lt=a.tooltipPanel().config({container:ot,hasTick:!0})();if(!k){var ut=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var n=a.util.getMousePos(G).angle;ut.attr({x2:-x,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-f.orientation)%360;nt=l.invert(r);var i=a.util.convertToCartesian(x+12,n+180);at.text(a.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ct=it.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var n=a.util.getMousePos(G).radius;ct.attr({r:n}).style({opacity:.5}),rt=s.invert(a.util.getMousePos(G).radius);var r=a.util.convertToCartesian(n,f.radialAxis.orientation);st.text(a.util.round(rt)).move([r[0]+_[0],r[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ct.style({opacity:0}),lt.hide(),at.hide(),st.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var i=r.select(this),o=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),o&&"none"!==o){i.attr({"data-fill":o}),s=r.hsl(o).darker().toString(),i.style({fill:s,opacity:1});var u={t:a.util.round(t[0]),r:a.util.round(t[1])};k&&(u.t=w[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-U[0]-f.left,h.top+h.height/2-U[1]-f.top];lt.config({color:s}).text(c),lt.move(d)}else o=this.style.stroke||"black",i.attr({"data-stroke":o}),s=r.hsl(o).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=r.event.which)return!1;r.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var n=r.select(this),i=n.attr("data-fill");i?n.style({fill:i,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),d}var e,n,s,l,u={data:[],layout:{}},c={},h={},f=r.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return u;var e=a.util.cloneJson(t);return e.data.forEach(function(t,e){u.data[e]||(u.data[e]={}),i(u.data[e],a.Axis.defaultConfig().data[0]),i(u.data[e],t)}),i(u.layout,a.Axis.defaultConfig().layout),i(u.layout,e.layout),this},d.getLiveConfig=function(){return h},d.getinputConfig=function(){return c},d.radialScale=function(t){return s},d.angularScale=function(t){return l},d.svg=function(){return e},r.rebind(d,f,"on"),d},a.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:r.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},a.util={},a.DATAEXTENT="dataExtent",a.AREA="AreaChart",a.LINE="LinePlot",a.DOT="DotPlot",a.BAR="BarChart",a.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},a.util._extend=function(t,e){for(var n in t)e[n]=t[n]},a.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},a.util.dataFromEquation2=function(t,e){var n=e||6;return r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180;return[e,t(r)]})},a.util.dataFromEquation=function(t,e,n){var i=e||6,o=[],a=[];r.range(0,360+i,i).forEach(function(e,n){var r=e*Math.PI/180,i=t(r);o.push(e),a.push(i)});var s={t:o,r:a};return n&&(s.name=n),s},a.util.ensureArray=function(t,e){if(void 0===t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},a.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=a.util.ensureArray(t[e],n)}),t},a.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},a.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},a.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},a.util.arrayLast=function(t){return t[t.length-1]},a.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},a.util.flattenArray=function(t){for(var e=[];!a.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},a.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},a.util.convertToCartesian=function(t,e){var n=e*Math.PI/180;return[t*Math.cos(n),t*Math.sin(n)]},a.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},a.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],i=e[1],o={};return o.x=n,o.y=i,o.pos=e,o.angle=180*(Math.atan2(i,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+i*i),o},a.util.duplicatesCount=function(t){for(var e,n={},r={},i=0,o=t.length;i0)){var s=r.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(a),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(n,i,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(n,i,o)},"stroke-width":function(t,e){return v["stroke-width"](n,i,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](n,i,o)},opacity:function(t,e){return v.opacity(n,i,o)},display:function(t,e){return v.display(n,i,o)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=r.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,n,i){r.select(this).attr({class:"mark arc",d:m,transform:function(e,n){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return o[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return void 0===e[r].data.visible||e[r].data.visible?"block":"none"}},g=r.select(this).selectAll("g.layer").data(l);g.enter().append("g").attr({class:"layer"});var y=g.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(h[t.geometryType]),y.exit().remove(),g.exit().remove()})}var e=[a.PolyChart.defaultConfig()],n=r.dispatch("hover"),o={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,n){e[n]||(e[n]={}),i(e[n],a.PolyChart.defaultConfig()),i(e[n],t)}),this):e},t.getColorScale=function(){},r.rebind(t,n,"on"),t},a.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:r.scale.category20()}}},a.BarChart=function(){return a.PolyChart()},a.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},a.AreaChart=function(){return a.PolyChart()},a.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},a.DotPlot=function(){return a.PolyChart()},a.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},a.LinePlot=function(){return a.PolyChart()},a.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},a.Legend=function(){function t(){var n=e.legendConfig,o=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var o=i({},n.elements[e]);return o.name=t,o.color=[].concat(n.elements[e].color)[r],o})}),a=r.merge(o);a=a.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||void 0===n.elements[e].visibleInLegend)}),n.reverseOrder&&(a=a.reverse());var s=n.container;("string"==typeof s||s.nodeName)&&(s=r.select(s));var l=a.map(function(t,e){return t.color}),u=n.fontSize,c=null==n.isContinuous?"number"==typeof a[0]:n.isContinuous,h=c?n.height:u*a.length,f=s.classed("legend-group",!0).selectAll("svg").data([0]),d=f.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=r.range(a.length),m=r.scale[c?"linear":"ordinal"]().domain(p).range(l),v=r.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,h]),g=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=r.svg.symbolTypes.indexOf(t)?r.svg.symbol().type(t).size(n)():r.svg.symbol().type("square").size(n)()};if(c){var y=f.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),f.append("rect").classed("legend-mark",!0).attr({height:n.height,width:n.colorBandWidth,fill:"url(#grad1)"})}else{var x=f.select(".legend-marks").selectAll("path.legend-mark").data(a);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var n=t.symbol;return g(n,u)},fill:function(t,e){return m(e)}}),x.exit().remove()}var b=r.svg.axis().scale(v).orient("right"),_=f.select("g.legend-axis").attr({transform:"translate("+[c?n.colorBandWidth:u,u/2]+")"}).call(b);return _.selectAll(".domain").style({fill:"none",stroke:"none"}),_.selectAll("line").style({fill:"none",stroke:c?n.textColor:"none"}),_.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return a[e].name}),t}var e=a.Legend.defaultConfig(),n=r.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},r.rebind(t,n,"on"),t},a.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},a.tooltipPanel=function(){var t,e,n,o={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+a.tooltipPanel.uid++,l=function(){var r=(t=o.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:o.padding+10,dy:.3*+o.fontSize}),l};return l.text=function(i){var a=r.hsl(o.color).l,s=a>=.5?"#aaa":"white",u=a>=.5?"black":"white",c=i||"";e.style({fill:u,"font-size":o.fontSize+"px"}).text(c);var h=o.padding,f=e.node().getBBox(),d={fill:o.color,stroke:s,"stroke-width":"2px"},p=f.width+2*h+10,m=f.height+2*h;return n.attr({d:"M"+[[10,-m/2],[10,-m/4],[o.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-m/2+2*h]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return i(o,t),l},l},a.tooltipPanel.uid=1,a.adapter={},a.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=i({},t);return[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]].forEach(function(t,n){a.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",!0===r.dotVisible?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var o=a.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=o.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,n){a.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};r.entries(s.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),s.margin=c}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),n.layout=s}return n},t}},{634:634,661:661,98:98}],769:[function(t,e,n){"use strict";var r=t(98),i=t(661),o=t(537),a=t(768),s=t(770),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(h=i),r.select(r.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),n=n?l(n,e):e,o||(o=a.Axis()),c=a.adapter.plotly().convert(n),o.config(c).render(h),t.data=n.data,t.layout=n.layout,u.fillLayout(t),n}var n,i,o,c,h,f=new s;return e.isPolar=!0,e.svg=function(){return o.svg()},e.getConfig=function(){return n},e.getLiveConfig=function(){return a.adapter.plotly().convert(o.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:o.angularScale(),r:o.radialScale()}},e.setUndoPoint=function(){var t=this,e=a.util.cloneJson(n);!function(e,n){f.add({undo:function(){n&&t(n)},redo:function(){t(e)}})}(e,i),i=a.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},u.fillLayout=function(t){var e=r.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),a={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:n,_paper:i};t._fullLayout=l(a,t.layout)}},{537:537,661:661,768:768,770:770,98:98}],770:[function(t,e,n){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,n=[],r=-1,i=!1;return{add:function(t){return i?this:(n.splice(r+1,n.length-r),n.push(t),r=n.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=n[r];return i?(t(i,"undo"),r-=1,e&&e(i.undo),this):this},redo:function(){var i=n[r+1];return i?(t(i,"redo"),r+=1,e&&e(i.redo),this):this},clear:function(){n=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r=a&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t(537),o=t(771),a=t(777),s=t(775),l=["aaxis","baxis","caxis"];e.exports=function(t,e,n){o(t,e,n,{type:"ternary",attributes:a,handleDefaults:r,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{537:537,771:771,775:775,777:777}],777:[function(t,e,n){"use strict";var r=t(536),i=t(774),o=t(689).overrideAll;e.exports=o({domain:{x:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the horizontal domain of this subplot","(in plot fraction)."].join(" ")},y:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the vertical domain of this subplot","(in plot fraction)."].join(" ")}},bgcolor:{valType:"color",role:"style",dflt:r.background,description:"Set the background color of the subplot"},sum:{valType:"number",role:"info",dflt:1,min:0,description:["The number each triplet should sum to,","and the maximum range of each axis"].join(" ")},aaxis:i,baxis:i,caxis:i},"plot","from-root")},{536:536,689:689,774:774}],778:[function(t,e,n){"use strict";function r(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t(98),a=t(1266),s=t(700),l=t(661),u=t(537),c=t(561),h=t(722),f=t(650).extendFlat,d=t(764),p=t(705),m=t(558),v=t(578),g=t(627),y=t(721),x=t(710);e.exports=r;var b=r.prototype;b.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},b.plot=function(t,e){var n=this,r=e[n.id],i=e._size;n._hasClipOnAxisFalse=!1;for(var o=0;o_*x?i=(o=x)*_:o=(i=y)/_,a=v*i/y,s=g*o/x,n=e.l+e.w*p-i/2,r=e.t+e.h*(1-m)-o/2,l.x0=n,l.y0=r,l.w=i,l.h=o,l.sum=b,l.xaxis={type:"linear",range:[w+2*k-b,b-w-2*M],domain:[p-a/2,p+a/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[w,b-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var T=l.yaxis.domain[0],A=l.aaxis=f({},t.aaxis,{visible:!0,range:[w,b-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+o+",-"+i/2});h(A,l.graphDiv._fullLayout),A.setScale();var S=l.baxis=f({},t.baxis,{visible:!0,range:[b-w-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+o});h(S,l.graphDiv._fullLayout),S.setScale(),A._counteraxis=S;var E=l.caxis=f({},t.caxis,{visible:!0,range:[b-w-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+o+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var C="M"+n+","+(r+o)+"h"+i+"l-"+i/2+",-"+o+"Z";l.clipDef.select("path").attr("d",C),l.layers.plotbg.select("path").attr("d",C);var L="M0,"+o+"h"+i+"l-"+i/2+",-"+o+"Z";l.clipDefRelative.select("path").attr("d",L);var P="translate("+n+","+r+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),l.clipDefRelative.select("path").attr("transform",null);var I="translate("+n+","+(r+o)+")";l.layers.baxis.attr("transform",I),l.layers.bgrid.attr("transform",I);var O="translate("+(n+i/2)+","+r+")rotate(30)";l.layers.aaxis.attr("transform",O),l.layers.agrid.attr("transform",O);var D="translate("+(n+i/2)+","+r+")rotate(-30)";l.layers.caxis.attr("transform",D),l.layers.cgrid.attr("transform",D),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",A.showline?"M"+n+","+(r+o)+"l"+i/2+",-"+o:"M0,0").call(u.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+n+","+(r+o)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(n+i/2)+","+r+"l"+i/2+","+o:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),c.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},b.drawAxes=function(t){var e=this,n=e.graphDiv,r=e.id.substr(7)+"title",i=e.aaxis,o=e.baxis,a=e.caxis;if(p.doTicks(n,i,!0),p.doTicks(n,o,!0),p.doTicks(n,a,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));g.draw(n,"a"+r,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;g.draw(n,"b"+r,{propContainer:o,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}}),g.draw(n,"c"+r,{propContainer:a,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}})}};var w=x.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",k="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",T="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",A="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",S=!0;b.initInteractions=function(){function t(t,e,n){var r=R.getBoundingClientRect();w=e-r.left,E=n-r.top,C={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},P=C,L=N.aaxis.range[1]-C.a,I=a(N.graphDiv._fullLayout[N.id].bgcolor).getLuminance(),O="M0,"+N.h+"L"+N.w/2+", 0L"+N.w+","+N.h+"Z",D=!1,z=B.append("path").attr("class","zoombox").attr("transform","translate("+N.x0+", "+N.y0+")").style({fill:I>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",O),j=B.append("path").attr("class","zoombox-corners").attr("transform","translate("+N.x0+", "+N.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),g()}function e(t,e){return 1-e/N.h}function n(t,e){return 1-(t+(N.h-e)/Math.sqrt(3))/N.w}function r(t,e){return(t-(N.h-e)/Math.sqrt(3))/N.w}function o(t,i){var o=w+t,a=E+i,s=Math.max(0,Math.min(1,e(w,E),e(o,a))),l=Math.max(0,Math.min(1,n(w,E),n(o,a))),u=Math.max(0,Math.min(1,r(w,E),r(o,a))),c=(s/2+u)*N.w,h=(1-s/2-l)*N.w,f=(c+h)/2,d=h-c,p=(1-s)*N.h,m=p-d/_;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),j.transition().style("opacity",1).duration(200),D=!0)}function h(t,e){if(P===C)return 2===e&&b(),i(F);i(F);var n={};n[N.id+".aaxis.min"]=P.a,n[N.id+".baxis.min"]=P.b,n[N.id+".caxis.min"]=P.c,s.relayout(F,n),S&&F.data&&F._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),S=!1)}function f(){C={a:N.aaxis.range[0],b:N.baxis.range[1],c:N.caxis.range[1]},P=C}function d(t,e){var n=t/N.xaxis._m,r=e/N.yaxis._m,i=[(P={a:C.a-r,b:C.b+(n+r)/2,c:C.c-(n-r)/2}).a,P.b,P.c].sort(),o={a:i.indexOf(P.a),b:i.indexOf(P.b),c:i.indexOf(P.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),P={a:i[o.a],b:i[o.b],c:i[o.c]},e=(C.a-P.a)*N.yaxis._m,t=(C.c-P.c-C.b+P.b)*N.xaxis._m);var a="translate("+(N.x0+t)+","+(N.y0+e)+")";N.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",a);var s="translate("+-t+","+-e+")";if(N.clipDefRelative.select("path").attr("transform",s),N.aaxis.range=[P.a,N.sum-P.b-P.c],N.baxis.range=[N.sum-P.a-P.c,P.b],N.caxis.range=[N.sum-P.a-P.b,P.c],N.drawAxes(!1),N.plotContainer.selectAll(".crisp").classed("crisp",!1),N._hasClipOnAxisFalse){var l=N.plotContainer.select(".scatterlayer").selectAll(".points");l.selectAll(".point").call(c.hideOutsideRangePoints,N),l.selectAll(".textpoint").call(c.hideOutsideRangePoints,N)}}function p(t,e){if(t){var n={};n[N.id+".aaxis.min"]=P.a,n[N.id+".baxis.min"]=P.b,n[N.id+".caxis.min"]=P.c,s.relayout(F,n)}else 2===e&&b()}function g(){B.selectAll(".select-outline").remove()}function b(){var t={};t[N.id+".aaxis.min"]=0,t[N.id+".baxis.min"]=0,t[N.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),s.relayout(F,t)}var w,E,C,L,P,I,O,D,z,j,N=this,R=N.layers.plotbg.select("path").node(),F=N.graphDiv,B=F._fullLayout._zoomlayer,U={element:R,gd:F,plotinfo:{xaxis:N.xaxis,yaxis:N.yaxis},doubleclick:b,subplot:N.id,prepFn:function(e,n,r){U.xaxes=[N.xaxis],U.yaxes=[N.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),U.minDrag="lasso"===i?1:void 0,"zoom"===i?(U.moveFn=o,U.doneFn=h,t(0,n,r)):"pan"===i?(U.moveFn=d,U.doneFn=p,f(),g()):"select"!==i&&"lasso"!==i||y(e,n,r,U,i)}};R.onmousemove=function(t){v.hover(F,t,N.id),F._fullLayout._lasthover=R,F._fullLayout._hoversubplot=N.id},R.onmouseout=function(t){F._dragging||m.unhover(F,t)},R.onclick=function(t){v.click(F,t,N.id)},m.init(U)}},{1266:1266,537:537,558:558,561:561,578:578,627:627,650:650,661:661,700:700,705:705,710:710,721:721,722:722,764:764,98:98}],779:[function(t,e,n){"use strict";function r(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var r=0;r-1}var o=t(661),a=t(764),s=o.extendFlat,l=o.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,o=t.data,u=t.layout,c=l([],o),h=l({},u,r(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var d=Object.keys(h);for(n=0;n")?"":e.html(t).text()});return e.remove(),n}function i(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var o=t(98),a=t(661),s=t(561),l=t(537),u=t(642),c=/"/g,h=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,n){var f,d=t._fullLayout,p=d._paper,m=d._toppaper,v=d.width,g=d.height;p.insert("rect",":first-child").call(s.setRect,0,0,v,g).call(l.fill,d.paper_bgcolor);var y=d._basePlotModules||[];for(f=0;f0&&T>0,R=M<=z&&T<=j,F=M<=j&&T<=z,B="h"===g?z>=M*(j/T):j>=T*(z/M);N&&(R||F||B)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=m(e,y,"outside"===x?E:S),_=k.bBox(b.node()),M=_.width,T=_.height,M<=0||T<=0))b.remove();else{var U;U="outside"===x?o(a,f,d,p,_,g,"both"===v.constraintext||"outside"===v.constraintext):i(a,f,d,p,_,g,"both"===v.constraintext||"inside"===v.constraintext),b.attr("transform",U)}}}}function i(t,e,n,r,i,o,s){var l,u,c,h,f,d=i.width,p=i.height,m=(i.left+i.right)/2,v=(i.top+i.bottom)/2,g=Math.abs(e-t),y=Math.abs(r-n);g>2*I&&y>2*I?(g-=2*(f=I),y-=2*f):f=0;var x,b;return d<=g&&p<=y?(x=!1,b=1):d<=y&&p<=g?(x=!0,b=1):dn?(c=(t+e)/2,h=r-f-u/2):(c=(t+e)/2,h=r+f+u/2),a(m,v,c,h,b,x)}function o(t,e,n,r,i,o,s){var l,u="h"===o?Math.abs(r-n):Math.abs(e-t);u>2*I&&(l=I);var c=1;s&&(c="h"===o?Math.min(1,u/i.height):Math.min(1,u/i.width));var h,f,d,p,m=(i.left+i.right)/2,v=(i.top+i.bottom)/2;return h=c*i.width,f=c*i.height,"h"===o?en?(d=(t+e)/2,p=r+l+f/2):(d=(t+e)/2,p=r-l-f/2),a(m,v,d,p,c,!1)}function a(t,e,n,r,i,o){var a;return i<1?a="scale("+i+") ":(i=1,a=""),"translate("+(n-i*t)+" "+(r-i*e)+")"+a+(o?"rotate("+o+" "+t+" "+e+") ":"")}function s(t,e){var n=d(t.text,e);return p(S,n)}function l(t,e){var n=d(t.textposition,e);return m(E,n)}function u(t,e,n){return f(C,t.textfont,e,n)}function c(t,e,n){return f(L,t.insidetextfont,e,n)}function h(t,e,n){return f(P,t.outsidetextfont,e,n)}function f(t,e,n,r){var i=d((e=e||{}).family,n),o=d(e.size,n),a=d(e.color,n);return{family:p(t.family,i,r.family),size:v(t.size,o,r.size),color:g(t.color,a,r.color)}}function d(t,e){var n;return Array.isArray(t)?ei))return e}return void 0!==n?n:t.dflt}function g(t,e,n){return b(e).isValid()?e:void 0!==n?n:t.dflt}var y=t(98),x=t(107),b=t(1266),_=t(661),w=t(683),M=t(537),k=t(561),T=t(567),A=t(789),S=A.text,E=A.textposition,C=A.textfont,L=A.insidetextfont,P=A.outsidetextfont,I=3;e.exports=function(t,e,n){var i=e.xaxis,o=e.yaxis,a=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(n);s.enter().append("g").attr("class","trace bars"),s.append("g").attr("class","points").each(function(e){var n=e[0].node3=y.select(this),s=e[0].t,l=e[0].trace,u=s.poffset,c=Array.isArray(u);n.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(n,s){function h(t){return 0===a.bargap&&0===a.bargroupgap?y.round(Math.round(t)-k,2):t}var f,d,p,m,v=n.p+(c?u[s]:u),g=v+n.w,b=n.b,_=b+n.s;if("h"===l.orientation?(p=o.c2p(v,!0),m=o.c2p(g,!0),f=i.c2p(b,!0),d=i.c2p(_,!0),n.ct=[d,(p+m)/2]):(f=i.c2p(v,!0),d=i.c2p(g,!0),p=o.c2p(b,!0),m=o.c2p(_,!0),n.ct=[(f+d)/2,m]),x(f)&&x(d)&&x(p)&&x(m)&&f!==d&&p!==m){var w=(n.mlw+1||l.marker.line.width+1||(n.trace?n.trace.marker.line.width:0)+1)-1,k=y.round(w/2%1,2);if(!t._context.staticPlot){var T=M.opacity(n.mc||l.marker.color)<1||w>.01?h:function(t,e){return Math.abs(t-e)>=2?h(t):t>e?Math.ceil(t):Math.floor(t)};d=T(d,f=T(f,d)),m=T(m,p=T(p,m))}var A=y.select(this);A.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+f+","+p+"V"+m+"H"+d+"V"+p+"Z"),r(t,A,e,s,f,d,p,m)}else y.select(this).remove()})}),s.call(T.plot,e)}},{107:107,1266:1266,537:537,561:561,567:567,661:661,683:683,789:789,98:98}],797:[function(t,e,n){"use strict";var r=t(639).DESELECTDIM;e.exports=function(t,e){var n,i=t.cd,o=[],a=i[0].trace,s=i[0].node3;if(!0!==a.visible)return[];if(!1===e)for(n=0;nu+s||!y(l))&&(h=!0,f(c,t))}for(var i=n.traces,o=g(e),a="fraction"===t._fullLayout.barnorm?1:100,s=a/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?a:l,c=[l,u],h=!1,d=0;d1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace.marker,n=e.line,a=o.tryColorscale(e,""),s=o.tryColorscale(e,"line");r.select(this).selectAll("path").each(function(t){var o,l,u=(t.mlw+1||n.width+1)-1,c=r.select(this);o="mc"in t?t.mcc=a(t.mc):Array.isArray(e.color)?i.defaultLine:e.color,c.style("stroke-width",u+"px").call(i.fill,o),u&&(l="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(n.color)?i.defaultLine:n.color,c.call(i.stroke,l))})}),e.call(a.style)}},{537:537,561:561,567:567,98:98}],801:[function(t,e,n){"use strict";var r=t(537),i=t(550),o=t(546);e.exports=function(t,e,n,a,s){n("marker.color",a),i(t,"marker")&&o(t,e,s,n,{prefix:"marker.",cLetter:"c"}),n("marker.line.color",r.defaultLine),i(t,"marker.line")&&o(t,e,s,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width")}},{537:537,546:546,550:550}],802:[function(t,e,n){"use strict";var r=t(964),i=t(536),o=t(650).extendFlat,a=r.marker,s=a.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the y sample data or coordinates.","See overview for more info."].join(" ")},x:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the x sample data or coordinates.","See overview for more info."].join(" ")},x0:{valType:"any",role:"info",editType:"calc+clearAxisTypes",description:["Sets the x coordinate of the box.","See overview for more info."].join(" ")},y0:{valType:"any",role:"info",editType:"calc+clearAxisTypes",description:["Sets the y coordinate of the box.","See overview for more info."].join(" ")},name:{valType:"string",role:"info",editType:"calc+clearAxisTypes",description:["Sets the trace name.","The trace name appear as the legend item and on hover.","For box traces, the name will also be used for the position","coordinate, if `x` and `x0` (`y` and `y0` if horizontal) are","missing and the position axis is categorical"].join(" ")},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,role:"style",editType:"calcIfAutorange",description:["Sets the width of the whiskers relative to","the box' width.","For example, with 1, the whiskers are as wide as the box(es)."].join(" ")},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",role:"style",editType:"calcIfAutorange",description:["If *outliers*, only the sample points lying outside the whiskers","are shown","If *suspectedoutliers*, the outlier points are shown and","points either less than 4*Q1-3*Q3 or greater than 4*Q3-3*Q1","are highlighted (see `outliercolor`)","If *all*, all sample points are shown","If *false*, only the box(es) are shown with no sample points"].join(" ")},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,role:"style",editType:"calcIfAutorange",description:["If *true*, the mean of the box(es)' underlying distribution is","drawn as a dashed line inside the box(es).","If *sd* the standard deviation is also drawn."].join(" ")},jitter:{valType:"number",min:0,max:1,role:"style",editType:"calcIfAutorange",description:["Sets the amount of jitter in the sample points drawn.","If *0*, the sample points align along the distribution axis.","If *1*, the sample points are drawn in a random jitter of width","equal to the width of the box(es)."].join(" ")},pointpos:{valType:"number",min:-2,max:2,role:"style",editType:"calcIfAutorange",description:["Sets the position of the sample points in relation to the box(es).","If *0*, the sample points are places over the center of the box(es).","Positive (negative) values correspond to positions to the","right (left) for vertical boxes and above (below) for horizontal boxes"].join(" ")},orientation:{valType:"enumerated",values:["v","h"],role:"style",editType:"calc+clearAxisTypes",description:["Sets the orientation of the box(es).","If *v* (*h*), the distribution is visualized along","the vertical (horizontal)."].join(" ")},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",role:"style",editType:"style",description:"Sets the color of the outlier sample points."},symbol:o({},a.symbol,{arrayOk:!1,editType:"plot"}),opacity:o({},a.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:o({},a.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:o({},a.color,{arrayOk:!1,editType:"style"}),line:{color:o({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:o({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",role:"style",editType:"style",description:["Sets the border line color of the outlier sample points.","Defaults to marker.color"].join(" ")},outlierwidth:{valType:"number",min:0,dflt:1,role:"style",editType:"style",description:["Sets the border line width (in px) of the outlier sample points."].join(" ")},editType:"style"},editType:"plot"},line:{color:{valType:"color",role:"style",editType:"style",description:"Sets the color of line bounding the box(es)."},width:{valType:"number",role:"style",min:0,dflt:2,editType:"style",description:"Sets the width (in px) of line bounding the box(es)."},editType:"plot"},fillcolor:r.fillcolor}},{536:536,650:650,964:964}],803:[function(t,e,n){"use strict";var r=t(107),i=t(661),o=t(705);e.exports=function(t,e){var n,a,s,l,u,c,h,f,d,p=o.getFromId(t,e.xaxis||"x"),m=o.getFromId(t,e.yaxis||"y"),v=[];"h"===e.orientation?(n=p,a="x",u=m,c="y"):(n=m,a="y",u=p,c="x"),s=n.makeCalcdata(e,a),o.expand(n,s,{padded:!0}),h=function(t,e,n,o,a){var s;return n in e?h=o.makeCalcdata(e,n):(s=n+"0"in e?e[n+"0"]:"name"in e&&("category"===o.type||r(e.name)&&-1!==["linear","log"].indexOf(o.type)||i.isDateTime(e.name)&&"date"===o.type)?e.name:t.numboxes,s=o.d2c(s,0,e[n+"calendar"]),h=a.map(function(){return s})),h}(t,e,c,u,s);var g=i.distinctVals(h);return f=g.vals,d=g.minDiff/2,l=function(t,e,n,o,a){var s,l,u,c,h=o.length,f=e.length,d=[],p=[];for(s=0;s=0&&u1,m=n.dPos*(1-c.boxgap)*(1-c.boxgroupgap)/(p?t.numboxes:1),v=p?2*n.dPos*((n.boxnum+.5)/t.numboxes-.5)*(1-c.boxgap):0,g=m*d.whiskerwidth;!0!==d.visible||n.emptybox?o.select(this).remove():("h"===d.orientation?(l=f,u=h):(l=h,u=f),n.bPos=v,n.bdPos=m,r(),o.select(this).selectAll("path.box").data(a.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){var e=l.c2p(t.pos+v,!0),n=l.c2p(t.pos+v-m,!0),r=l.c2p(t.pos+v+m,!0),i=l.c2p(t.pos+v-g,!0),s=l.c2p(t.pos+v+g,!0),c=u.c2p(t.q1,!0),h=u.c2p(t.q3,!0),f=a.constrain(u.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),p=u.c2p(!1===d.boxpoints?t.min:t.lf,!0),y=u.c2p(!1===d.boxpoints?t.max:t.uf,!0);"h"===d.orientation?o.select(this).attr("d","M"+f+","+n+"V"+r+"M"+c+","+n+"V"+r+"H"+h+"V"+n+"ZM"+c+","+e+"H"+p+"M"+h+","+e+"H"+y+(0===d.whiskerwidth?"":"M"+p+","+i+"V"+s+"M"+y+","+i+"V"+s)):o.select(this).attr("d","M"+n+","+f+"H"+r+"M"+n+","+c+"H"+r+"V"+h+"H"+n+"ZM"+e+","+c+"V"+p+"M"+e+","+h+"V"+y+(0===d.whiskerwidth?"":"M"+i+","+p+"H"+s+"M"+i+","+y+"H"+s))}),d.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=n,t.trace=d}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,n,r,o,s,l,u,c="all"===d.boxpoints?t.val:t.val.filter(function(e){return et.uf}),h=Math.max((t.max-t.min)/10,t.q3-t.q1),f=1e-9*h,p=.01*h,g=[],y=0;if(d.jitter){if(0===h)for(y=1,g=new Array(c.length),e=0;et.lo&&(r.so=!0),r})}).enter().append("path").classed("point",!0).call(s.translatePoints,h,f),d.boxmean&&o.select(this).selectAll("path.mean").data(a.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=l.c2p(t.pos+v,!0),n=l.c2p(t.pos+v-m,!0),r=l.c2p(t.pos+v+m,!0),i=u.c2p(t.mean,!0),a=u.c2p(t.mean-t.sd,!0),s=u.c2p(t.mean+t.sd,!0);"h"===d.orientation?o.select(this).attr("d","M"+i+","+n+"V"+r+("sd"!==d.boxmean?"":"m0,0L"+a+","+e+"L"+i+","+n+"L"+s+","+e+"Z")):o.select(this).attr("d","M"+n+","+i+"H"+r+("sd"!==d.boxmean?"":"m0,0L"+e+","+a+"L"+n+","+i+"L"+e+","+s+"Z"))}))})}},{561:561,661:661,98:98}],810:[function(t,e,n){"use strict";var r=t(779),i=t(705),o=t(661);e.exports=function(t,e){var n,a,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=["v","h"];for(a=0;a=10)return null;for(var n=1/0,i=-1/0,o=t.length,a=0;a0?Math.floor:Math.ceil,P=E>0?Math.ceil:Math.floor,I=E>0?Math.min:Math.max,O=E>0?Math.max:Math.min,D=L(A+C),z=P(S-C),j=[[c=T(A)]];for(i=D;i*E=0;i--)o[c-i]=t[h][i],a[c-i]=e[h][i];for(s.push({x:o,y:a,bicubic:l}),i=h,o=[],a=[];i>=0;i--)o[h-i]=t[i][0],a[h-i]=e[i][0];return s.push({x:o,y:a,bicubic:u}),s}},{}],824:[function(t,e,n){"use strict";var r=t(705),i=t(650).extendFlat;e.exports=function(t,e,n,o){function a(e){var r,i,a,s,l,u,c,h,f,d,p,v,g=[],y=[],x={};if("b"===n)for(i=t.b2j(e),a=Math.floor(Math.max(0,Math.min(D-2,i))),s=i-a,x.length=D,x.crossLength=O,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,n){return t.dxydi([],e,a,n,s)},r=0;r0&&(f=t.dxydi([],r-1,a,0,s),g.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],r-1,a,1,s),g.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),g.push(h[0]),y.push(h[1]),l=h;else for(r=t.a2i(e),u=Math.floor(Math.max(0,Math.min(O-2,r))),c=r-u,x.length=O,x.crossLength=D,x.xy=function(e){return t.evalxy([],r,e)},x.dxy=function(e,n){return t.dxydj([],u,e,c,n)},i=0;i0&&(p=t.dxydj([],u,i-1,c,0),g.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),v=t.dxydj([],u,i-1,c,1),g.push(h[0]-v[0]/3),y.push(h[1]-v[1]/3)),g.push(h[0]),y.push(h[1]),l=h;return x.axisLetter=n,x.axis=M,x.crossAxis=E,x.value=e,x.constvar=o,x.index=m,x.x=g,x.y=y,x.smoothing=E.smoothing,x}function s(e){var r,i,a,s,l,u=[],c=[],h={};if(h.length=w.length,h.crossLength=S.length,"b"===n)for(a=Math.max(0,Math.min(D-2,e)),l=Math.min(1,Math.max(0,e-a)),h.xy=function(n){return t.evalxy([],n,e)},h.dxy=function(e,n){return t.dxydi([],e,a,n,l)},r=0;rw.length-1||k.push(i(s(u),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(x=w[c],b=w[y],l=0;lw[w.length-1]||T.push(i(a(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,d=(f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}))[0],p=f[1],m=d;m<=p;m++)v=M.tick0+M.dtick*m,k.push(i(a(v),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||T.push(i(a(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(a(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(a(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{650:650,705:705}],825:[function(t,e,n){"use strict";var r=t(705),i=t(650).extendFlat;e.exports=function(t,e){var n,o,a,s=e._labels=[],l=e._gridlines;for(n=0;ne.length&&(t=t.slice(0,e.length)):t=[],r=0;re.length&&(t=t.slice(0,e.length)):t=[],r=0;re.length&&(t[r]=t[r].slice(0,e.length)):t[r]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(r,e,n),offsetMultplier:u}}},{}],841:[function(t,e,n){"use strict";function r(t,e,n){var r=t.selectAll(e+"."+n).data([0]);return r.enter().append(e).classed(n,!0),r}function i(t,e,n){var i=n[0],u=n[0].trace,c=e.xaxis,h=e.yaxis,f=u.aaxis,d=u.baxis,p=t._fullLayout,m=e.plot.selectAll(".carpetlayer"),v=p._clips,g=r(m,"g","carpet"+u.uid).classed("trace",!0),y=r(g,"g","minorlayer"),x=r(g,"g","majorlayer"),b=r(g,"g","boundarylayer"),_=r(g,"g","labellayer");g.style("opacity",u.opacity),a(c,h,x,f,"a",f._gridlines),a(c,h,x,d,"b",d._gridlines),a(c,h,y,f,"a",f._minorgridlines),a(c,h,y,d,"b",d._minorgridlines),a(c,h,b,f,"a-boundary",f._boundarylines),a(c,h,b,d,"b-boundary",d._boundarylines),l(t,_,u,i,c,h,s(t,c,h,u,i,_,f._labels,"a-label"),s(t,c,h,u,i,_,d._labels,"b-label")),o(u,i,v,c,h)}function o(t,e,n,i,o){var a,s,l,u,c=n.select("#"+t._clipPathId);c.size()||(c=n.append("clipPath").classed("carpetclip",!0));var h=r(c,"path","carpetboundary"),p=e.clipsegments,m=[];for(u=0;u0?"start":"end","data-notex":1}).call(h.font,i.font).text(i.text).call(m.convertToTspans,t),f=h.bBox(this);l.attr("transform","translate("+o.p[0]+","+o.p[1]+") rotate("+o.angle+")translate("+i.axis.labelpadding*s+","+.3*f.height+")"),u=Math.max(u,f.width+i.axis.labelpadding)}),l.exit().remove(),u}function l(t,e,n,r,i,o,a,s){var l,c;l=.5*(n.a[0]+n.a[n.a.length-1]),c=n.b[0],u(t,e,n,r,n.ab2xy(l,c,!0),n.dxyda_rough(l,c),n.aaxis,i,o,a,"a-title"),l=n.a[0],c=.5*(n.b[0]+n.b[n.b.length-1]),u(t,e,n,r,n.ab2xy(l,c,!0),n.dxydb_rough(l,c),n.baxis,i,o,s,"b-title")}function u(t,e,n,r,i,o,a,s,l,u,f){var d=[];a.title&&d.push(a.title);var v=e.selectAll("text."+f).data(d);v.enter().append("text").classed(f,!0),v.each(function(){var e=p(n,s,l,i,o);-1===["start","both"].indexOf(a.showticklabels)&&(u=0),u+=a.titlefont.size+a.titleoffset,c.select(this).text(a.title||"").call(m.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+u+")").classed("user-select-none",!0).attr("text-anchor","middle").call(h.font,a.titlefont)}),v.exit().remove()}var c=t(98),h=t(561),f=t(838),d=t(837),p=t(840),m=t(683);e.exports=function(t,e,n){for(var r=0;rd&&tm&&ep||ev},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,n=t.y,r=o(t.xctrl,t.yctrl,e,n,h.smoothing,f.smoothing);t.xctrl=r[0],t.yctrl=r[1],t.evalxy=a([t.xctrl,t.yctrl],u,c,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var n=Math.max(0,Math.floor(t[0]),u-2),r=t[0]-n;return(1-r)*e[n]+r*e[n+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),r=t[1]-e;return(1-r)*n[e]+r*n[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var n=Math.max(0,Math.min(i(t,e),u-2)),r=e[n],o=e[n+1];return Math.max(0,Math.min(u-1,n+(t-r)/(o-r)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,n),c-2)),r=n[e],o=n[e+1];return Math.max(0,Math.min(c-1,e+(t-r)/(o-r)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,n){return t.evalxy([],e,n)},t.ab2xy=function(r,i,o){if(!o&&(re[u-1]|in[c-1]))return[!1,!1];var a=t.a2i(r),s=t.b2j(i),l=t.evalxy([],a,s);if(o){var h,f,d,p,m=0,v=0,g=[];re[u-1]?(h=u-2,f=1,m=(r-e[u-1])/(e[u-1]-e[u-2])):f=a-(h=Math.max(0,Math.min(u-2,Math.floor(a)))),in[c-1]?(d=c-2,p=1,v=(i-n[c-1])/(n[c-1]-n[c-2])):p=s-(d=Math.max(0,Math.min(c-2,Math.floor(s)))),m&&(t.dxydi(g,h,d,f,p),l[0]+=g[0]*m,l[1]+=g[1]*m),v&&(t.dxydj(g,h,d,f,p),l[0]+=g[0]*v,l[1]+=g[1]*v)}return l},t.c2p=function(t,e,n){return[e.c2p(t[0]),n.c2p(t[1])]},t.p2x=function(t,e,n){return[e.p2c(t[0]),n.p2c(t[1])]},t.dadi=function(t){var n=Math.max(0,Math.min(e.length-2,t));return e[n+1]-e[n]},t.dbdj=function(t){var e=Math.max(0,Math.min(n.length-2,t));return n[e+1]-n[e]},t.dxyda=function(e,n,r,i){var o=t.dxydi(null,e,n,r,i),a=t.dadi(e,r);return[o[0]/a,o[1]/a]},t.dxydb=function(e,n,r,i){var o=t.dxydj(null,e,n,r,i),a=t.dbdj(n,i);return[o[0]/a,o[1]/a]},t.dxyda_rough=function(e,n,r){var i=g*(r||.1),o=t.ab2xy(e+i,n,!0),a=t.ab2xy(e-i,n,!0);return[.5*(o[0]-a[0])/i,.5*(o[1]-a[1])/i]},t.dxydb_rough=function(e,n,r){var i=y*(r||.1),o=t.ab2xy(e,n+i,!0),a=t.ab2xy(e,n-i,!0);return[.5*(o[0]-a[0])/i,.5*(o[1]-a[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{678:678,828:828,829:829,830:830,831:831,832:832}],843:[function(t,e,n){"use strict";var r=t(661);e.exports=function(t,e,n){var i,o,a,s=[],l=[],u=t[0].length,c=t.length,h=0;for(i=0;i0&&void 0!==(r=t[n][e-1])&&(o++,i+=r),e0&&void 0!==(r=t[n-1][e])&&(o++,i+=r),n0&&o0&&i1e-5);return r.log("Smoother converged to",M,"after",k,"iterations"),t}},{661:661}],844:[function(t,e,n){"use strict";var r=t(834),i=t(885);e.exports=function(t,e,n){var o=[],a=n("x");a&&!r(a)&&o.push("x"),e._cheater=!a;var s=n("y");if(s&&!r(s)&&o.push("y"),a||s)return o.length&&i(e,e.aaxis,e.baxis,"a","b",o),!0}},{834:834,885:885}],845:[function(t,e,n){"use strict";var r=t(1002),i=t(542),o=t(538),a=t(703),s=t(650),l=s.extendFlat,u=s.extendDeepAll,c=r.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc",description:["Sets the coordinates via location IDs or names.","See `locationmode` for more info."].join(" ")},locationmode:r.locationmode,z:{valType:"data_array",editType:"calc",description:"Sets the color values."},text:l({},r.text,{description:"Sets the text elements associated with each location."}),marker:{line:{color:c.color,width:l({},c.width,{dflt:1}),editType:"calc"},editType:"calc"},hoverinfo:l({},a.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},u({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:o})},{1002:1002,538:538,542:542,650:650,703:703}],846:[function(t,e,n){"use strict";var r=t(107),i=t(640).BADNUM,o=t(543),a=t(963);e.exports=function(t,e){for(var n=e.locations.length,s=new Array(n),l=0;ll&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,a,s,{prefix:"",cLetter:"z"})):e.visible=!1}else e.visible=!1}},{546:546,661:661,845:845}],848:[function(t,e,n){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],849:[function(t,e,n){"use strict";function r(t,e,n,r){var s=n.hi||e.hoverinfo,l="all"===s?o.hoverinfo.flags:s.split("+"),u=-1!==l.indexOf("name"),c=-1!==l.indexOf("location"),h=-1!==l.indexOf("z"),f=-1!==l.indexOf("text"),d=[];!u&&c?t.nameOverride=n.loc:(u&&(t.nameOverride=e.name),c&&d.push(n.loc)),h&&d.push(function(t){return i.tickText(r,r.c2l(t),"hover").text}(n.z)),f&&a(n,e,d),t.extraText=d.join("
")}var i=t(705),o=t(845),a=t(971);e.exports=function(t,e,n){var i,o,a,s,l=t.cd,u=l[0].trace,c=t.subplot;for(o=0;o0&&t[e+1][0]<0)return e;return null}var n,r,i,o,a=t.geometry,s=a.coordinates,l=t.id,u=[];switch(n="RUS"===l||"FJI"===l?function(t){var n;if(null===e(t))n=t;else for(n=new Array(t.length),o=0;on?r[i++]=[t[o][0]+360,t[o][1]]:o===n?(r[i++]=t[o],r[i++]=[t[o][0],-90]):r[i++]=t[o];var a=h.tester(r);a.pts.pop(),u.push(a)}:function(t){u.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;rs.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),o(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:r(u,c,e.ncontours).dtick,h.size=s.size=f}}return n}},{661:661,705:705,882:882}],855:[function(t,e,n){"use strict";var r=t(764),i=t(540),o=t(863),a=t(859);e.exports=function(t,e){var n=e[0].trace,s="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),n.showscale){var l=i(t,s);e[0].t.cb=l;var u=n.contours,c=n.line,h=u.size||1,f=u.coloring,d=o(n,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:n.zmin,end:n.zmax,size:(n.zmax-n.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:c.color,width:!1!==u.showlines?c.width:0,dash:c.dash}).levels({start:u.start,end:a(u),size:h}).options(n.colorbar)()}else r.autoMargin(t,s)}},{540:540,764:764,859:859,863:863}],856:[function(t,e,n){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],857:[function(t,e,n){"use strict";var r=t(661),i=t(853);e.exports=function(t,e,n){var o=r.coerce2(t,e,i,"contours.start"),a=r.coerce2(t,e,i,"contours.end"),s=!1===o||!1===a,l=n("contours.size");!(s?e.autocontour=!0:n("autocontour",!1))&&l||n("ncontours")}},{661:661,853:853}],858:[function(t,e,n){"use strict";var r=t(661),i=t(888),o=t(896),a=t(857),s=t(867),l=t(853);e.exports=function(t,e,n,u){function c(n,i){return r.coerce(t,e,l,n,i)}o(t,e,c,u)?(c("text"),c("connectgaps",i(e)),a(t,e,c),s(t,e,c,u)):e.visible=!1}},{661:661,853:853,857:857,867:867,888:888,896:896}],859:[function(t,e,n){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],860:[function(t,e,n){"use strict";function r(t,e,n,r){return Math.abs(t[0]-e[0])20?(m=u.CHOOSESADDLE[m][(v[0]||v[1])<0?0:1],t.crossings[p]=u.SADDLEREMAINDER[m]):delete t.crossings[p],!(v=u.NEWDELTA[m])){l.log("Found bad marching index:",m,e,t.level);break}g.push(s(t,e,v)),e[0]+=v[0],e[1]+=v[1],r(g[g.length-1],g[g.length-2],o,c)&&g.pop(),p=e.join(",");var _=v[0]&&(e[0]<0||e[0]>b-2)||v[1]&&(e[1]<0||e[1]>x-2);if(p===d&&v.join(",")===y||n&&_)break;m=t.crossings[p]}1e4===f&&l.log("Infinite loop in contour?");var w,M,k,T,A,S,E,C=r(g[0],g[g.length-1],o,c),L=0,P=.2*t.smoothing,I=[],O=0;for(f=1;f=O;f--)if((w=I[f])=O&&w+I[M]20&&e?208===t||1114===t?r=0===n[0]?1:-1:i=0===n[1]?1:-1:-1!==u.BOTTOMSTART.indexOf(t)?i=1:-1!==u.LEFTSTART.indexOf(t)?r=1:-1!==u.TOPSTART.indexOf(t)?i=-1:r=-1,[r,i]}function s(t,e,n){var r=e[0]+Math.max(n[0],0),i=e[1]+Math.max(n[1],0),o=t.z[i][r],a=t.xaxis,s=t.yaxis;if(n[1]){var l=(t.level-o)/(t.z[i][r+1]-o);return[a.c2p((1-l)*t.x[r]+l*t.x[r+1],!0),s.c2p(t.y[i],!0),r+l,i]}var u=(t.level-o)/(t.z[i+1][r]-o);return[a.c2p(t.x[r],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0),r,i+u]}var l=t(661),u=t(856);e.exports=function(t,e,n){var r,i,a,s;for(e=e||.01,n=n||.01,i=0;it?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===n||10===n?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===n?713:1114:5===n?104:208:15===n?0:n}var i=t(856);e.exports=function(t){var e,n,o,a,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(n=0;n1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function o(t,e,n){var r=t.selectAll("g.contourbg").data([0]);r.enter().append("g").classed("contourbg",!0);var i=r.selectAll("path").data("fill"===n.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function a(t,e,n,r){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var o=i.selectAll("path").data("fill"===r.coloring?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=s(t,n);e?f.select(this).attr("d",e).style("stroke","none"):f.select(this).remove()})}function s(t,e){function n(t){return Math.abs(t[0]-e[2][0])<.01}for(var r,i,o,a,s,l,u=Math.min(t.z[0][0],t.z[0][1]),c=t.edgepaths.length||u<=t.level?"":"M"+e.join("L")+"Z",h=0,f=t.edgepaths.map(function(t,e){return e}),m=!0;f.length;){for(l=p.smoothopen(t.edgepaths[h],t.smoothing),c+=m?l:l.replace(/^M/,"L"),f.splice(f.indexOf(h),1),r=t.edgepaths[h][t.edgepaths[h].length-1],a=-1,o=0;o<4;o++){if(!r){d.log("Missing end?",h,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(r)||n(r)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(r)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(r)?n(r)&&(i=e[2]):i=e[3]:i=e[0]:i=e[1],s=0;s=0&&(i=v,a=s):Math.abs(r[1]-i[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(i[0]-v[0])>=0&&(i=v,a=s):d.log("endpt to newendpt is not vert. or horz.",r,i,v)}if(r=i,a>=0)break;c+="L"+i}if(a===t.edgepaths.length){d.log("unclosed perimeter path");break}h=a,(m=-1===f.indexOf(h))&&(h=f[0],c+="Z")}for(h=0;hr.center?r.right-a:a-r.left)/(u+Math.abs(Math.sin(l)*o)),f=(s>r.middle?r.bottom-s:s-r.top)/(Math.abs(c)+Math.cos(l)*o);if(h<1||f<1)return 1/0;var p=M.EDGECOST*(1/(h-1)+1/(f-1));p+=M.ANGLECOST*l*l;for(var m=a-u,v=s-c,g=a+u,y=s+c,x=0;x2*M.MAXCOST)break;p&&(a/=2),s=(o=l-a/2)+1.5*a}if(f<=M.MAXCOST)return c},n.addLabelData=function(t,e,n,r){var i=e.width/2,o=e.height/2,a=t.x,s=t.y,l=t.theta,u=Math.sin(l),c=Math.cos(l),h=i*c,f=o*u,d=i*u,p=-o*c,m=[[a-h-f,s-d-p],[a+h-f,s+d-p],[a+h+f,s+d+p],[a-h+f,s-d+p]];n.push({text:e.text,x:a,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),r.push(m)},n.drawLabels=function(t,e,n,r,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,r=t.y-Math.cos(t.theta)*t.dy;f.select(this).text(t.text).attr({x:e,y:r,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+r+")"}).call(m.convertToTspans,n)}),i){for(var a="",s=0;s* keeps items greater than `value`","*>=* keeps items greater than or equal to `value`","*[]* keeps items inside `value[0]` to value[1]` including both bounds`","*()* keeps items inside `value[0]` to value[1]` excluding both bounds`","*[)* keeps items inside `value[0]` to value[1]` including `value[0]` but excluding `value[1]","*(]* keeps items inside `value[0]` to value[1]` excluding `value[0]` but including `value[1]","*][* keeps items outside `value[0]` to value[1]` and equal to both bounds`","*)(* keeps items outside `value[0]` to value[1]`","*](* keeps items outside `value[0]` to value[1]` and equal to `value[0]`","*)[* keeps items outside `value[0]` to value[1]` and equal to `value[1]`"].join(" ")},value:{valType:"any",dflt:0,role:"info",editType:"calc",description:["Sets the value or values by which to filter by.","Values are expected to be in the same type as the data linked","to *target*.","When `operation` is set to one of the inequality values","("+h.INEQUALITY_OPS+")","*value* is expected to be a number or a string.","When `operation` is set to one of the interval value","("+h.INTERVAL_OPS+")","*value* is expected to be 2-item array where the first item","is the lower bound and the second item is the upper bound.","When `operation`, is set to one of the set value","("+h.SET_OPS+")","*value* is expected to be an array with as many items as","the desired set elements."].join(" ")},editType:"calc"},line:{color:u({},c.color,{description:["Sets the color of the contour level.","Has no if `contours.coloring` is set to *lines*."].join(" ")}),width:c.width,dash:c.dash,smoothing:u({},c.smoothing,{description:["Sets the amount of smoothing for the contour lines,","where *0* corresponds to no smoothing."].join(" ")}),editType:"plot"}},s,{autocolorscale:u({},s.autocolorscale,{dflt:!1})},{colorbar:l})},{538:538,542:542,650:650,853:853,871:871,881:881,964:964}],869:[function(t,e,n){"use strict";function r(t,e,n){var r={type:"linear",range:[t,e]};return a.autoTicks(r,(e-t)/(n||15)),r}function i(t,e){function n(t){k=e._input.zsmooth=e.zsmooth=!1,o.notifier("cannot fast-zsmooth: "+t)}var r,i,a,s,g,y,x,b,_=e.carpetTrace,w=_.aaxis,M=_.baxis,k=l.traceIs(e,"contour")?"best":e.zsmooth;if(w._minDtick=0,M._minDtick=0,c(e)&&h(e,w,M,"a","b",["z"]),r=e.a?w.makeCalcdata(e,"a"):[],s=e.b?M.makeCalcdata(e,"b"):[],i=e.a0||0,a=e.da||1,g=e.b0||0,y=e.db||1,x=f(e.z,e.transpose),e._emptypoints=m(x),e._interpz=p(x,e._emptypoints,e._interpz),"fast"===k)if("log"===w.type||"log"===M.type)n("log axis found");else{if(r.length){var T=(r[r.length-1]-r[0])/(r.length-1),A=Math.abs(T/100);for(b=0;bA){n("a scale is not linear");break}}if(s.length&&"fast"===k){var S=(s[s.length-1]-s[0])/(s.length-1),E=Math.abs(S/100);for(b=0;bE){n("b scale is not linear");break}}}var C=d(x),L="scaled"===e.xtype?"":r,P=v(e,L,i,a,C,w),I="scaled"===e.ytype?"":s,O={a:P,b:v(e,I,g,y,x.length,M),z:x};return"levels"===e.contours.type&&u(e,x,"","z"),[O]}var o=t(661),a=t(705),s=t(661).extendFlat,l=t(779),u=t(543),c=t(888),h=t(885),f=t(883),d=t(893),p=t(891),m=t(887),v=t(892),g=t(875),y=t(836);e.exports=function(t,e){var n=e.carpetTrace=y(t,e);if(n&&n.visible&&"legendonly"!==n.visible){if(!e.a||!e.b){var o=t.data[n.index],l=t.data[e.index];l.a||(l.a=o.a),l.b||(l.b=o.b),g(l,e,e._defaultColor,t._fullLayout)}var u=i(0,e),c=e.contours;if(!0===e.autocontour){var h=r(e.zmin,e.zmax,e.ncontours);c.size=h.dtick,c.start=a.tickFirst(h),h.range.reverse(),c.end=a.tickFirst(h),c.start===e.zmin&&(c.start+=c.size),c.end===e.zmax&&(c.end-=c.size),c.start>c.end&&(c.start=c.end=(c.start+c.end)/2),e._input.contours=s({},c)}else{var f=c.start,d=c.end,p=e._input.contours;if(f>d&&(c.start=p.start=d,d=c.end=p.end=f,f=c.start),!(c.size>0)){var m;m=f===d?1:r(f,d,e.ncontours).dtick,p.size=c.size=m}}return u}}},{543:543,661:661,705:705,779:779,836:836,875:875,883:883,885:885,887:887,888:888,891:891,892:892,893:893}],870:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i,o,a,s=r.a.length,l=r.b.length,u=r.z,c=-1/0,h=1/0;for(i=0;i":case">=":r.contours.value>c&&(t[0].prefixBoundary=!0);break;case"<":case"<=":r.contours.valuec&&(t[0].prefixBoundary=!0);break;case"][":case")(":o=Math.min.apply(null,r.contours.value),a=Math.max.apply(null,r.contours.value),oc&&(t[0].prefixBoundary=!0)}}},{}],871:[function(t,e,n){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],872:[function(t,e,n){"use strict";function r(t,e){function n(t){return s(t)?+t:null}var r,i=Array.isArray(e);return-1!==a.INEQUALITY_OPS.indexOf(t)?r=n(i?e[0]:e):-1!==a.INTERVAL_OPS.indexOf(t)?r=i?[n(e[0]),n(e[1])]:[n(e),n(e)]:-1!==a.SET_OPS.indexOf(t)&&(r=i?e.map(n):[n(e)]),r}function i(t){return function(e){e=r(t,e);var n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:n,end:i,size:i-n}}}function o(t){return function(e){return e=r(t,e),{start:e,end:1/0,size:1/0}}}var a=t(871),s=t(107);e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=o(">"),e.exports[">="]=o(">="),e.exports["<"]=o("<"),e.exports["<="]=o("<="),e.exports["="]=o("=")},{107:107,871:871}],873:[function(t,e,n){"use strict";var r=t(872),i=t(107);e.exports=function(t,e){var n;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(n=parseFloat(e.value[0]),e.value=[n,n+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(n=parseFloat(e.value),e.value=[n,n+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var o=r[e.operation](e.value);e.start=o.start,e.end=o.end,e.size=o.size}},{107:107,872:872}],874:[function(t,e,n){"use strict";var r=t(661);e.exports=function(t,e){var n,i,o,a=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=a;a=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void r.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],o=t[1],n=0;n=":case">":if(1!==t.length)return void r.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],n=0;n1e3){r.warn("Too many contours, clipping at 1000",t);break}return o}},{661:661}],877:[function(t,e,n){"use strict";var r={};r.attributes=t(868),r.supplyDefaults=t(875),r.colorbar=t(855),r.calc=t(869),r.plot=t(880),r.style=t(866),r.moduleType="trace",r.name="contourcarpet",r.basePlotModule=t(715),r.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],r.meta={hrName:"contour_carpet",description:["Plots contours on either the first carpet axis or the","carpet axis with a matching `carpet` attribute. Data `z`","is interpreted as matching that of the corresponding carpet","axis."].join(" ")},e.exports=r},{715:715,855:855,866:866,868:868,869:869,875:875,880:880}],878:[function(t,e,n){"use strict";var r=t(561),i=t(819),o=t(661);e.exports=function(t,e,n,a,s,l,u,c){function h(t){return Math.abs(t[1]-n[0][1])=0&&(y=C,b=_):Math.abs(g[1]-y[1])=0&&(y=C,b=_):o.log("endpt to newendpt is not vert. or horz.",g,y,C)}if(b>=0)break;M+=m(g,y),g=y}if(b===e.edgepaths.length){o.log("unclosed perimeter path");break}v=b,(T=-1===k.indexOf(v))&&(v=k[0],M+=m(g,y)+"Z",g=null)}for(v=0;v=0;N--)D=s.clipsegments[N],z=f([],D.x,_.c2p),j=f([],D.y,A.c2p),z.reverse(),j.reverse(),F.push(d(z,j,D.bicubic));var B="M"+F.join("L")+"Z";u(R,s.clipsegments,_,A,L,m.coloring),c(o,R,_,A,C,P,r,a,s,m.coloring,B),i(R,C,t,n[0],m,e,a),p.setClipUrl(R,a._clipPathId)}else S._infolayer.selectAll(".cb"+x).remove()}}function i(t,e,n,r,i,a,s){var l=t.selectAll("g.contourlines").data([0]);l.enter().append("g").classed("contourlines",!0);var u=!1!==i.showlines,c=i.showlabels,f=u&&c,d=y.createLines(l,u||c,e),v=y.createLineClip(l,f,n._fullLayout._defs,r.trace.uid),g=t.selectAll("g.contourlabels").data(c?[0]:[]);if(g.exit().remove(),g.enter().append("g").classed("contourlabels",!0),c){var b=a.xaxis,_=a.yaxis,w=b._length,M=_._length,k=[[[0,0],[w,0],[w,M],[0,M]]],T=[];m.clearLocationCache();var A=y.labelFormatter(i,r.t.cb,n._fullLayout),S=p.tester.append("text").attr("data-notex",1).call(p.font,i.labelfont),E={left:0,right:w,center:w/2,top:0,bottom:M,middle:M/2},C=Math.sqrt(w*w+M*M),L=x.LABELDISTANCE*C/Math.max(1,e.length/x.LABELINCREASE);d.each(function(t){var e=y.calcTextOpts(t.level,A,S,n);h.select(this).selectAll("path").each(function(n){var r=this,i=m.getVisibleSegment(r,E,e.height/2);if(i&&(o(r,n,t,i,s,e.height),!(i.len<(e.width+e.height)*x.LABELMIN)))for(var a=Math.min(Math.ceil(i.len/L),x.LABELMAX),l=0;lx&&(r.max=x),r.len=r.max-r.min}}function a(t,e,n){var r=t.getPointAtLength(e),i=t.getPointAtLength(n),o=i.x-r.x,a=i.y-r.y,s=Math.sqrt(o*o+a*a);return[o/s,a/s]}function s(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function l(t,e){var n=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-n*n)/n}function u(t,e,n,r,i,o){var a,s,l,u,c=t.selectAll("g.contourbg").data([0]);c.enter().append("g").classed("contourbg",!0);var h=c.selectAll("path").data("fill"!==o||i?[]:[0]);h.enter().append("path"),h.exit().remove();var p=[];for(u=0;uP){n("x scale is not linear");break}}if(y.length&&"fast"===E){var I=(y[y.length-1]-y[0])/(y.length-1),O=Math.abs(I/100);for(w=0;wO){n("y scale is not linear");break}}}var D=c(_),z="scaled"===e.xtype?"":m,j=p(e,z,v,g,D,M),N="scaled"===e.ytype?"":y,R=p(e,N,x,b,_.length,k);S||(o.expand(M,j),o.expand(k,R));var F={x:j,y:R,z:_,text:e.text};if(s(e,_,"","z"),T&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};F.xfill=p(B,z,v,g,D,M),F.yfill=p(B,N,x,b,_.length,k)}return[F]}},{543:543,661:661,705:705,779:779,883:883,885:885,887:887,888:888,891:891,892:892,893:893,910:910}],883:[function(t,e,n){"use strict";var r=t(107);e.exports=function(t,e){var n,i,o,a,s,l;if(e){for(n=0,s=0;s=0;a--)(s=((h[[(n=(o=f[a])[0])-1,i=o[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[o]=[n,i,s],f.splice(a,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(o in l)h[o]=l[o],c.push(l[o])}return c.sort(function(t,e){return e[2]-t[2]})}},{893:893}],888:[function(t,e,n){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],889:[function(t,e,n){"use strict";var r=t(578),i=t(661),o=r.constants.MAXDIST;e.exports=function(t,e,n,a,s){if(!(t.distance=y[0].length||h<0||h>y.length)return}else{if(r.inbox(e-v[0],e-v[v.length-1])>o||r.inbox(n-g[0],n-g[g.length-1])>o)return;if(s){var w;for(b=[2*v[0]-v[1]],w=1;wm&&(g=Math.max(g,Math.abs(t[i][o]-p)/(v-m))))}return g}var o=t(661),a=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,n){var a,s,l=1;if(Array.isArray(n))for(a=0;a.01;a++)l=i(t,e,r(l));return l>.01&&o.log("interp2d didn't converge quickly",l),t}},{661:661}],892:[function(t,e,n){"use strict";var r=t(779);e.exports=function(t,e,n,i,o,a){var s,l,u,c=[],h=r.traceIs(t,"contour"),f=r.traceIs(t,"histogram"),d=r.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==a.type){var p=e.length;if(!(p<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||d)c=e.slice(0,o);else if(1===o)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u0;)x=p.c2p(T[M]),M--;for(x0;)w=m.c2p(A[M]),M--;if(w<_&&(b=_,_=w,w=b,I=!0),S&&(T=n[0].xfill,A=n[0].yfill),"fast"!==E){var O="best"===E?0:.5;y=Math.max(-O*p._length,y),x=Math.min((1+O)*p._length,x),_=Math.max(-O*m._length,_),w=Math.min((1+O)*m._length,w)}var D=Math.round(x-y),z=Math.round(w-_),j=D<=0||z<=0,N=e.plot.select(".imagelayer").selectAll("g.hm."+g).data(j?[]:[0]);if(N.enter().append("g").classed("hm",!0).classed(g,!0),N.exit().remove(),!j){var R,F;"fast"===E?(R=L,F=C):(R=D,F=z);var B=document.createElement("canvas");B.width=R,B.height=F;var U,V,H=B.getContext("2d"),q=s.makeColorScaleFunc(s.extractScale(f.colorscale,f.zmin,f.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===E?(U=P?function(t){return L-1-t}:a.identity,V=I?function(t){return C-1-t}:a.identity):(U=function(t){return a.constrain(Math.round(p.c2p(T[t])-y),0,D)},V=function(t){return a.constrain(Math.round(m.c2p(A[t])-_),0,z)});var W,G,Y,X,Z,K,J=V(0),$=[J,J],Q=P?0:1,tt=I?0:1,et=0,nt=0,rt=0,it=0;if(E){var ot,at=0;try{ot=new Uint8Array(D*z*4)}catch(t){ot=new Array(D*z*4)}if("best"===E){var st,lt,ut,ct=new Array(T.length),ht=new Array(A.length),ft=new Array(D);for(M=0;M0&&o0&&s0&&(r=!0);for(var s=0;so){var a=o-n[t];return n[t]=o,a}}return 0},max:function(t,e,n,i){var o=i[e];if(r(o)){if(o=Number(o),!r(n[t]))return n[t]=o,o;if(n[t]d.size/1.9?d.size:d.size/Math.ceil(d.size/x);var T=d.start+(d.size-x)/2;b=T-x*Math.ceil((T-b)/x)}for(l=0;l=0;o--)i(o);else if("increasing"===e){for(o=1;o=0;o--)t[o]+=t[o+1];"exclude"===n&&(t.push(0),t.shift())}}var u=t(107),c=t(661),h=t(705),f=t(788),d=t(903),p=t(908),m=t(901),v=t(905),g=t(640).ONEAVGMONTH;e.exports=function(t,e){if(!0===e.visible){var n,i=[],o=[],a=h.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),s="h"===e.orientation?"y":"x",g={x:"y",y:"x"}[s],y=e[s+"calendar"],x=e.cumulative;v(e,a,s);var b,_,w,M=r(t,e,a,s),k=M[0],T=M[1],A="string"==typeof k.size,S=A?[]:k,E=[],C=[],L=0,P=e.histnorm,I=e.histfunc,O=-1!==P.indexOf("density");x.enabled&&O&&(P=P.replace(/ ?density$/,""),O=!1);var D,z="max"===I||"min"===I?null:0,j=d.count,N=p[P],R=!1,F=function(t){return a.r2c(t,0,y)};for(Array.isArray(e[g])&&"count"!==I&&(D=e[g],R="avg"===I,j=d[I]),n=F(k.start),_=F(k.end)+(n-h.tickIncrement(n,k.size,!1,y))/1e6;n<_&&i.length<1e6&&(b=h.tickIncrement(n,k.size,!1,y),i.push((n+b)/2),o.push(z),A&&S.push(n),O&&E.push(1/(b-n)),R&&C.push(0),!(b<=n));)n=b;A||"date"!==a.type||(S={start:F(S.start),end:F(S.end),size:S.size});var B=o.length;for(n=0;n=0&&w=H;n--)if(o[n]){q=n;break}for(n=H;n<=q;n++)u(i[n])&&u(o[n])&&V.push({p:i[n],s:o[n],b:0});return 1===V.length&&(V[0].width1=h.tickIncrement(V[0].p,k.size,!1,y)-V[0].p),f(V,e),V}}},{107:107,640:640,661:661,705:705,788:788,901:901,903:903,905:905,908:908}],905:[function(t,e,n){"use strict";var r=t(107),i=t(661).cleanDate,o=t(640),a=o.ONEDAY,s=o.BADNUM;e.exports=function(t,e,n){var o=e.type,l=n+"bins",u=t[l];u||(u=t[l]={});var c="date"===o?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return r(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h="date"===o?a:1,f=u.size;if(r(f))u.size=f>0?Number(f):h;else if("string"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);((p=r(p)?Number(p):0)<=0||"date"!==o||"M"!==d||p!==Math.round(p))&&(u.size=h)}var m="autobin"+n;"boolean"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t["nbins"+n]}},{107:107,640:640,661:661}],906:[function(t,e,n){"use strict";var r=t(779),i=t(661),o=t(537),a=t(902),s=t(801),l=t(566),u=t(900);e.exports=function(t,e,n,c){function h(n,r){return i.coerce(t,e,u,n,r)}var f=h("x"),d=h("y");h("cumulative.enabled")&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var p=h("orientation",d&&!f?"h":"v"),m=e["v"===p?"x":"y"];m&&m.length?(r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],c),e["h"===p?"x":"y"]&&h("histfunc"),a(t,e,h,"h"===p?["y"]:["x"]),s(t,e,h,n,c),l(t,e,o.defaultLine,{axis:"y"}),l(t,e,o.defaultLine,{axis:"x",inherit:"y"})):e.visible=!1}},{537:537,566:566,661:661,779:779,801:801,900:900,902:902}],907:[function(t,e,n){"use strict";var r={};r.attributes=t(900),r.layoutAttributes=t(794),r.supplyDefaults=t(906),r.supplyLayoutDefaults=t(795),r.calc=t(904),r.setPositions=t(798),r.plot=t(796),r.style=t(800),r.colorbar=t(967),r.hoverPoints=t(792),r.selectPoints=t(797),r.moduleType="trace",r.name="histogram",r.basePlotModule=t(715),r.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],r.meta={description:["The sample data from which statistics are computed is set in `x`","for vertically spanning histograms and","in `y` for horizontally spanning histograms.","Binning options are set `xbins` and `ybins` respectively","if no aggregation data is provided."].join(" ")},e.exports=r},{715:715,792:792,794:794,795:795,796:796,797:797,798:798,800:800,900:900,904:904,906:906,967:967}],908:[function(t,e,n){"use strict";e.exports={percent:function(t,e){for(var n=t.length,r=100/e,i=0;ik&&m.splice(k,m.length-k),g.length>k&&g.splice(k,g.length-k),!e.autobinx&&e.xbins&&null!==e.xbins.start&&null!==e.xbins.end||(e.xbins=i.autoBin(m,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(i.tickIncrement(b(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(b(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins,e._input.autobinx=e.autobinx),!e.autobiny&&e.ybins&&null!==e.ybins.start&&null!==e.ybins.end||(e.ybins=i.autoBin(g,v,e.nbinsy,"2d",x),"histogram2dcontour"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,x)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,x))),e._input.ybins=e.ybins,e._input.autobiny=e.autobiny),f=[];var T,A,S=[],E=[],C="string"==typeof e.xbins.size,L="string"==typeof e.ybins.size,P=C?[]:e.xbins,I=L?[]:e.ybins,O=0,D=[],z=e.histnorm,j=e.histfunc,N=-1!==z.indexOf("density"),R="max"===j||"min"===j?null:0,F=o.count,B=a[z],U=!1,V=[],H=[],q="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";q&&"count"!==j&&(U="avg"===j,F=o[j]);var W=e.xbins,G=b(W.start),Y=b(W.end)+(G-i.tickIncrement(G,W.size,!1,y))/1e6;for(d=G;d=0&&T=0&&A0*, the alpha-shape algorithm is used. In this case, the positive `alphahull` value","signals the use of the alpha-shape algorithm, _and_ its value","acts as the parameter for the mesh fitting.","If *0*, the convex-hull algorithm is used. It is suitable for convex bodies","or if the intention is to enclose the `x`, `y` and `z` point set into a convex","hull."].join(" ")},intensity:{valType:"data_array",editType:"calc",description:["Sets the vertex intensity values,","used for plotting fields on meshes"].join(" ")},color:{valType:"color",role:"style",editType:"calc",description:"Sets the color of the whole mesh"},vertexcolor:{valType:"data_array",role:"style",editType:"calc",description:["Sets the color of each vertex","Overrides *color*."].join(" ")},facecolor:{valType:"data_array",role:"style",editType:"calc",description:["Sets the color of each face","Overrides *color* and *vertexcolor*."].join(" ")},opacity:a.opacity,flatshading:{valType:"boolean",role:"style",dflt:!1,editType:"calc",description:["Determines whether or not normal smoothing is applied to the meshes,","creating meshes with an angular, low-poly look via flat reflections."].join(" ")},contour:{show:s({},a.contours.x.show,{description:["Sets whether or not dynamic contours are shown on hover"].join(" ")}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},showscale:i.showscale,colorbar:o,lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",role:"style",min:0,max:1,dflt:1e-12,editType:"calc",description:"Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry."},facenormalsepsilon:{valType:"number",role:"style",min:0,max:1,dflt:1e-6,editType:"calc",description:"Epsilon for face normals calculation avoids math issues arising from degenerate geometry."},editType:"calc"},a.lighting)})},{1032:1032,538:538,542:542,544:544,650:650}],918:[function(t,e,n){"use strict";var r=t(543);e.exports=function(t,e){e.intensity&&r(e,e.intensity,"","c")}},{543:543}],919:[function(t,e,n){"use strict";var r=t(107),i=t(661),o=t(764),a=t(551),s=t(540);e.exports=function(t,e){var n=e[0].trace,l="cb"+n.uid,u=n.cmin,c=n.cmax,h=n.intensity||[];if(r(u)||(u=i.aggNums(Math.min,null,h)),r(c)||(c=i.aggNums(Math.max,null,h)),t._fullLayout._infolayer.selectAll("."+l).remove(),n.showscale){var f=e[0].t.cb=s(t,l),d=a.makeColorScaleFunc(a.extractScale(n.colorscale,u,c),{noNumericCheck:!0});f.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(n.colorbar)()}else o.autoMargin(t,l)}},{107:107,540:540,551:551,661:661,764:764}],920:[function(t,e,n){"use strict";function r(t,e,n){this.scene=t,this.uid=n,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],n=l(t[1]).toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function o(t){return t.map(f)}function a(t,e,n){for(var r=new Array(t.length),i=0;i0)s=c(t.alphahull,l);else{var d=["x","y","z"].indexOf(t.delaunayaxis);s=u(l.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:f(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=o(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=o(t.facecolor)):(this.color=t.color,p.meshColor=f(t.color)),this.mesh.update(p)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=s({gl:n}),o=new r(t,i,e.uid);return i._trace=o,o.update(e),t.glplot.add(i),o}},{1266:1266,16:16,195:195,682:682,78:78,99:99}],921:[function(t,e,n){"use strict";var r=t(779),i=t(661),o=t(546),a=t(917);e.exports=function(t,e,n,s){function l(n,r){return i.coerce(t,e,a,n,r)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);c?(h&&h.forEach(function(t){for(var e=0;er?n=!0:e1)){var h=s.simpleMap(c.x,e.d2c,0,n.xcalendar),f=s.distinctVals(h).minDiff;o=Math.min(o,f)}}for(o===1/0&&(o=1),u=0;u");w.push(a,a,a,a,a,a,null)}(L,p[L],m[L],v[L],g[L]));e.x=b,e.y=_,e.text=w}},{107:107,661:661,705:705,708:708,926:926}],930:[function(t,e,n){"use strict";var r=t(544),i=t(538),o=t(555),a=t(716),s=t(729),l=t(650),u=l.extendDeepAll,c=l.extendFlat;e.exports={domain:{x:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc",description:["Sets the horizontal domain of this `parcoords` trace","(in plot fraction)."].join(" ")},y:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc",description:["Sets the vertical domain of this `parcoords` trace","(in plot fraction)."].join(" ")},editType:"calc"},labelfont:s({editType:"calc",description:"Sets the font for the `dimension` labels."}),tickfont:s({editType:"calc",description:"Sets the font for the `dimension` tick values."}),rangefont:s({editType:"calc",description:"Sets the font for the `dimension` range values."}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",role:"info",editType:"calc",description:"The shown name of the dimension."},tickvals:c({},a.tickvals,{editType:"calc"}),ticktext:c({},a.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",role:"style",editType:"calc",description:["Sets the tick label formatting rule using d3 formatting mini-language","which is similar to those of Python. See","https://github.com/d3/d3-format/blob/master/README.md#locale_format"].join(" ")},visible:{valType:"boolean",dflt:!0,role:"info",editType:"calc",description:"Shows the dimension when set to `true` (the default). Hides the dimension for `false`."},range:{valType:"info_array",role:"info",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["The domain range that represents the full, shown axis extent. Defaults to the `values` extent.","Must be an array of `[fromValue, toValue]` with finite numbers as elements."].join(" ")},constraintrange:{valType:"info_array",role:"info",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["The domain range to which the filter on the dimension is constrained. Must be an array","of `[fromValue, toValue]` with finite numbers as elements."].join(" ")},values:{valType:"data_array",role:"info",dflt:[],editType:"calc",description:["Dimension values. `values[n]` represents the value of the `n`th point in the dataset,","therefore the `values` vector for all dimensions must be the same (longer vectors","will be truncated). Each value must be a finite number."].join(" ")},editType:"calc",description:"The dimensions (variables) of the parallel coordinates chart. 2..60 dimensions are supported."},line:c(u(r("line","calc"),{colorscale:{dflt:o.Viridis},autocolorscale:{dflt:!1,description:["Has an effect only if line.color` is set to a numerical array.","Determines whether the colorscale is a default palette (`autocolorscale: true`)","or the palette determined by `line.colorscale`.","In case `colorscale` is unspecified or `autocolorscale` is true, the default ","palette will be chosen according to whether numbers in the `color` array are","all positive, all negative or mixed.","The default value is false, so that `parcoords` colorscale can default to `Viridis`."].join(" ")}}),{showscale:{valType:"boolean",role:"info",dflt:!1,editType:"calc",description:["Has an effect only if `line.color` is set to a numerical array.","Determines whether or not a colorbar is displayed."].join(" ")},colorbar:i,editType:"calc"})}},{538:538,544:544,555:555,650:650,716:716,729:729}],931:[function(t,e,n){"use strict";var r=t(98),i=t(764),o=t(939),a=t(642),s=t(934);n.name="parcoords",n.attr="type",n.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&o(t,e)},n.clean=function(t,e,n,r){var i=r._has&&r._has("parcoords"),o=e._has&&e._has("parcoords");i&&!o&&(r._paperdiv.selectAll(".parcoords-line-layers").remove(),r._paperdiv.selectAll(".parcoords-line-layers").remove(),r._paperdiv.selectAll(".parcoords").remove(),r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},n.toSVG=function(t){var e=t._fullLayout._glimages,n=r.select(t).selectAll(".svg-container");n.filter(function(t,e){return e===n.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus").each(function(n){var r=this.toDataURL("image/png"),i=e.append("svg:image"),o=t._fullLayout._size,l=t._fullData[n.model.key].domain;i.attr({xmlns:a.svg,"xlink:href":r,x:o.l+o.w*l.x[0]-s.overdrag,y:o.t+o.h*(1-l.y[1]),width:(l.x[1]-l.x[0])*o.w+2*s.overdrag,height:(l.y[1]-l.y[0])*o.h,preserveAspectRatio:"none"})}),window.setTimeout(function(){r.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{642:642,764:764,934:934,939:939,98:98}],932:[function(t,e,n){"use strict";var r=t(550),i=t(543),o=t(661),a=t(658).wrap;e.exports=function(t,e){var n=!!e.line.colorscale&&o.isArray(e.line.color),s=n?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),l=n?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return r(e,"line")&&i(e,e.line.color,"line","c"),a({lineColor:s,cscale:l})}},{543:543,550:550,658:658,661:661}],933:[function(t,e,n){"use strict";var r=t(107),i=t(661),o=t(764),a=t(551),s=t(540);e.exports=function(t,e){var n=e[0].trace,l=n.line,u="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0!==l&&l.showscale){var c=l.color,h=l.cmin,f=l.cmax;r(h)||(h=i.aggNums(Math.min,null,c)),r(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=a.makeColorScaleFunc(a.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}else o.autoMargin(t,u)}},{107:107,540:540,551:551,661:661,764:764}],934:[function(t,e,n){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],935:[function(t,e,n){"use strict";function r(t,e,n,r,i){i("line.color",n),s(t,"line")&&o.isArray(t.line.color)?(i("line.colorscale"),l(t,e,r,i,{prefix:"line.",cLetter:"c"})):i("line.color",n)}function i(t,e){function n(t,e){return o.coerce(r,i,a.dimensions,t,e)}var r,i,s,l=t.dimensions||[],c=e.dimensions=[],h=1/0;for(l.length>u&&(o.log("parcoords traces support up to "+u+" dimensions at the moment"),l.splice(u)),s=0;s0)&&(n("label"),n("tickvals"),n("ticktext"),n("tickformat"),n("range"),n("constraintrange"),h=Math.min(h,i.values.length)),i._index=s,c.push(i));if(isFinite(h))for(s=0;sh&&(i.values=i.values.slice(0,h));return c}var o=t(661),a=t(930),s=t(550),l=t(546),u=t(934).maxDimensionCount;e.exports=function(t,e,n,s){function l(n,r){return o.coerce(t,e,a,n,r)}var u=i(t,e);r(t,e,n,s,l),l("domain.x"),l("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var c={family:s.font.family,size:Math.round(s.font.size*(10/12)),color:s.font.color};o.coerceFont(l,"labelfont",c),o.coerceFont(l,"tickfont",c),o.coerceFont(l,"rangefont",c)}},{546:546,550:550,661:661,930:930,934:934}],936:[function(t,e,n){"use strict";var r={};r.attributes=t(930),r.supplyDefaults=t(935),r.calc=t(932),r.plot=t(939),r.colorbar=t(933),r.moduleType="trace",r.name="parcoords",r.basePlotModule=t(931),r.categories=["gl","noOpacity"],r.meta={description:["Parallel coordinates for multidimensional exploratory data analysis.","The samples are specified in `dimensions`.","The colors are set in `line.color`."].join(" ")},e.exports=r},{930:930,931:931,932:932,933:933,935:935,939:939}],937:[function(t,e,n){"use strict";function r(t){t.read({x:0,y:0,width:1,height:1,data:b})}function i(t,e,n,r,i){var o=t._gl;o.enable(o.SCISSOR_TEST),o.scissor(e,n,r,i),t.clear({color:[0,0,0,0],depth:1})}function o(t,e,n,o,a,s){function l(r){var c;c=Math.min(o,a-r*o),s.offset=g*r*o,s.count=g*c,0===r&&(window.cancelAnimationFrame(n.currentRafs[u]),delete n.currentRafs[u],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),n.clearOnly||(e(s),r*o+c>>8*e)%256/255}function u(t,e,n,r){for(var i=[],o=0;o=v-4?l(o,v-2-s):.5);return i}function c(t,e,n){var r,i,o,a=[];for(i=0;if&&(f=t[l].dim2.canvasX,c=l),t[l].dim1.canvasXi)return o;i=a,o=r[n]}return r[r.length-1]}function a(t,e){return function(n,r){if(e){var i=e[r];return null===i||void 0===i?t(n):i}return t(n)}}function s(t,e,n){var r=i(n),o=n.ticktext;return n.tickvals?x.scale.ordinal().domain(n.tickvals.map(a(x.format(n.tickformat),o))).range(n.tickvals.map(function(t){return(t-r[0])/(r[1]-r[0])}).map(function(n){return t-e+n*(e-(t-e))})):x.scale.linear().domain(r).range([t-e,e])}function l(t,e){return x.scale.linear().range([t-e,e])}function u(t){return x.scale.linear().domain(i(t))}function c(t){var e=i(t);return t.tickvals&&x.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function h(t){var e=t.map(function(t){return t[0]}),n=t.map(function(t){return t[1]}).map(function(t){return x.rgb(t)}),r=function(t){return function(e){return e[t]}},i="rgb".split("").map(function(t){return x.scale.linear().clamp(!0).domain(e).range(n.map(r(t)))});return function(t){return i.map(function(e){return e(t)})}}function f(t,e,n){var i=M(e),o=i.trace,a=i.lineColor,s=i.cscale,l=o.line,c=o.domain,f=o.dimensions,d=t.width,p=o.labelfont,m=o.tickfont,v=o.rangefont,x=y.extendDeep({},l,{color:a.map(u({values:a,range:[l.cmin,l.cmax]})),blockLineCount:g.blockLineCount,canvasOverdrag:g.overdrag*g.canvasPixelRatio}),b=Math.floor(d*(c.x[1]-c.x[0])),_=Math.floor(t.height*(c.y[1]-c.y[0])),w=t.margin||{l:80,r:80,t:100,b:80},k=b,T=_;return{key:n,colCount:f.filter(r).length,dimensions:f,tickDistance:g.tickDistance,unitToColor:h(s),lines:x,labelFont:p,tickFont:m,rangeFont:v,translateX:c.x[0]*d,translateY:t.height-c.y[1]*t.height,pad:w,canvasWidth:k*g.canvasPixelRatio+2*x.canvasOverdrag,canvasHeight:T*g.canvasPixelRatio,width:k,height:T,canvasPixelRatio:g.canvasPixelRatio}}function d(t){var e=t.width,n=t.height,i=t.dimensions,o=t.canvasPixelRatio,a=function(n){return e*n/Math.max(1,t.colCount-1)},h=g.verticalPadding/(n*o),f=1-2*h,d=function(t){return h+f*t},p={key:t.key,xScale:a,model:t},m={};return p.dimensions=i.filter(r).map(function(e,r){var i=u(e),h=m[e.label];return m[e.label]=(h||0)+1,{key:e.label+(h?"__"+h:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:g.scatter||e.scatter,xIndex:r,crossfilterDimensionIndex:r,visibleIndex:e._index,height:n,values:e.values,paddedUnitValues:e.values.map(i).map(d),xScale:a,x:a(r),canvasX:a(r)*o,unitScale:l(n,g.verticalPadding),domainScale:s(n,g.verticalPadding,e),ordinalScale:c(e),domainToUnitScale:i,filter:e.constraintrange?e.constraintrange.map(i):[0,1],parent:p,model:t}}),p}function p(t){return g.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function m(t){t.classed(g.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var v=t(937),g=t(934),y=t(661),x=t(98),b=t(561),_=t(658).keyFun,w=t(658).repeat,M=t(658).unwrap;e.exports=function(t,e,n,r,i){function a(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function s(t,e){for(var n=e.panels||(e.panels=[]),r=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=r.length-1,o=0;o<1;o++)for(var a=0;a=n||s>=r)return;var l=t.lineLayer.readPixel(a,r-1-s),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,h={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==P&&(u?i.hover(h):i.unhover&&i.unhover(h),P=c)}}),C.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*g.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var I=e.selectAll("."+g.cn.parcoords).data(S,_);I.exit().remove(),I.enter().append("g").classed(g.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(w,_);e.enter().append("defs");var n=e.selectAll("#"+g.id.filterBarPattern).data(w,_);n.enter().append("pattern").attr("id",g.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),n.attr("x",-g.bar.width).attr("width",g.bar.capturewidth).attr("height",function(t){return t.model.height});var r=n.selectAll("rect").data(w,_);r.enter().append("rect").attr("shape-rendering","crispEdges"),r.attr("height",function(t){return t.model.height}).attr("width",g.bar.width).attr("x",g.bar.width/2).attr("fill",g.bar.fillcolor).attr("fill-opacity",g.bar.fillopacity).attr("stroke",g.bar.strokecolor).attr("stroke-opacity",g.bar.strokeopacity).attr("stroke-width",g.bar.strokewidth)}),I.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var O=I.selectAll("."+g.cn.parcoordsControlView).data(w,_);O.enter().append("g").classed(g.cn.parcoordsControlView,!0).style("box-sizing","content-box"),O.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var D=O.selectAll("."+g.cn.yAxis).data(function(t){return t.dimensions},_);D.enter().append("g").classed(g.cn.yAxis,!0).each(function(t){L.dimensions.push(t)}),O.each(function(t){u(D,t)}),C.each(function(t){t.lineLayer=v(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,g.scatter),t.viewModel[t.key]=t.lineLayer,L.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),D.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),D.call(x.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;A=!1,T||(t.x=Math.max(-g.overdrag,Math.min(t.model.width+g.overdrag,x.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,D.sort(function(t,e){return t.x-e.x}).each(function(e,n){e.xIndex=n,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),u(D,e),D.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),x.select(this).attr("transform","translate("+t.x+", 0)"),D.each(function(n,r,i){i===t.parent.key&&(e.dimensions[r]=n)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!a(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;T?"ending"===T&&(T=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,u(D,e),x.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!a(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),A=!0,i&&i.axesMoved&&i.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),D.exit().remove();var z=D.selectAll("."+g.cn.axisOverlays).data(w,_);z.enter().append("g").classed(g.cn.axisOverlays,!0),z.selectAll("."+g.cn.axis).remove();var j=z.selectAll("."+g.cn.axis).data(w,_);j.enter().append("g").classed(g.cn.axis,!0),j.each(function(t){var e=t.model.height/t.model.tickDistance,n=t.domainScale,r=n.domain();x.select(this).call(x.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?r:null).tickFormat(t.ordinal?function(t){return t}:null).scale(n)),b.font(j.selectAll("text"),t.model.tickFont)}),j.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),j.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var N=z.selectAll("."+g.cn.axisHeading).data(w,_);N.enter().append("g").classed(g.cn.axisHeading,!0);var R=N.selectAll("."+g.cn.axisTitle).data(w,_);R.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),R.attr("transform","translate(0,"+-g.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){b.font(R,t.model.labelFont)});var F=z.selectAll("."+g.cn.axisExtent).data(w,_);F.enter().append("g").classed(g.cn.axisExtent,!0);var B=F.selectAll("."+g.cn.axisExtentTop).data(w,_);B.enter().append("g").classed(g.cn.axisExtentTop,!0),B.attr("transform","translate(0,"+-g.axisExtentOffset+")");var U=B.selectAll("."+g.cn.axisExtentTopText).data(w,_);U.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(m),U.text(function(t){return c(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){b.font(U,t.model.rangeFont)});var V=F.selectAll("."+g.cn.axisExtentBottom).data(w,_);V.enter().append("g").classed(g.cn.axisExtentBottom,!0),V.attr("transform",function(t){return"translate(0,"+(t.model.height+g.axisExtentOffset)+")"});var H=V.selectAll("."+g.cn.axisExtentBottomText).data(w,_);H.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(m),H.text(function(t){return c(t)(t.domainScale.domain()[0])}).each(function(t){b.font(H,t.model.rangeFont)});var q=z.selectAll("."+g.cn.axisBrush).data(w,_),W=q.enter().append("g").classed(g.cn.axisBrush,!0);q.each(function(t){t.brush||(t.brush=x.svg.brush().y(t.unitScale).on("brushstart",h).on("brush",y).on("brushend",k),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),x.select(this).call(t.brush))}),W.selectAll("rect").attr("x",-g.bar.capturewidth/2).attr("width",g.bar.capturewidth),W.selectAll("rect.extent").attr("fill","url(#"+g.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),W.selectAll(".resize rect").attr("height",g.bar.handleheight).attr("opacity",0).style("visibility","visible"),W.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",g.bar.handleoverlap-g.bar.handleheight),W.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",g.bar.handleoverlap);var G=!1,Y=!1;return L}},{561:561,658:658,661:661,934:934,937:937,98:98}],939:[function(t,e,n){"use strict";var r=t(938);e.exports=function(t,e){var n=t._fullLayout,i=n._paper,o=n._paperdiv,a={},s={},l=n._size;e.forEach(function(e,n){a[n]=t.data[n].dimensions,s[n]=t.data[n].dimensions.slice()});r(o,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:function(e,n,r){var i=s[e][n],o=i.constraintrange;o&&2===o.length||(o=i.constraintrange=[]),o[0]=r[0],o[1]=r[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,n){function r(t){return!("visible"in t)||t.visible}function i(t,e,n){var r=e.indexOf(n),i=t.indexOf(r);return-1===i&&(i+=e.length),i}var o=function(t){return function(e,r){return i(n,t,e)-i(n,t,r)}}(s[e].filter(r));a[e].sort(o),s[e].filter(function(t){return!r(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){a[e].splice(a[e].indexOf(t),1),a[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}},{938:938}],940:[function(t,e,n){"use strict";var r=t(536),i=t(729),o=t(703),a=t(650).extendFlat,s=i({editType:"calc",colorEditType:"style",description:"Sets the font used for `textinfo`."});e.exports={labels:{valType:"data_array",editType:"calc",description:"Sets the sector labels."},label0:{valType:"number",role:"info",dflt:0,editType:"calc",description:["Alternate to `labels`.","Builds a numeric set of labels.","Use with `dlabel`","where `label0` is the starting label and `dlabel` the step."].join(" ")},dlabel:{valType:"number",role:"info",dflt:1,editType:"calc",description:"Sets the label step. See `label0` for more info."},values:{valType:"data_array",editType:"calc",description:"Sets the values of the sectors of this pie chart."},marker:{colors:{valType:"data_array",editType:"calc",description:["Sets the color of each sector of this pie chart.","If not specified, the default trace color set is used","to pick the sector colors."].join(" ")},line:{color:{valType:"color",role:"style",dflt:r.defaultLine,arrayOk:!0,editType:"style",description:["Sets the color of the line enclosing each sector."].join(" ")},width:{valType:"number",role:"style",min:0,dflt:0,arrayOk:!0,editType:"style",description:["Sets the width (in px) of the line enclosing each sector."].join(" ")},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc",description:["Sets text elements associated with each sector.","If trace `textinfo` contains a *text* flag, these elements will seen","on the chart.","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")},hovertext:{valType:"string",role:"info",dflt:"",arrayOk:!0,editType:"style",description:["Sets hover text elements associated with each sector.","If a single string, the same string appears for","all data points.","If an array of string, the items are mapped in order of","this trace's sectors.","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")},scalegroup:{valType:"string",role:"info",dflt:"",editType:"calc",description:["If there are multiple pies that should be sized according to","their totals, link them by providing a non-empty group id here","shared by every trace in the same group."].join(" ")},textinfo:{valType:"flaglist",role:"info",flags:["label","text","value","percent"],extras:["none"],editType:"calc",description:["Determines which trace information appear on the graph."].join(" ")},hoverinfo:a({},o.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",role:"info",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc",description:["Specifies the location of the `textinfo`."].join(" ")},textfont:a({},s,{description:"Sets the font used for `textinfo`."}),insidetextfont:a({},s,{description:"Sets the font used for `textinfo` lying inside the pie."}),outsidetextfont:a({},s,{description:"Sets the font used for `textinfo` lying outside the pie."}),domain:{x:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc",description:["Sets the horizontal domain of this pie trace","(in plot fraction)."].join(" ")},y:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc",description:["Sets the vertical domain of this pie trace","(in plot fraction)."].join(" ")},editType:"calc"},hole:{valType:"number",role:"style",min:0,max:1,dflt:0,editType:"calc",description:["Sets the fraction of the radius to cut out of the pie.","Use this to make a donut chart."].join(" ")},sort:{valType:"boolean",role:"style",dflt:!0,editType:"calc",description:["Determines whether or not the sectors are reordered","from largest to smallest."].join(" ")},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],role:"style",dflt:"counterclockwise",editType:"calc",description:["Specifies the direction at which succeeding sectors follow","one another."].join(" ")},rotation:{valType:"number",role:"style",min:-360,max:360,dflt:0,editType:"calc",description:["Instead of the first slice starting at 12 o'clock,","rotate to some other angle."].join(" ")},pull:{valType:"number",role:"style",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc",description:["Sets the fraction of larger radius to pull the sectors","out from the center. This can be a constant","to pull all slices apart from each other equally","or an array to highlight one or more slices."].join(" ")}}},{536:536,650:650,703:703,729:729}],941:[function(t,e,n){"use strict";function r(t,e){for(var n=[],r=0;r")}return m};var l},{107:107,1266:1266,537:537,944:944}],943:[function(t,e,n){"use strict";var r=t(661),i=t(940);e.exports=function(t,e,n,o){function a(n,o){return r.coerce(t,e,i,n,o)}var s=r.coerceFont,l=a("values");if(Array.isArray(l)&&l.length){var u=a("labels");Array.isArray(u)||(a("label0"),a("dlabel")),a("marker.line.width")&&a("marker.line.color");var c=a("marker.colors");Array.isArray(c)||(e.marker.colors=[]),a("scalegroup");var h=a("text"),f=a("textinfo",Array.isArray(h)?"text+percent":"percent");if(a("hovertext"),f&&"none"!==f){var d=a("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,v=p||"outside"===d;if(m||v){var g=s(a,"textfont",o.font);m&&s(a,"insidetextfont",g),v&&s(a,"outsidetextfont",g)}}a("domain.x"),a("domain.y"),a("hole"),a("sort"),a("direction"),a("rotation"),a("pull")}else e.visible=!1}},{661:661,940:940}],944:[function(t,e,n){"use strict";var r=t(661);n.formatPiePercent=function(t,e){var n=(100*t).toPrecision(3);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)+"%"},n.formatPieValue=function(t,e){var n=t.toPrecision(10);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)}},{661:661}],945:[function(t,e,n){"use strict";var r={};r.attributes=t(940),r.supplyDefaults=t(943),r.supplyLayoutDefaults=t(947),r.layoutAttributes=t(946),r.calc=t(942),r.plot=t(948),r.style=t(949),r.styleOne=t(950),r.moduleType="trace",r.name="pie",r.basePlotModule=t(941),r.categories=["pie","showLegend"],r.meta={description:["A data visualized by the sectors of the pie is set in `values`.","The sector labels are set in `labels`.","The sector colors are set in `marker.colors`"].join(" ")},e.exports=r},{940:940,941:941,942:942,943:943,946:946,947:947,948:948,949:949,950:950}],946:[function(t,e,n){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],947:[function(t,e,n){"use strict";var r=t(661),i=t(946);e.exports=function(t,e){!function(n,o){r.coerce(t,e,i,n,o)}("hiddenlabels")}},{661:661,946:946}],948:[function(t,e,n){"use strict";function r(t,e,n){var r=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,a=Math.PI*Math.min(e.v/n.vTotal,.5),s=1-n.trace.hole,l=i(e,n),u={scale:l*n.r*2/r,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=o+1/(2*Math.tan(a)),h=n.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(o*o+s/2)+o)),f={scale:2*h/t.height,rCenter:Math.cos(h/n.r)-h*o/n.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/o,p=d+1/(2*Math.tan(a)),m=n.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*m/t.width,rCenter:Math.cos(m/n.r)-m/o/n.r,rotate:(180/Math.PI*e.midangle+810)%180-90},g=v.scale>f.scale?v:f;return u.scale<1&&g.scale>u.scale?g:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var n=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(n)),(1-e.trace.hole)/2)}function o(t,e){var n=e.pxmid[0],r=e.pxmid[1],i=t.width/2,o=t.height/2;return n<0&&(i*=-1),r<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(o)*(i>0?1:-1)/2,y:o/(1+n*n/(r*r)),outside:!0}}function a(t,e){var n,r,i,o,a,s,l,u,c,h,f,d,p;for(r=0;r<2;r++)for(i=r?function(t,e){return t.pxmid[1]-e.pxmid[1]}:function(t,e){return e.pxmid[1]-t.pxmid[1]},a=r?Math.max:Math.min,l=r?1:-1,n=0;n<2;n++){for(o=n?Math.max:Math.min,s=n?1:-1,(u=t[r][n]).sort(i),c=t[1-r][n],h=c.concat(u),d=[],f=0;f0&&(t.labelExtraY=g),Array.isArray(e.pull))for(u=0;u=e.pull[c.i]||((t.pxmid[1]-c.pxmid[1])*l>0?(g=c.cyFinal+a(c.px0[1],c.px1[1])-p-t.labelExtraY)*l>0&&(t.labelExtraY+=g):(m+t.labelExtraY-v)*l>0&&(i=3*s*Math.abs(u-h.indexOf(t)),(f=c.cxFinal+o(c.px0[0],c.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=f)))}(d[f],m)}}}function s(t,e){var n,r,i,o,a,s,l,c,h,f,d=[];for(i=0;ic&&(c=s.pull[o]);a.r=Math.min(n/u(s.tilt,Math.sin(l),s.depth),r/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),a.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,a.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===d.indexOf(s.scalegroup)&&d.push(s.scalegroup)}for(o=0;oh.vTotal/2?1:0)}function u(t,e,n){if(!t)return 1;var r=Math.sin(t*Math.PI/180);return Math.max(.01,n*r*Math.abs(e)+2*Math.sqrt(1-r*r*e*e))}var c=t(98),h=t(578),f=t(537),d=t(561),p=t(683),m=t(944);e.exports=function(t,e){var n=t._fullLayout;s(e,n._size);var u=n._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],v=u.trace,g=(v.depth||0)*u.r*Math.sin(0)/2,y=v.tiltaxis||0,x=y*Math.PI/180,b=[g*Math.sin(x),g*Math.cos(x)],_=u.r*Math.cos(0),w=s.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],g=!1;s.each(function(e){function a(t,n,r,i){return"a"+i*u.r+","+i*_+" "+y+" "+e.largeArc+(r?" 1 ":" 0 ")+i*(n[0]-t[0])+","+i*(n[1]-t[1])}if(e.hidden)c.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=v.index,l[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var s=u.cx+b[0],f=u.cy+b[1],x=c.select(this),w=x.selectAll("path.surface").data([e]),M=!1;if(w.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),x.select("path.textline").remove(),x.on("mouseover",function(r){r.originalEvent=c.event;var o=t._fullLayout,a=t._fullData[v.index],l=h.castHoverinfo(a,o,e.i);if("all"===l&&(l="label+text+value+percent+name"),!t._dragging&&!1!==o.hovermode&&"none"!==l&&"skip"!==l&&l){var d=i(e,u),p=s+e.pxmid[0]*(1-d),g=f+e.pxmid[1]*(1-d),y=n.separators,x=[];-1!==l.indexOf("label")&&x.push(e.label),-1!==l.indexOf("text")&&(a.hovertext?x.push(Array.isArray(a.hovertext)?a.hovertext[e.i]:a.hovertext):a.text&&a.text[e.i]&&x.push(a.text[e.i])),-1!==l.indexOf("value")&&x.push(m.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&x.push(m.formatPiePercent(e.v/u.vTotal,y)),h.loneHover({x0:p-d*u.r,x1:p+d*u.r,y:g,text:x.join("
"),name:-1!==l.indexOf("name")?a.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:h.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:h.castHoverOption(v,e.i,"bordercolor"),fontFamily:h.castHoverOption(v,e.i,"font.family"),fontSize:h.castHoverOption(v,e.i,"font.size"),fontColor:h.castHoverOption(v,e.i,"font.color")},{container:o._hoverlayer.node(),outerContainer:o._paper.node(),gd:t}),h.hover(t,r,"pie"),M=!0}else h.hover(t,r,"pie")}).on("mouseout",function(e){e.originalEvent=c.event,t.emit("plotly_unhover",{event:c.event,points:[e]}),M&&(h.loneUnhover(n._hoverlayer.node()),M=!1)}).on("click",function(){t._hoverdata=[e],t._hoverdata.trace=u.trace,h.click(t,c.event)}),v.pull){var k=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;k>0&&(s+=k*e.pxmid[0],f+=k*e.pxmid[1])}e.cxFinal=s,e.cyFinal=f;var T=v.hole;if(e.v===u.vTotal){var A="M"+(s+e.px0[0])+","+(f+e.px0[1])+a(e.px0,e.pxmid,!0,1)+a(e.pxmid,e.px0,!0,1)+"Z";T?w.attr("d","M"+(s+T*e.px0[0])+","+(f+T*e.px0[1])+a(e.px0,e.pxmid,!1,T)+a(e.pxmid,e.px0,!1,T)+"Z"+A):w.attr("d",A)}else{var S=a(e.px0,e.px1,!0,1);if(T){var E=1-T;w.attr("d","M"+(s+T*e.px1[0])+","+(f+T*e.px1[1])+a(e.px1,e.px0,!1,T)+"l"+E*e.px0[0]+","+E*e.px0[1]+S+"Z")}else w.attr("d","M"+s+","+f+"l"+e.px0[0]+","+e.px0[1]+S+"Z")}var C=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,L=x.selectAll("g.slicetext").data(e.text&&"none"!==C?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each(function(){var n=c.select(this).selectAll("text").data([0]);n.enter().append("text").attr("data-notex",1),n.exit().remove(),n.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,"outside"===C?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans,t);var i,a=d.bBox(n.node());"outside"===C?i=o(a,e):(i=r(a,e,u),"auto"===C&&i.scale<1&&(n.call(d.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(a=d.bBox(n.node())),i=o(a,e)));var l=s+e.pxmid[0]*i.rCenter+(i.x||0),h=f+e.pxmid[1]*i.rCenter+(i.y||0);i.outside&&(e.yLabelMin=h-a.height/2,e.yLabelMid=h,e.yLabelMax=h+a.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),n.attr("transform","translate("+l+","+h+")"+(i.scale<1?"scale("+i.scale+")":"")+(i.rotate?"rotate("+i.rotate+")":"")+"translate("+-(a.left+a.right)/2+","+-(a.top+a.bottom)/2+")")})}}),g&&a(l,v),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),n=e.select("g.slicetext text");n.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+n.attr("transform"));var r=t.cxFinal+t.pxmid[0],i="M"+r+","+(t.cyFinal+t.pxmid[1]),o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var a=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(a)>Math.abs(s)?i+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(r+t.labelExtraX+o):i+="l"+t.labelExtraX+","+a+"v"+(s-a)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{537:537,561:561,578:578,683:683,944:944,98:98}],949:[function(t,e,n){"use strict";var r=t(98),i=t(950);e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,n=r.select(this);n.style({opacity:e.opacity}),n.selectAll(".top path.surface").each(function(t){r.select(this).call(i,t,e)})})}},{950:950,98:98}],950:[function(t,e,n){"use strict";var r=t(537);e.exports=function(t,e,n){var i=n.marker.line.color;Array.isArray(i)&&(i=i[e.i]||r.defaultLine);var o=n.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o}).call(r.fill,e.color).call(r.stroke,i)}},{537:537}],951:[function(t,e,n){"use strict";var r=t(1010);e.exports={x:r.x,y:r.y,xy:{valType:"data_array",editType:"calc",description:["Faster alternative to specifying `x` and `y` separately.","If supplied, it must be a typed `Float32Array` array that","represents points such that `xy[i * 2] = x[i]` and `xy[i * 2 + 1] = y[i]`"].join(" ")},indices:{valType:"data_array",editType:"calc",description:["A sequential value, 0..n, supply it to avoid creating this array inside plotting.","If specified, it must be a typed `Int32Array` array.","Its length must be equal to or greater than the number of points.","For the best performance and memory use, create one large `indices` typed array","that is guaranteed to be at least as long as the largest number of points during","use, and reuse it on each `Plotly.restyle()` call."].join(" ")},xbounds:{valType:"data_array",editType:"calc",description:["Specify `xbounds` in the shape of `[xMin, xMax] to avoid looping through","the `xy` typed array. Use it in conjunction with `xy` and `ybounds` for the performance benefits."].join(" ")},ybounds:{valType:"data_array",editType:"calc",description:["Specify `ybounds` in the shape of `[yMin, yMax] to avoid looping through","the `xy` typed array. Use it in conjunction with `xy` and `xbounds` for the performance benefits."].join(" ")},text:r.text,marker:{color:{valType:"color",arrayOk:!1,role:"style",editType:"calc",description:["Sets the marker fill color. It accepts a specific color.","If the color is not fully opaque and there are hundreds of thousands","of points, it may cause slower zooming and panning."].join("")},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,role:"style",editType:"calc",description:["Sets the marker opacity. The default value is `1` (fully opaque).","If the markers are not fully opaque and there are hundreds of thousands","of points, it may cause slower zooming and panning.","Opacity fades the color even if `blend` is left on `false` even if there","is no translucency effect in that case."].join(" ")},blend:{valType:"boolean",dflt:null,role:"style",editType:"calc",description:["Determines if colors are blended together for a translucency effect","in case `opacity` is specified as a value less then `1`.","Setting `blend` to `true` reduces zoom/pan","speed if used with large numbers of points."].join(" ")},sizemin:{valType:"number",min:.1,max:2,dflt:.5,role:"style",editType:"calc",description:["Sets the minimum size (in px) of the rendered marker points, effective when","the `pointcloud` shows a million or more points."].join(" ")},sizemax:{valType:"number",min:.1,dflt:20,role:"style",editType:"calc",description:["Sets the maximum size (in px) of the rendered marker points.","Effective when the `pointcloud` shows only few points."].join(" ")},border:{color:{valType:"color",arrayOk:!1,role:"style",editType:"calc",description:["Sets the stroke color. It accepts a specific color.","If the color is not fully opaque and there are hundreds of thousands","of points, it may cause slower zooming and panning."].join(" ")},arearatio:{valType:"number",min:0,max:1,dflt:0,role:"style",editType:"calc",description:["Specifies what fraction of the marker area is covered with the","border."].join(" ")},editType:"calc"},editType:"calc"}}},{1010:1010}],952:[function(t,e,n){"use strict";function r(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t(220),o=t(682),a=t(973),s=["xaxis","yaxis"],l=r.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=a(t,{})},l.updateFast=function(t){var e,n,r,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(r=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);if(f)n=f;else for(n=new Int32Array(e),s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);this.idToIndex=n,this.pointcloudOptions.idToIndex=n,this.pointcloudOptions.positions=r;var p=o(t.marker.color),m=o(t.marker.border.color),v=t.opacity*t.marker.opacity;p[3]*=v,this.pointcloudOptions.color=p;var g=t.marker.blend;if(null===g){g=l.length<100||u.length<100}this.pointcloudOptions.blend=g,m[3]*=v,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,x/2)},l.expandAxesFast=function(t,e){for(var n,r,i,o=e||.5,a=0;a<2;a++)(r=(n=this.scene[s[a]])._min)||(r=[]),r.push({val:t[a],pad:o}),(i=n._max)||(i=[]),i.push({val:t[a+2],pad:o})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var n=new r(t,e.uid);return n.update(e),n}},{220:220,682:682,973:973}],953:[function(t,e,n){"use strict";var r=t(661),i=t(951);e.exports=function(t,e,n){function o(n,o){return r.coerce(t,e,i,n,o)}o("x"),o("y"),o("xbounds"),o("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),o("text"),o("marker.color",n),o("marker.opacity"),o("marker.blend"),o("marker.sizemin"),o("marker.sizemax"),o("marker.border.color",n),o("marker.border.arearatio")}},{661:661,951:951}],954:[function(t,e,n){"use strict";var r={};r.attributes=t(951),r.supplyDefaults=t(953),r.calc=t(989),r.plot=t(952),r.moduleType="trace",r.name="pointcloud",r.basePlotModule=t(741),r.categories=["gl2d","showLegend"],r.meta={description:["The data visualized as a point cloud set in `x` and `y`","using the WebGl plotting engine."].join(" ")},e.exports=r},{741:741,951:951,952:952,953:953,989:989}],955:[function(t,e,n){"use strict";var r=t(729),i=t(703),o=t(536),a=t(570),s=t(650).extendFlat,l=t(689).overrideAll;e.exports=l({hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:a.hoverlabel,domain:{x:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the horizontal domain of this `sankey` trace","(in plot fraction)."].join(" ")},y:{valType:"info_array",role:"info",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1],description:["Sets the vertical domain of this `sankey` trace","(in plot fraction)."].join(" ")}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h",role:"style",description:"Sets the orientation of the Sankey diagram."},valueformat:{valType:"string",dflt:".3s",role:"style",description:["Sets the value formatting rule using d3 formatting mini-language","which is similar to those of Python. See","https://github.com/d3/d3-format/blob/master/README.md#locale_format"].join(" ")},valuesuffix:{valType:"string",dflt:"",role:"style",description:["Adds a unit to follow the value in the hover tooltip. Add a space if a separation","is necessary from the value."].join(" ")},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap",role:"style",description:["If value is `snap` (the default), the node arrangement is assisted by automatic snapping of elements to","preserve space between nodes specified via `nodepad`.","If value is `perpendicular`, the nodes can only move along a line perpendicular to the flow.","If value is `freeform`, the nodes can freely move on the plane.","If value is `fixed`, the nodes are stationary."].join(" ")},textfont:r({description:"Sets the font for node labels"}),node:{label:{valType:"data_array",dflt:[],role:"info",description:"The shown name of the node."},color:{valType:"color",role:"style",arrayOk:!0,description:["Sets the `node` color. It can be a single value, or an array for specifying color for each `node`.","If `node.color` is omitted, then the default `Plotly` color palette will be cycled through","to have a variety of colors. These defaults are not fully opaque, to allow some visibility of","what is beneath the node."].join(" ")},line:{color:{valType:"color",role:"style",dflt:o.defaultLine,arrayOk:!0,description:["Sets the color of the `line` around each `node`."].join(" ")},width:{valType:"number",role:"style",min:0,dflt:.5,arrayOk:!0,description:["Sets the width (in px) of the `line` around each `node`."].join(" ")}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20,role:"style",description:"Sets the padding (in px) between the `nodes`."},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20,role:"style",description:"Sets the thickness (in px) of the `nodes`."},description:"The nodes of the Sankey plot."},link:{label:{valType:"data_array",dflt:[],role:"info",description:"The shown name of the link."},color:{valType:"color",role:"style",arrayOk:!0,description:["Sets the `link` color. It can be a single value, or an array for specifying color for each `link`.","If `link.color` is omitted, then by default, a translucent grey link will be used."].join(" ")},line:{color:{valType:"color",role:"style",dflt:o.defaultLine,arrayOk:!0,description:["Sets the color of the `line` around each `link`."].join(" ")},width:{valType:"number",role:"style",min:0,dflt:0,arrayOk:!0,description:["Sets the width (in px) of the `line` around each `link`."].join(" ")}},source:{valType:"data_array",role:"info",dflt:[],description:"An integer number `[0..nodes.length - 1]` that represents the source node."},target:{valType:"data_array",role:"info",dflt:[],description:"An integer number `[0..nodes.length - 1]` that represents the target node."},value:{valType:"data_array",dflt:[],role:"info",description:"A numeric value representing the flow volume value."},description:"The links of the Sankey plot."}},"calc","nested")},{536:536,570:570,650:650,689:689,703:703,729:729}],956:[function(t,e,n){"use strict";var r=t(689).overrideAll,i=t(764),o=t(961),a=t(579);n.name="sankey",n.attr="type",n.baseLayoutAttrOverrides=r({hoverlabel:a.hoverlabel},"plot","nested"),n.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"sankey","sankey");e.length&&o(t,e)},n.clean=function(t,e,n,r){var i=r._has&&r._has("sankey"),o=e._has&&e._has("sankey");i&&!o&&r._paperdiv.selectAll(".sankey").remove()}},{579:579,689:689,764:764,961:961}],957:[function(t,e,n){"use strict";function r(t,e,n){for(var r=t.map(function(){return[]}),o=0;o1})}var i=t(1260),o=t(661),a=t(658).wrap;e.exports=function(t,e){return r(e.node.label,e.link.source,e.link.target)&&(o.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{1260:1260,658:658,661:661}],958:[function(t,e,n){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],959:[function(t,e,n){"use strict";var r=t(661),i=t(955),o=t(536).defaults,a=t(537),s=t(1266);e.exports=function(t,e,n,l){function u(n,o){return r.coerce(t,e,i,n,o)}u("node.label"),u("node.pad"),u("node.thickness"),u("node.line.color"),u("node.line.width");var c=function(t){return o[t%o.length]};u("node.color",e.node.label.map(function(t,e){return a.addOpacity(c(e),.8)})),u("link.label"),u("link.source"),u("link.target"),u("link.value"),u("link.line.color"),u("link.line.width"),u("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),u("domain.x"),u("domain.y"),u("orientation"),u("valueformat"),u("valuesuffix"),u("arrangement"),r.coerceFont(u,"textfont",r.extendFlat({},l.font));e.node.label.some(function(t,n){return-1===e.link.source.indexOf(n)&&-1===e.link.target.indexOf(n)})&&r.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{1266:1266,536:536,537:537,661:661,955:955}],960:[function(t,e,n){"use strict";var r={};r.attributes=t(955),r.supplyDefaults=t(959),r.calc=t(957),r.plot=t(961),r.moduleType="trace",r.name="sankey",r.basePlotModule=t(956),r.categories=["noOpacity"],r.meta={description:["Sankey plots for network flow data analysis.","The nodes are specified in `nodes` and the links between sources and targets in `links`.","The colors are set in `nodes[i].color` and `links[i].color`; otherwise defaults are used."].join(" ")},e.exports=r},{955:955,956:956,957:957,959:959,961:961}],961:[function(t,e,n){"use strict";function r(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function o(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function a(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function u(t,e,n){e&&n&&i(n,e).selectAll("."+x.sankeyLink).filter(s(e)).call(h.bind(0,e,n,!1))}function c(t,e,n){e&&n&&i(n,e).selectAll("."+x.sankeyLink).filter(s(e)).call(f.bind(0,e,n,!1))}function h(t,e,n,r){var o=r.datum().link.label;r.style("fill-opacity",.4),o&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===o}).style("fill-opacity",.4),n&&i(e,t).selectAll("."+x.sankeyNode).filter(l(t)).call(u)}function f(t,e,n,r){var o=r.datum().link.label;r.style("fill-opacity",function(t){return t.tinyColorAlpha}),o&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===o}).style("fill-opacity",function(t){return t.tinyColorAlpha}),n&&i(e,t).selectAll(x.sankeyNode).filter(l(t)).call(c)}function d(t,e){var n=t.hoverlabel||{},r=y.nestedProperty(n,e).get();return!Array.isArray(r)&&r}var p=t(98),m=t(962),v=t(578),g=t(537),y=t(661),x=t(958).cn;e.exports=function(t,e){var n=t._fullLayout,i=n._paper,s=n._size;m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,n,r){var i=n.link;i.originalEvent=p.event,p.select(e).call(h.bind(0,n,r,!0)),v.hover(t,i,"sankey")},follow:function(e,i){var s=i.link.trace,l=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),c=u.left+u.width/2,h=u.top+u.height/2,f=v.loneHover({x:c-l.left,y:h-l.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",["Source:",i.link.source.label].join(" "),["Target:",i.link.target.label].join(" ")].filter(r).join("
"),color:d(s,"bgcolor")||g.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});o(g,.85),a(g)},unhover:function(e,r,i){p.select(e).call(c,r,i),t.emit("plotly_unhover",{event:p.event,points:[r.node]}),v.loneUnhover(n._hoverlayer.node())},select:function(e,n,r){var i=n.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(c,n,r),v.click(t,{target:!0})}}})}},{537:537,578:578,661:661,958:958,962:962,98:98}],962:[function(t,e,n){"use strict";function r(t){var e,n=[];for(e=0;e1||t.linkLineWidth>0}function g(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function y(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function x(t){return L.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+C.nodeTextOffsetHorizontal:C.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-C.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-C.nodeTextOffsetHorizontal,0]])}function b(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function _(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function w(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function M(t){return t.horizontal&&t.left?"100%":"0%"}function k(t,e,n){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(n.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(n.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(n.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(n.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||n.select(this,t,e)})}function T(t,e,n){var r=L.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(r){if("fixed"!==r.arrangement&&(j.raiseToTop(this),r.interactionState.dragInProgress=r.node,i(r.node),r.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,r.interactionState.hovered),r.interactionState.hovered=!1),"snap"===r.arrangement)){var o=r.traceId+"|"+Math.floor(r.node.originalX);r.forceLayouts[o]?r.forceLayouts[o].alpha(1):A(t,o,r),S(t,e,r,o)}}).on("drag",function(n){if("fixed"!==n.arrangement){var r=L.event.x,a=L.event.y;"snap"===n.arrangement?(n.node.x=r,n.node.y=a):("freeform"===n.arrangement&&(n.node.x=r),n.node.y=Math.max(n.node.dy/2,Math.min(n.size-n.node.dy/2,a))),i(n.node),"snap"!==n.arrangement&&(n.sankey.relayout(),p(t.filter(o(n)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(r)}function A(t,e,n){var r=n.sankey.nodes().filter(function(t){return t.originalX===n.node.originalX});n.forceLayouts[e]=z.forceSimulation(r).alphaDecay(0).force("collide",z.forceCollide().radius(function(t){return t.dy/2+n.nodePad/2}).strength(1).iterations(C.forceIterations)).force("constrain",E(t,e,r,n)).stop()}function S(t,e,n,r){window.requestAnimationFrame(function i(){for(var a=0;a0&&window.requestAnimationFrame(i)})}function E(t,e,n,r){return function(){for(var t=0,i=0;i0&&r.forceLayouts[e].alpha(0)}}var C=t(958),L=t(98),P=t(1266),I=t(537),O=t(561),D=t(10).sankey,z=t(94),j=t(661),N=t(658).keyFun,R=t(658).repeat,F=t(658).unwrap;e.exports=function(t,e,n,i){var o=t.selectAll("."+C.cn.sankey).data(e.filter(function(t){return F(t).trace.visible}).map(l.bind(null,n)),N);o.exit().remove(),o.enter().append("g").classed(C.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").style("box-sizing","content-box").attr("transform",g),o.transition().ease(C.ease).duration(C.duration).attr("transform",g);var a=o.selectAll("."+C.cn.sankeyLinks).data(R,N);a.enter().append("g").classed(C.cn.sankeyLinks,!0).style("fill","none");var s=a.selectAll("."+C.cn.sankeyLink).data(function(t){var e={};return t.sankey.links().filter(function(t){return t.value}).map(u.bind(null,e,t))},N);s.enter().append("path").classed(C.cn.sankeyLink,!0).attr("d",f).call(k,o,i.linkEvents),s.style("stroke",function(t){return v(t)?I.tinyRGB(P(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return v(t)?I.opacity(t.linkLineColor):t.tinyColorAlpha}).style("stroke-width",function(t){return v(t)?t.linkLineWidth:1}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),s.transition().ease(C.ease).duration(C.duration).attr("d",f),s.exit().transition().ease(C.ease).duration(C.duration).style("opacity",0).remove();var d=o.selectAll("."+C.cn.sankeyNodeSet).data(R,N);d.enter().append("g").classed(C.cn.sankeyNodeSet,!0),d.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var p=d.selectAll("."+C.cn.sankeyNode).data(function(t){var e=t.sankey.nodes(),n={};return r(e),e.filter(function(t){return t.value}).map(c.bind(null,n,t))},N);p.enter().append("g").classed(C.cn.sankeyNode,!0).call(h).call(k,o,i.nodeEvents),p.call(T,s,i),p.transition().ease(C.ease).duration(C.duration).call(h),p.exit().transition().ease(C.ease).duration(C.duration).style("opacity",0).remove();var A=p.selectAll("."+C.cn.nodeRect).data(R);A.enter().append("rect").classed(C.cn.nodeRect,!0).call(m),A.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return I.tinyRGB(P(t.nodeLineColor))}).style("stroke-opacity",function(t){return I.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),A.transition().ease(C.ease).duration(C.duration).call(m);var S=p.selectAll("."+C.cn.nodeCapture).data(R);S.enter().append("rect").classed(C.cn.nodeCapture,!0).style("fill-opacity",0),S.attr("x",function(t){return t.zoneX}).attr("y",function(t){return t.zoneY}).attr("width",function(t){return t.zoneWidth}).attr("height",function(t){return t.zoneHeight});var E=p.selectAll("."+C.cn.nodeCentered).data(R);E.enter().append("g").classed(C.cn.nodeCentered,!0).attr("transform",y),E.transition().ease(C.ease).duration(C.duration).attr("transform",y);var L=E.selectAll("."+C.cn.nodeLabelGuide).data(R);L.enter().append("path").classed(C.cn.nodeLabelGuide,!0).attr("id",function(t){return t.uniqueNodeLabelPathId}).attr("d",x).attr("transform",b),L.transition().ease(C.ease).duration(C.duration).attr("d",x).attr("transform",b);var D=E.selectAll("."+C.cn.nodeLabel).data(R);D.enter().append("text").classed(C.cn.nodeLabel,!0).attr("transform",_).style("user-select","none").style("cursor","default").style("fill","black"),D.style("text-shadow",function(t){return t.horizontal?"-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff":"none"}).each(function(t){O.font(D,t.textFont)}),D.transition().ease(C.ease).duration(C.duration).attr("transform",_);var z=D.selectAll("."+C.cn.nodeLabelTextPath).data(R);z.enter().append("textPath").classed(C.cn.nodeLabelTextPath,!0).attr("alignment-baseline","middle").attr("xlink:href",function(t){return"#"+t.uniqueNodeLabelPathId}).attr("startOffset",M).style("fill",w),z.text(function(t){return t.horizontal||t.node.dy>5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),z.transition().ease(C.ease).duration(C.duration).attr("startOffset",M).style("fill",w)}},{10:10,1266:1266,537:537,561:561,658:658,661:661,94:94,958:958,98:98}],963:[function(t,e,n){"use strict";var r=t(661);e.exports=function(t,e){for(var n=0;nm&&d.splice(m,d.length-m),p.length>m&&p.splice(m,p.length-m);var v={padded:!0},g={padded:!0};if(a.hasMarkers(e)){if(n=e.marker,u=n.size,Array.isArray(u)){var y={type:"linear"};i.setConvert(y),(u=y.makeCalcdata(e.marker,"size")).length>m&&u.splice(m,u.length-m)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=g.ppad=Array.isArray(u)?u.map(x):x(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(a.hasMarkers(e)||a.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,i.expand(h,d,v),i.expand(f,p,g);var _=new Array(m);for(c=0;c=0;i--){var o=t[i];if("scatter"===o.type&&o.xaxis===n.xaxis&&o.yaxis===n.yaxis){o.opacity=void 0;break}}}}}},{}],967:[function(t,e,n){"use strict";var r=t(107),i=t(661),o=t(764),a=t(551),s=t(540);e.exports=function(t,e){var n=e[0].trace,l=n.marker,u="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0!==l&&l.showscale){var c=l.color,h=l.cmin,f=l.cmax;r(h)||(h=i.aggNums(Math.min,null,c)),r(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=a.makeColorScaleFunc(a.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}else o.autoMargin(t,u)}},{107:107,540:540,551:551,661:661,764:764}],968:[function(t,e,n){"use strict";var r=t(550),i=t(543),o=t(985);e.exports=function(t){o.hasLines(t)&&r(t,"line")&&i(t,t.line.color,"line","c"),o.hasMarkers(t)&&(r(t,"marker")&&i(t,t.marker.color,"marker","c"),r(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{543:543,550:550,985:985}],969:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],970:[function(t,e,n){"use strict";var r=t(661),i=t(964),o=t(969),a=t(985),s=t(987),l=t(981),u=t(976),c=t(978),h=t(986),f=t(972),d=t(566);e.exports=function(t,e,n,p){function m(n,o){return r.coerce(t,e,i,n,o)}var v=s(t,e,p,m),g=vF!=(P=S[T][1])>=F&&(E=(C=S[T-1][0])+(S[T][0]-C)*(F-L)/(P-L),z=Math.min(z,E),j=Math.max(j,E));z=Math.max(z,0),j=Math.min(j,d._length);var B=s.defaultLine;return s.opacity(f.fillcolor)?B=f.fillcolor:s.opacity((f.line||{}).color)&&(B=f.line.color),r.extendFlat(t,{distance:u+10,x0:z,x1:j,y0:F,y1:F,color:B}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{537:537,567:567,578:578,661:661,971:971,973:973}],975:[function(t,e,n){"use strict";var r={},i=t(985);r.hasLines=i.hasLines,r.hasMarkers=i.hasMarkers,r.hasText=i.hasText,r.isBubble=i.isBubble,r.attributes=t(964),r.supplyDefaults=t(970),r.cleanData=t(966),r.calc=t(965),r.arraysToCalcdata=t(963),r.plot=t(982),r.colorbar=t(967),r.style=t(984),r.hoverPoints=t(974),r.selectPoints=t(983),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t(715),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={description:["The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.","The data visualized as scatter point or lines is set in `x` and `y`.","Text (appearing either on the chart or on hover only) is via `text`.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","to numerical arrays."].join(" ")},e.exports=r},{715:715,963:963,964:964,965:965,966:966,967:967,970:970,974:974,982:982,983:983,984:984,985:985}],976:[function(t,e,n){"use strict";var r=t(550),i=t(546);e.exports=function(t,e,n,o,a,s){var l=(t.marker||{}).color;a("line.color",n),r(t,"line")?i(t,e,o,a,{prefix:"line.",cLetter:"c"}):a("line.color",!Array.isArray(l)&&l||n),a("line.width"),(s||{}).noDash||a("line.dash")}},{546:546,550:550}],977:[function(t,e,n){"use strict";var r=t(640).BADNUM,i=t(661),o=i.segmentsIntersect,a=i.constrain,s=t(969);e.exports=function(t,e){function n(e){var n=O.c2p(t[e].x),i=D.c2p(t[e].y);return n!==r&&i!==r&&[n,i]}function l(t){var e=t[0]/O._length,n=t[1]/D._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-n,n-1))*N}function u(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function c(t){if(t[0]<$||t[0]>Q||t[1]et)return[a(t[0],$,Q),a(t[1],tt,et)]}function h(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===Q)||(t[1]===e[1]&&(t[1]===tt||t[1]===et)||void 0)}function f(t,e,n){return function(r,o){var a=c(r),s=c(o),l=[];if(a&&s&&h(a,s))return l;a&&l.push(a),s&&l.push(s);var u=2*i.constrain((r[t]+o[t])/2,e,n)-((a||r)[t]+(s||o)[t]);if(u){(a&&s?u>0==a[t]>s[t]?a:s:a||s)[t]+=u}return l}}function d(t,e){var n=e[0]-t[0],r=(e[1]-t[1])/n;return(t[1]*e[0]-e[1]*t[0])/n>0?[r>0?$:Q,et]:[r>0?Q:$,tt]}function p(t){var e=t[0],n=t[1],r=e===V[H-1][0],i=n===V[H-1][1];if(!r||!i)if(H>1){var o=e===V[H-2][0],a=n===V[H-2][1];r&&(e===$||e===Q)&&o?a?H--:V[H-1]=t:i&&(n===tt||n===et)&&a?o?H--:V[H-1]=t:V[H++]=t}else V[H++]=t}function m(t){V[H-1][0]!==t[0]&&V[H-1][1]!==t[1]&&p([G,Y]),p(t),X=null,G=Y=0}function v(t){if(q=t[0]<$?$:t[0]>Q?Q:0,W=t[1]et?et:0,q||W){if(H)if(X){var e=K(X,t);e.length>1&&(m(e[0]),V[H++]=e[1])}else Z=K(V[H-1],t)[0],V[H++]=Z;else V[H++]=[q||t[0],W||t[1]];var n=V[H-1];q&&W&&(n[0]!==q||n[1]!==W)?(X&&(G!==q&&Y!==W?p(G&&Y?d(X,t):[G||q,Y||W]):G&&Y&&p([G,Y])),p([q,W])):G-q&&Y-W&&p([q||G,W||Y]),X=t,G=q,Y=W}else X&&m(K(X,t)[0]),V[H++]=t}var g,y,x,b,_,w,M,k,T,A,S,E,C,L,P,I,O=e.xaxis,D=e.yaxis,z=e.simplify,j=e.connectGaps,N=e.baseTolerance,R=e.shape,F="linear"===R,B=[],U=s.minTolerance,V=new Array(t.length),H=0;z||(N=U=-1);var q,W,G,Y,X,Z,K,J=s.maxScreensAway,$=-O._length*J,Q=O._length*(1+J),tt=-D._length*J,et=D._length*(1+J),nt=[[$,tt,Q,tt],[Q,tt,Q,et],[Q,et,$,et],[$,et,$,tt]];for("linear"===R||"spline"===R?K=function(t,e){for(var n=[],r=0,i=0;i<4;i++){var a=nt[i],s=o(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);s&&(!r||Math.abs(s.x-n[0][0])>1||Math.abs(s.y-n[0][1])>1)&&(s=[s.x,s.y],r&&u(s,t)l(w))break;x=w,(C=T[0]*k[0]+T[1]*k[1])>S?(S=C,b=w,M=!1):C=t.length||!w)break;v(w),y=w}}else v(b)}X&&p([G||X[0],Y||X[1]]),B.push(V.slice(0,H))}return B}},{640:640,661:661,969:969}],978:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],979:[function(t,e,n){"use strict";e.exports=function(t,e,n){for(var r,i=null,o=0;o0?Math.max(e,i):0}}},{107:107}],981:[function(t,e,n){"use strict";var r=t(537),i=t(550),o=t(546),a=t(985);e.exports=function(t,e,n,s,l,u){var c=a.isBubble(t),h=(t.line||{}).color;u=u||{},h&&(n=h),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",n),i(t,"marker")&&o(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:c?r.background:r.defaultLine),i(t,"marker.line")&&o(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},{537:537,546:546,550:550,985:985}],982:[function(t,e,n){"use strict";function r(t,e,n){var r;e.selectAll("g.trace").each(function(t){var e=a.select(this);if((r=t[0].trace)._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),r._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,n.layerClipId)})}function i(t,e,n,r,i,f,p){function m(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function y(t){if(t.ids)return g}function x(){return!1}function b(e){var r,i,o,u=e[0].trace,h=a.select(this),f=c.hasMarkers(u),d=c.hasText(u),p=y(u),g=x,b=x;f&&(g=u.marker.maxdisplayed||u._needsCull?v:s.identity),d&&(b=u.marker.maxdisplayed||u._needsCull?v:s.identity);var _=(r=(i=h.selectAll("path.point")).data(g,p)).enter().append("path").classed("point",!0);M&&_.call(l.pointStyle,u,t).call(l.translatePoints,k,T).style("opacity",0).transition().style("opacity",1);var w=f&&l.tryColorscale(u.marker,""),A=f&&l.tryColorscale(u.marker,"line");r.order(),r.each(function(e){var r=a.select(this),i=m(r);(o=l.translatePoint(e,i,k,T))?(l.singlePointStyle(e,i,u,w,A,t),n.layerClipId&&l.hideOutsideRangePoint(e,i,k,T),u.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?r.exit().transition().style("opacity",0).remove():r.exit().remove(),(r=(i=h.selectAll("g")).data(b,p)).enter().append("g").classed("textpoint",!0).append("text"),r.order(),r.each(function(t){var e=a.select(this),r=m(e.select("text"));(o=l.translatePoint(t,r,k,T))?n.layerClipId&&l.hideOutsideRangePoint(t,e,k,T):e.remove()}),r.selectAll("text").call(l.textPointStyle,u,t).each(function(t){var e=k.c2p(t.x),n=T.c2p(t.y);a.select(this).selectAll("tspan.line").each(function(){m(a.select(this)).attr({x:e,y:n})})}),r.exit().remove()}var _,w;o(t,e,n,r,i);var M=!!p&&p.duration>0,k=n.xaxis,T=n.yaxis,A=r[0].trace,S=A.line,E=a.select(f);if(E.call(u.plot,n,p),!0===A.visible){m(E).style("opacity",A.opacity);var C,L,P=A.fill.charAt(A.fill.length-1);"x"!==P&&"y"!==P&&(P=""),r[0].node3=E;var I="",O=[],D=A._prevtrace;D&&(I=D._prevRevpath||"",L=D._nextFill,O=D._polygons);var z,j,N,R,F,B,U,V,H,q="",W="",G=[],Y=s.noop;if(C=A._ownFill,c.hasLines(A)||"none"!==A.fill){for(L&&L.datum(r),-1!==["hv","vh","hvh","vhv"].indexOf(S.shape)?(N=l.steps(S.shape),R=l.steps(S.shape.split("").reverse().join(""))):N=R="spline"===S.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return R(t.reverse())},G=h(r,{xaxis:k,yaxis:T,connectGaps:A.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,shape:S.shape,simplify:S.simplify}),H=A._polygons=new Array(G.length),w=0;w1){var n=a.select(this);if(n.datum(r),t)m(n.style("opacity",0).attr("d",z).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(n);i.attr("d",z),l.singleLineStyle(r,i)}}}}}var X=E.selectAll(".js-line").data(G);m(X.exit()).style("opacity",0).remove(),X.each(Y(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(X,n.layerClipId),G.length&&(C?B&&V&&(P?("y"===P?B[1]=V[1]=T.c2p(0,!0):"x"===P&&(B[0]=V[0]=k.c2p(0,!0)),m(C).attr("d","M"+V+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):m(C).attr("d",q+"Z").call(l.singleFillStyle)):"tonext"===A.fill.substr(0,6)&&q&&I&&("tonext"===A.fill?m(L).attr("d",q+"Z"+I+"Z").call(l.singleFillStyle):m(L).attr("d",q+"L"+I.substr(1)+"Z").call(l.singleFillStyle),A._polygons=A._polygons.concat(O)),A._prevRevpath=W,A._prevPolygons=H);var Z=E.selectAll(".points");_=Z.data([r]),Z.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;l.setClipUrl(a.select(this),e?null:n.layerClipId)})}}function o(t,e,n,r,i){var o=n.xaxis,l=n.yaxis,u=a.extent(s.simpleMap(o.range,o.r2c)),h=a.extent(s.simpleMap(l.range,l.r2c)),f=r[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=r.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),v=0;i.forEach(function(t,n){var r=t[0].trace;c.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;for((c=d.selectAll("g.trace").data(n,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),f(t,e,n),r(0,d,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),m?(s&&(h=s()),a.transition().duration(o.duration).ease(o.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){d.selectAll("g.trace").each(function(r,a){i(t,a,e,r,n,this,o)})})):d.selectAll("g.trace").each(function(r,a){i(t,a,e,r,n,this,o)}),p&&c.exit().remove(),d.selectAll("path:not([d])").remove()}},{561:561,567:567,661:661,672:672,977:977,979:979,98:98,985:985}],983:[function(t,e,n){"use strict";var r=t(985),i=t(639).DESELECTDIM;e.exports=function(t,e){var n,o,a,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,d=f.marker,p=!r.hasMarkers(f)&&!r.hasText(f);if(!0!==f.visible||p)return[];var m=Array.isArray(d.opacity)?1:d.opacity;if(!1===e)for(n=0;n=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return w[t]}function u(t,e,n,r,i){var o=null;if(Array.isArray(t)){o=[];for(var a=0;a=0){var v=i(l.position,l.delaunayColor,l.delaunayAxis);v.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(v):(v.gl=a,this.delaunayMesh=m(v),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=function(t,e){var n=new r(t,e.uid);return n.update(e),n}},{160:160,171:171,195:195,241:241,637:637,638:638,657:657,661:661,682:682,980:980,99:99,990:990}],992:[function(t,e,n){"use strict";function r(t,e,n,r){var o=0,a=n("x"),s=n("y"),l=n("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],r),a&&s&&l&&((o=Math.min(a.length,s.length,l.length))=0&&f("surfacecolor",d||p);for(var m=["x","y","z"],v=0;v<3;++v){var g="projection."+m[v];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}c(t,e,n,{axis:"z"}),c(t,e,n,{axis:"y",inherit:"z"}),c(t,e,n,{axis:"x",inherit:"z"})}else e.visible=!1}},{566:566,661:661,779:779,976:976,981:981,985:985,986:986,988:988}],993:[function(t,e,n){"use strict";var r={};r.plot=t(991),r.attributes=t(988),r.markerSymbols=t(638),r.supplyDefaults=t(992),r.colorbar=t(967),r.calc=t(989),r.moduleType="trace",r.name="scatter3d",r.basePlotModule=t(744),r.categories=["gl3d","symbols","markerColorscale","showLegend"],r.meta={hrName:"scatter_3d",description:["The data visualized as scatter point or lines in 3D dimension","is set in `x`, `y`, `z`.","Text (appearing either on the chart or on hover only) is via `text`.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","Projections are achieved via `projection`.","Surface fills are achieved via `surfaceaxis`."].join(" ")},e.exports=r},{638:638,744:744,967:967,988:988,989:989,991:991,992:992}],994:[function(t,e,n){"use strict";var r=t(964),i=t(703),o=t(544),a=t(538),s=t(650).extendFlat,l=r.marker,u=r.line,c=l.line;e.exports={carpet:{valType:"string",role:"info",editType:"calc",description:["An identifier for this carpet, so that `scattercarpet` and","`scattercontour` traces can specify a carpet plot on which","they lie"].join(" ")},a:{valType:"data_array",editType:"calc",description:["Sets the quantity of component `a` in each data point.","If `a`, `b`, and `c` are all provided, they need not be","normalized, only the relative values matter. If only two","arrays are provided they must be normalized to match","`ternary.sum`."].join(" ")},b:{valType:"data_array",editType:"calc",description:["Sets the quantity of component `a` in each data point.","If `a`, `b`, and `c` are all provided, they need not be","normalized, only the relative values matter. If only two","arrays are provided they must be normalized to match","`ternary.sum`."].join(" ")},mode:s({},r.mode,{dflt:"markers"}),text:s({},r.text,{description:["Sets text elements associated with each (a,b,c) point.","If a single string, the same string appears over","all the data points.","If an array of strings, the items are mapped in order to the","the data points in (a,b,c)."].join(" ")}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:r.connectgaps,fill:s({},r.fill,{values:["none","toself","tonext"],description:["Sets the area to fill with a solid color.","Use with `fillcolor` if not *none*.","scatterternary has a subset of the options available to scatter.","*toself* connects the endpoints of the trace (or each segment","of the trace if it has gaps) into a closed shape.","*tonext* fills the space between two traces if one completely","encloses the other (eg consecutive contour lines), and behaves like","*toself* if there is no trace before it. *tonext* should not be","used if one trace does not enclose the other."].join(" ")}),fillcolor:r.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:c.width,editType:"calc"},o("marker".line)),gradient:l.gradient,editType:"calc"},o("marker"),{showscale:l.showscale,colorbar:a}),textfont:r.textfont,textposition:r.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:r.hoveron}},{538:538,544:544,650:650,703:703,964:964}],995:[function(t,e,n){"use strict";var r=t(107),i=t(705),o=t(985),a=t(968),s=t(963),l=t(836);e.exports=function(t,e){var n=e.carpetTrace=l(t,e);if(n&&n.visible&&"legendonly"!==n.visible){var u;e.xaxis=n.xaxis,e.yaxis=n.yaxis;var c,h,f=e.a.length,d=new Array(f),p=!1;for(u=0;uf&&y.splice(f,y.length-f)}return a(e),s(d,e),d}}},{107:107,705:705,836:836,963:963,968:968,985:985}],996:[function(t,e,n){"use strict";var r=t(661),i=t(969),o=t(985),a=t(981),s=t(976),l=t(978),u=t(986),c=t(972),h=t(994);e.exports=function(t,e,n,f){function d(n,i){return r.coerce(t,e,h,n,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),v=d("b");if(p=Math.min(m.length,v.length)){m&&p0?t.labelprefix.replace(/ = $/,""):t._hovertitle,v.push(n+": "+e.toFixed(3)+t.labelsuffix)}var a=r(t,e,n,i);if(a&&!1!==a[0].index){var s=a[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,h=u-c;return s.x0=Math.max(Math.min(s.x0,h),c),s.x1=Math.max(Math.min(s.x1,h),c),a}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(f.hi||d.hoverinfo).split("+"),v=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&o(p.aaxis,f.a),-1!==m.indexOf("b")&&o(p.baxis,f.b);var g=p.ab2ij([f.a,f.b]),y=Math.floor(g[0]),x=g[0]-y,b=Math.floor(g[1]),_=g[1]-b,w=p.evalxy([],y,b,x,_);return v.push("y: "+w[1].toFixed(3)),s.extraText=v.join("
"),a}}},{974:974}],998:[function(t,e,n){"use strict";var r={};r.attributes=t(994),r.supplyDefaults=t(996),r.colorbar=t(967),r.calc=t(995),r.plot=t(999),r.style=t(1001),r.hoverPoints=t(997),r.selectPoints=t(1e3),r.moduleType="trace",r.name="scattercarpet",r.basePlotModule=t(715),r.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],r.meta={hrName:"scatter_carpet",description:["Plots a scatter trace on either the first carpet axis or the","carpet axis with a matching `carpet` attribute."].join(" ")},e.exports=r},{1000:1e3,1001:1001,715:715,967:967,994:994,995:995,996:996,997:997,999:999}],999:[function(t,e,n){"use strict";var r=t(982),i=t(705),o=t(561);e.exports=function(t,e,n){var a,s,l,u=n[0][0].carpet,c={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(r(t,c,n),a=0;a")}var i=t(578),o=t(705),a=t(640).BADNUM,s=t(973),l=t(971),u=t(1002);e.exports=function(t,e,n){var o=t.cd,l=o[0].trace,u=t.xa,c=t.ya,h=t.subplot,f=h.projection.isLonLatOverEdges,d=h.project;if(i.getClosest(o,function(t){var r=t.lonlat;if(r[0]===a)return 1/0;if(f(r))return 1/0;var i=d(r),o=d([e,n]),s=Math.abs(i[0]-o[0]),l=Math.abs(i[1]-o[1]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-u,1-3/u)},t),!1!==t.index){var p=o[t.index],m=p.lonlat,v=[u.c2p(m),c.c2p(m)],g=p.mrc||1;return t.x0=v[0]-g,t.x1=v[0]+g,t.y0=v[1]-g,t.y1=v[1]+g,t.loc=p.loc,t.lon=m[0],t.lat=m[1],t.color=s(l,p),t.extraText=r(l,p,h.mockAxis),[t]}}},{1002:1002,578:578,640:640,705:705,971:971,973:973}],1007:[function(t,e,n){"use strict";var r={};r.attributes=t(1002),r.supplyDefaults=t(1004),r.colorbar=t(967),r.calc=t(1003),r.plot=t(1008),r.hoverPoints=t(1006),r.eventData=t(1005),r.selectPoints=t(1009),r.moduleType="trace",r.name="scattergeo",r.basePlotModule=t(733),r.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],r.meta={hrName:"scatter_geo",description:["The data visualized as scatter point or lines on a geographic map","is provided either by longitude/latitude pairs in `lon` and `lat`","respectively or by geographic location IDs or names in `locations`."].join(" ")},e.exports=r},{1002:1002,1003:1003,1004:1004,1005:1005,1006:1006,1008:1008,1009:1009,733:733,967:967}],1008:[function(t,e,n){"use strict";function r(t,e){var n=t[0].trace;if(Array.isArray(n.locations))for(var r=c(n,e),i=n.locationmode,o=0;o=e.length?i:e[o]);return r}function a(t,e,n){return l(D(t,n),O(e,n),n)}function s(t,e,n,r){var i=M(t,e,r);return i=Array.isArray(i[0])?i:o(g.identity,[i],r),l(i,O(n,r),r)}function l(t,e,n){for(var r=new Array(4*n),i=0;iZ?X-Z:0),!q||H.noBorder||H.noFill?c(this.scatter.options.colors,G,f,B,W):c(this.scatter.options.colors,P,f,0),c(this.scatter.options.borderColors,Y,f,B,W);F?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=k):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,h,R)},I.updateLines=function(t,e){var n;if(this.hasLines){var r=e;if(!t.connectgaps){var i=0,o=this.xData,s=this.yData;for(r=new Float64Array(2*o.length),n=0;n")}var i=t(578),o=t(973),a=t(971),s=t(640).BADNUM;e.exports=function(t,e,n){var a=t.cd,l=a[0].trace,u=t.xa,c=t.ya,h=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),f=e-h;if(i.getClosest(a,function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var r=Math.abs(u.c2p(e)-u.c2p([f,e[1]])),i=Math.abs(c.c2p(e)-c.c2p([e[0],n])),o=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(r*r+i*i)-o,1-3/o)},t),!1!==t.index){var d=a[t.index],p=d.lonlat,m=[p[0]+h,p[1]],v=u.c2p(m),g=c.c2p(m),y=d.mrc||1;return t.x0=v-y,t.x1=v+y,t.y0=g-y,t.y1=g+y,t.color=o(l,d),t.extraText=r(l,d),[t]}}},{578:578,640:640,971:971,973:973}],1021:[function(t,e,n){"use strict";var r={};r.attributes=t(1016),r.supplyDefaults=t(1018),r.colorbar=t(967),r.calc=t(1003),r.plot=t(1022),r.hoverPoints=t(1020),r.eventData=t(1019),r.selectPoints=t(1023),r.moduleType="trace",r.name="scattermapbox",r.basePlotModule=t(758),r.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],r.meta={hrName:"scatter_mapbox",description:["The data visualized as scatter point, lines or marker symbols","on a Mapbox GL geographic map","is provided by longitude/latitude pairs in `lon` and `lat`."].join(" ")},e.exports=r},{1003:1003,1016:1016,1018:1018,1019:1019,1020:1020,1022:1022,1023:1023,758:758,967:967}],1022:[function(t,e,n){"use strict";function r(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var o=t(1017),a=r.prototype;a.update=function(t){var e=this.mapbox,n=o(t);e.setOptions(this.idLayerFill,"setLayoutProperty",n.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",n.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",n.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",n.symbol.layout),i(n.fill)&&(e.setSourceData(this.idSourceFill,n.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",n.fill.paint)),i(n.line)&&(e.setSourceData(this.idSourceLine,n.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",n.line.paint)),i(n.circle)&&(e.setSourceData(this.idSourceCircle,n.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",n.circle.paint)),i(n.symbol)&&(e.setSourceData(this.idSourceSymbol,n.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",n.symbol.paint)),t[0].trace._glTrace=this},a.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var n=new r(t,e[0].trace.uid);return n.update(e),n}},{1017:1017}],1023:[function(t,e,n){"use strict";var r=t(985);e.exports=function(t,e){var n,i,o,a,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace;if(f._hasDimmedPts=!1,!0!==f.visible||!r.hasMarkers(f))return[];if(!1===e)for(s=0;s.sum`."].join(" ")},b:{valType:"data_array",editType:"calc",description:["Sets the quantity of component `a` in each data point.","If `a`, `b`, and `c` are all provided, they need not be","normalized, only the relative values matter. If only two","arrays are provided they must be normalized to match","`ternary.sum`."].join(" ")},c:{valType:"data_array",editType:"calc",description:["Sets the quantity of component `a` in each data point.","If `a`, `b`, and `c` are all provided, they need not be","normalized, only the relative values matter. If only two","arrays are provided they must be normalized to match","`ternary.sum`."].join(" ")},sum:{valType:"number",role:"info",dflt:0,min:0,editType:"calc",description:["The number each triplet should sum to,","if only two of `a`, `b`, and `c` are provided.","This overrides `ternary.sum` to normalize this specific","trace, but does not affect the values displayed on the axes.","0 (or missing) means to use ternary.sum"].join(" ")},mode:l({},r.mode,{dflt:"markers"}),text:l({},r.text,{description:["Sets text elements associated with each (a,b,c) point.","If a single string, the same string appears over","all the data points.","If an array of strings, the items are mapped in order to the","the data points in (a,b,c).","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")}),hovertext:l({},r.hovertext,{description:["Sets hover text elements associated with each (a,b,c) point.","If a single string, the same string appears over","all the data points.","If an array of strings, the items are mapped in order to the","the data points in (a,b,c).","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")}),line:{color:c.color,width:c.width,dash:s,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:r.connectgaps,cliponaxis:r.cliponaxis,fill:l({},r.fill,{values:["none","toself","tonext"],description:["Sets the area to fill with a solid color.","Use with `fillcolor` if not *none*.","scatterternary has a subset of the options available to scatter.","*toself* connects the endpoints of the trace (or each segment","of the trace if it has gaps) into a closed shape.","*tonext* fills the space between two traces if one completely","encloses the other (eg consecutive contour lines), and behaves like","*toself* if there is no trace before it. *tonext* should not be","used if one trace does not enclose the other."].join(" ")}),fillcolor:r.fillcolor,marker:l({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({width:h.width,editType:"calc"},o("marker.line")),gradient:u.gradient,editType:"calc"},o("marker"),{showscale:u.showscale,colorbar:a}),textfont:r.textfont,textposition:r.textposition,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:r.hoveron}},{538:538,544:544,560:560,650:650,703:703,964:964}],1025:[function(t,e,n){"use strict";var r=t(107),i=t(705),o=t(985),a=t(968),s=t(963),l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var n,c,h,f,d,p,m=t._fullLayout[e.subplot].sum,v=e.sum||m;for(n=0;nM&&A.splice(M,A.length-M)}return a(e),s(k,e),k}},{107:107,705:705,963:963,968:968,985:985}],1026:[function(t,e,n){"use strict";var r=t(661),i=t(969),o=t(985),a=t(981),s=t(976),l=t(978),u=t(986),c=t(972),h=t(1024);e.exports=function(t,e,n,f){function d(n,i){return r.coerce(t,e,h,n,i)}var p,m=d("a"),v=d("b"),g=d("c");if(m?(p=m.length,v?(p=Math.min(p,v.length),g&&(p=Math.min(p,g.length))):p=g?Math.min(p,g.length):0):v&&g&&(p=Math.min(v.length,g.length)),p){m&&p"),s}}},{705:705,974:974}],1028:[function(t,e,n){"use strict";var r={};r.attributes=t(1024),r.supplyDefaults=t(1026),r.colorbar=t(967),r.calc=t(1025),r.plot=t(1029),r.style=t(1031),r.hoverPoints=t(1027),r.selectPoints=t(1030),r.moduleType="trace",r.name="scatterternary",r.basePlotModule=t(772),r.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],r.meta={hrName:"scatter_ternary",description:["Provides similar functionality to the *scatter* type but on a ternary phase diagram.","The data is provided by at least two arrays out of `a`, `b`, `c` triplets."].join(" ")},e.exports=r},{1024:1024,1025:1025,1026:1026,1027:1027,1029:1029,1030:1030,1031:1031,772:772,967:967}],1029:[function(t,e,n){"use strict";var r=t(982);e.exports=function(t,e){var n=t.plotContainer;n.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:n,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},o=0;o",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1042:[function(t,e,n){"use strict";function r(t){return t.calcdata.columns.reduce(function(e,n){return n.xIndex=e||u===t.length-1)&&(r[i]=a,a.key=l++,a.firstRowIndex=s,a.lastRowIndex=u,a={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=o,s=u+1,o=0);return r}var a=t(1041),s=t(650).extendFlat;e.exports=function(t,e){var n=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),l=e.domain,u=Math.floor(t._fullLayout._size.w*(l.x[1]-l.x[0])),c=Math.floor(t._fullLayout._size.h*(l.y[1]-l.y[0])),h=n[0].map(function(){return e.header.height}),f=e.cells.values[0].map(function(){return e.cells.height}),d=h.reduce(function(t,e){return t+e},0),p=o(f,c-d+a.uplift),m=i(o(h,d),[]),v=i(p,m),g={},y=e._fullInput.columnorder,x=n.map(function(t,n){return Array.isArray(e.columnwidth)?e.columnwidth[Math.min(n,e.columnwidth.length-1)]:isFinite(e.columnwidth)&&null!==e.columnwidth?e.columnwidth:1}),b=x.reduce(function(t,e){return t+e},0);x=x.map(function(t){return t/b*u});var _={key:e.index,translateX:l.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-l.y[1]),size:t._fullLayout._size,width:u,height:c,columnOrder:y,groupHeight:c,rowBlocks:v,headerRowBlocks:m,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:n}),gdColumns:n.map(function(t){return t[0]}),gdColumnsOriginalOrder:n.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:n.map(function(t,e){var n=g[t];return g[t]=(n||0)+1,{key:t+"__"+g[t],label:t,specIndex:e,xIndex:y[e],xScale:r,x:void 0,calcdata:void 0,columnWidth:x[e]}})};return _.columns.forEach(function(t){t.calcdata=_,t.x=r(t)}),_}},{1041:1041,650:650}],1043:[function(t,e,n){"use strict";function r(t){var e=t.rowBlocks[t.page],n=e?e.rows[0].rowIndex:0;return[n,e?n+e.rows.length:0]}var i=t(650).extendFlat;n.splitToPanels=function(t){var e=[0,0],n=i({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:i({},t.calcdata,{cells:t.calcdata.headerCells})});return[i({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),i({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n]},n.splitToCells=function(t){var e=r(t);return t.values.slice(e[0],e[1]).map(function(n,r){return{keyWithinBlock:r+("string"==typeof n&&n.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+r,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:n}})}},{650:650}],1044:[function(t,e,n){"use strict";function r(t,e){for(var n=t.columnorder||[],r=t.header.values.length,i=n.slice(0,r),o=i.slice().sort(function(t,e){return t-e}),a=i.map(function(t){return o.indexOf(t)}),s=a.length;s/i),a=!i||o;t.mayHaveMarkup=i&&r.match(/[<&>]/);var s=g(r);t.latex=s;var l,u=s?"":b(t.calcdata.cells.prefix,e,n)||"",c=s?"":b(t.calcdata.cells.suffix,e,n)||"",h=s?null:b(t.calcdata.cells.format,e,n)||null,f=u+(h?F.format(h)(t.value):t.value)+c;t.wrappingNeeded=!t.wrapped&&!a&&!s&&(l=y(f)),t.cellHeightMayIncrease=o||s||t.mayHaveMarkup||(void 0===l?y(f):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var d;if(t.wrappingNeeded){var p=(" "===R.wrapSplitCharacter?f.replace(/i&&r.push(o),i+=l}return r}function A(t,e,n){var r=o(e)[0],i=r.rowBlocks,s=r.calcdata,l=O(i,i.length),u=r.calcdata.groupHeight-k(r),c=s.scrollY=Math.max(0,Math.min(l-u,s.scrollY)),h=T(i,c,u);1===h.length&&(h[0]===i.length-1?h.unshift(h[0]-1):h.push(h[0]+1)),h[0]%2&&h.reverse(),e.each(function(t,e){t.page=h[e],t.scrollY=c}),e.attr("transform",function(t){return"translate(0 "+(O(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(E(t,n,e,h,r.prevPages,r,0),E(t,n,e,h,r.prevPages,r,1),a(n,t))}function S(t,e,n,r){return function(i){var o=i.calcdata?i.calcdata:i,a=e.filter(function(t){return o.key===t.key}),s=n||o.scrollbarState.dragMultiplier;o.scrollY=void 0===r?o.scrollY+s*F.event.dy:r;var l=a.selectAll("."+R.cn.yColumn).selectAll("."+R.cn.columnBlock).filter(w);A(t,l,a)}}function E(t,e,n,r,i,o,a){r[a]!==i[a]&&(clearTimeout(o.currentRepaint[a]),o.currentRepaint[a]=setTimeout(function(){var o=n.filter(function(t,e){return e===a&&r[e]!==i[e]});s(t,e,o,n),i[a]=r[a]}))}function C(t,e,n){return function(){var r=F.select(e.parentNode);r.each(function(t){var e=t.fragments;r.selectAll("tspan.line").each(function(t,n){e[n].width=this.getComputedTextLength()});var n,i,o=e[e.length-1].width,a=e.slice(0,-1),s=[],l=0,u=t.column.columnWidth-2*R.cellPad;for(t.value="";a.length;)l+(i=(n=a.shift()).width+o)>u&&(t.value+=s.join(R.wrapSpacer)+R.lineBreaker,s=[],l=0),s.push(n.text),l+=i;l&&(t.value+=s.join(R.wrapSpacer)),t.wrapped=!0}),r.selectAll("tspan.line").remove(),v(r.select("."+R.cn.cellText),n,t),F.select(e.parentNode.parentNode).call(I)}}function L(t,e,n,r,i){return function(){if(!i.settledY){var o=F.select(e.parentNode),s=j(i),l=i.key-s.firstRowIndex,u=s.rows[l].rowHeight,c=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*R.cellPad:u,h=Math.max(c,u);h-s.rows[l].rowHeight&&(s.rows[l].rowHeight=h,t.selectAll("."+R.cn.columnCell).call(I),A(null,t.filter(w),0),a(n,r,!0)),o.attr("transform",function(){var t=this,e=t.parentNode.getBoundingClientRect(),n=F.select(t.parentNode).select("."+R.cn.cellRect).node().getBoundingClientRect(),r=t.transform.baseVal.consolidate(),o=n.top-e.top+(r?r.matrix.f:R.cellPad);return"translate("+P(i,F.select(t.parentNode).select("."+R.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+o+")"}),i.settledY=!0}}}function P(t,e){switch(t.align){case"left":return R.cellPad;case"right":return t.column.columnWidth-(e||0)-R.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return R.cellPad}}function I(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+D(e,1/0)},0);return"translate(0 "+(D(j(t),t.key)+e)+")"}).selectAll("."+R.cn.cellRect).attr("height",function(t){return N(j(t),t.key).rowHeight})}function O(t,e){for(var n=0,r=e-1;r>=0;r--)n+=z(t[r]);return n}function D(t,e){for(var n=0,r=0;ro&&(o=u,a=l)}}return o?i(a):h};case"rms":return function(t,e){for(var n=0,o=0,a=0;a":return function(t){return f(t)>i};case">=":return function(t){return f(t)>=i};case"[]":return function(t){var e=f(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=f(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=f(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=f(t);return ei[1]};case"](":return function(t){var e=f(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=f(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(f(t))};case"}{":return function(t){return-1===i.indexOf(f(t))}}}var i=t(661),o=t(779),a=t(705),s=["=","!=","<",">=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],u=["{}","}{"];n.moduleType="transform",n.name="filter",n.attributes={enabled:{valType:"boolean",dflt:!0,role:"info",editType:"calc",description:["Determines whether this filter transform is enabled or disabled."].join(" ")},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",role:"info",editType:"calc",description:["Sets the filter target by which the filter is applied.","If a string, `target` is assumed to be a reference to a data array","in the parent trace object.","To filter about nested variables, use *.* to access them.","For example, set `target` to *marker.color* to filter","about the marker color array.","If an array, `target` is then the data array by which the filter is applied."].join(" ")},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(u),dflt:"=",role:"info",editType:"calc",description:["Sets the filter operation.","*=* keeps items equal to `value`","*!=* keeps items not equal to `value`","*<* keeps items less than `value`","*<=* keeps items less than or equal to `value`","*>* keeps items greater than `value`","*>=* keeps items greater than or equal to `value`","*[]* keeps items inside `value[0]` to value[1]` including both bounds`","*()* keeps items inside `value[0]` to value[1]` excluding both bounds`","*[)* keeps items inside `value[0]` to value[1]` including `value[0]` but excluding `value[1]","*(]* keeps items inside `value[0]` to value[1]` excluding `value[0]` but including `value[1]","*][* keeps items outside `value[0]` to value[1]` and equal to both bounds`","*)(* keeps items outside `value[0]` to value[1]`","*](* keeps items outside `value[0]` to value[1]` and equal to `value[0]`","*)[* keeps items outside `value[0]` to value[1]` and equal to `value[1]`","*{}* keeps items present in a set of values","*}{* keeps items not present in a set of values"].join(" ")},value:{valType:"any",dflt:0,role:"info",editType:"calc",description:["Sets the value or values by which to filter.","Values are expected to be in the same type as the data linked","to `target`.","When `operation` is set to one of","the comparison values ("+s+")","`value` is expected to be a number or a string.","When `operation` is set to one of the interval values","("+l+")","`value` is expected to be 2-item array where the first item","is the lower bound and the second item is the upper bound.","When `operation`, is set to one of the set values","("+u+")","`value` is expected to be an array with as many items as","the desired set elements."].join(" ")},preservegaps:{valType:"boolean",dflt:!1,role:"info",editType:"calc",description:["Determines whether or not gaps in data arrays produced by the filter operation","are preserved.","Setting this to *true* might be useful when plotting a line chart","with `connectgaps` set to *false*."].join(" ")},editType:"calc"},n.supplyDefaults=function(t){function e(e,o){return i.coerce(t,r,n.attributes,e,o)}var r={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var a=o.getComponentMethod("calendars","handleDefaults");a(t,r,"valuecalendar",null),a(t,r,"targetcalendar",null)}return r},n.calcTransform=function(t,e,n){function o(t,n){for(var r=0;r1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=s.styles=[];if(l)for(a=0;a0&&e[r]===n[0]))return 1;i=t[r-1]}for(var o=1;i;){var a=i.key,s=c(n,a[0],a[1]);if(a[0][0]0))return 0;o=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;o=1,i=i.right}}return o}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(n){return t(n[0],n[1])?0:e(n)}}e.exports=function(t){for(var e=t.length,n=[],r=[],i=0;i=l?(b=1,y=l+2*h+d):y=h*(b=-h/l)+d):(b=0,f>=0?(_=0,y=d):-f>=c?(_=1,y=c+2*f+d):y=f*(_=-f/c)+d);else if(_<0)_=0,h>=0?(b=0,y=d):-h>=l?(b=1,y=l+2*h+d):y=h*(b=-h/l)+d;else{var w=1/x;y=(b*=w)*(l*b+u*(_*=w)+2*h)+_*(u*b+c*_+2*f)+d}else{var M,k,T,A;b<0?(k=c+f)>(M=u+h)?(T=k-M)>=(A=l-2*u+c)?(b=1,_=0,y=l+2*h+d):y=(b=T/A)*(l*b+u*(_=1-b)+2*h)+_*(u*b+c*_+2*f)+d:(b=0,k<=0?(_=1,y=c+2*f+d):f>=0?(_=0,y=d):y=f*(_=-f/c)+d):_<0?(k=l+h)>(M=u+f)?(T=k-M)>=(A=l-2*u+c)?(_=1,b=0,y=c+2*f+d):y=(b=1-(_=T/A))*(l*b+u*_+2*h)+_*(u*b+c*_+2*f)+d:(_=0,k<=0?(b=1,y=l+2*h+d):h>=0?(b=0,y=d):y=h*(b=-h/l)+d):(T=c+f-u-h)<=0?(b=0,_=1,y=c+2*f+d):T>=(A=l-2*u+c)?(b=1,_=0,y=l+2*h+d):y=(b=T/A)*(l*b+u*(_=1-b)+2*h)+_*(u*b+c*_+2*f)+d}for(var S=1-b-_,p=0;p1)for(var n=1;n1&&(r=n[0]+"@",t=n[1]),r+o((t=t.replace(L,".")).split("."),e).join(".")}function s(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=D((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=D(t)}).join("")}function u(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:b}function c(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function h(t,e,n){var r=0;for(t=n?O(t/k):t>>1,t+=O(t/e);t>I*w>>1;r+=b)t=O(t/I);return O(r+(I+1)*t/(t+M))}function f(t){var e,n,r,o,a,s,c,f,d,p,m=[],v=t.length,g=0,y=A,M=T;for((n=t.lastIndexOf(S))<0&&(n=0),r=0;r=128&&i("not-basic"),m.push(t.charCodeAt(r));for(o=n>0?n+1:0;o=v&&i("invalid-input"),((f=u(t.charCodeAt(o++)))>=b||f>O((x-g)/s))&&i("overflow"),g+=f*s,d=c<=M?_:c>=M+w?w:c-M,!(fO(x/(p=b-d))&&i("overflow"),s*=p;M=h(g-a,e=m.length+1,0==a),O(g/e)>x-y&&i("overflow"),y+=O(g/e),g%=e,m.splice(g++,0,y)}return l(m)}function d(t){var e,n,r,o,a,l,u,f,d,p,m,v,g,y,M,k=[];for(v=(t=s(t)).length,e=A,n=0,a=T,l=0;l=e&&mO((x-n)/(g=r+1))&&i("overflow"),n+=(u-e)*g,e=u,l=0;lx&&i("overflow"),m==e){for(f=n,d=b;p=d<=a?_:d>=a+w?w:d-a,!(f= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=b-_,O=Math.floor,D=String.fromCharCode;if(g={version:"1.4.1",ucs2:{decode:s,encode:l},decode:f,encode:d,toASCII:function(t){return a(t,function(t){return C.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return a(t,function(t){return E.test(t)?f(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return g});else if(p&&m)if(e.exports==p)m.exports=g;else for(y in g)g.hasOwnProperty(y)&&(p[y]=g[y]);else r.punycode=g}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],1062:[function(t,e,n){e.exports=t(221)},{221:221}],1063:[function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,n,o){e=e||"&",n=n||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var c=0;c=0?(h=m.substr(0,v),f=m.substr(v+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),r(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],1064:[function(t,e,n){"use strict";function r(t,e){if(t.map)return t.map(e);for(var n=[],r=0;rn;){if(a-n>600){var l=a-n+1,u=e-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);r(t,e,Math.max(n,Math.floor(e-u*h/l+f)),Math.min(a,Math.floor(e+(l-u)*h/l+f)),s)}var d=t[e],p=n,m=a;for(i(t,n,e),s(t[a],d)>0&&i(t,n,a);p0;)m--}0===s(t[n],d)?i(t,n,m):i(t,++m,a),m<=e&&(n=m+1),e<=m&&(a=m-1)}}function i(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function o(t,e){return te?1:0}e.exports=r},{}],1067:[function(t,e,n){"use strict";var r=t(23);e.exports=function(t,e){for(var n=t.length,i=new Array(n),o=0;o=r&&(t=r,c=!0),u||c||l&&0!==i&&(t=Math.round(t/i)*i),t}},{key:"handleChange",value:function(t){this.setState({value:t.target.value})}},{key:"handleFocus",value:function(t){document.addEventListener("keydown",this.handleKeyDown)}},{key:"handleBlur",value:function(t){var e=this;document.removeEventListener("keydown",this.handleKeyDown),window.getSelection().removeAllRanges();var n=this.applyConstraints(t.target.value);this.setState({value:n},function(){e.update()})}},{key:"handleKeyDown",value:function(t){var e=this;if(13===(t.keyCode||t.which)){var n=this.applyConstraints(this.state.value);this.setState({value:n},function(){e.update()})}}},{key:"handleSliderUpdate",value:function(t,e){var n=this;t=this.applyConstraints(t),this.setState({value:t},function(){e&&!n.props.liveUpdate||n.update()})}},{key:"update",value:function(){var t=this.state.value;this.props._onUpdateValue&&this.props._onUpdateValue(this.props.path,t),this.props.onUpdate&&this.props.onUpdate(t)}},{key:"renderSlider",value:function(t){return p.default.createElement(g,{value:this.state.value,min:this.props.min,max:this.props.max,width:t,onUpdate:this.handleSliderUpdate})}},{key:"render",value:function(){var t=this.props,e=t.min,n=t.max,r=t.path,i=t.label,o=t.labelWidth,a=(0,f.default)(i)?i:r,s=(0,h.default)(e)&&(0,h.default)(n),l=100-o,u=s?Math.round(l/3):l,c=l-u;return p.default.createElement("li",{className:"cr number"},p.default.createElement("label",null,p.default.createElement("span",{className:"label-text",style:{width:o+"%"}},a),s?this.renderSlider(c):null,p.default.createElement("input",{type:"text",inputMode:"numeric",value:this.state.value,style:{width:u+"%"},onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur})))}}]),e}();v.propTypes={min:d.PropTypes.number,max:d.PropTypes.number,step:d.PropTypes.number,data:d.PropTypes.object,path:d.PropTypes.string,label:d.PropTypes.string,labelWidth:d.PropTypes.number,liveUpdate:d.PropTypes.bool,onUpdate:d.PropTypes.func,_onUpdateValue:d.PropTypes.func};var g=function(t){function e(t,n){i(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t,n));return r.handleMouseDown=r.handleMouseDown.bind(r),r.handleMouseMove=r.handleMouseMove.bind(r),r.handleMouseUp=r.handleMouseUp.bind(r),r}return a(e,p.default.Component),l(e,[{key:"componentWillMount",value:function(){this.setState({value:s(this.props.value)})}},{key:"componentWillReceiveProps",value:function(t){this.setState({value:s(t.value)})}},{key:"handleMouseDown",value:function(t){this.update(t.pageX),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseMove",value:function(t){this.update(t.pageX),t.preventDefault()}},{key:"handleMouseUp",value:function(t){this.update(t.pageX,!1),window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"handleClick",value:function(t){t.preventDefault()}},{key:"update",value:function(t){var e=arguments.length<=1||void 0===arguments[1]||arguments[1],n=this.props,r=n.min,i=n.max,o=n.onUpdate,a=m.default.findDOMNode(this).getBoundingClientRect(),s=t-a.left,l=a.right-a.left,c=r+(0,u.default)(s/l,0,1)*(i-r);this.setState({value:c},function(){o(c,e)})}},{key:"render",value:function(){var t=this.props,e=t.min,n=t.max,r={width:t.width+"%",backgroundSize:(0,u.default)(100*(this.state.value-e)/(n-e),0,100)+"% 100%"};return p.default.createElement("span",{className:"slider",style:r,onClick:this.handleClick,onMouseDown:this.handleMouseDown})}}]),e}();g.propTypes={value:d.PropTypes.oneOfType([d.PropTypes.number,d.PropTypes.string]),min:d.PropTypes.number,max:d.PropTypes.number,width:d.PropTypes.number,onUpdate:d.PropTypes.func},n.default=v,e.exports=n.default},{1077:1077,1229:1229,295:295,297:297,298:298,300:300,62:62}],1076:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n8&&b<=11),M=32,k=String.fromCharCode(M),T={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},A=!1,S=null,E={eventTypes:T,extractEvents:function(t,e,n,r){return[l(t,e,n,r),h(t,e,n,r)]}};e.exports=E},{109:109,1096:1096,1097:1097,1161:1161,1165:1165}],1081:[function(t,e,n){"use strict";function r(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}var i={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},o=["Webkit","ms","Moz","O"];Object.keys(i).forEach(function(t){o.forEach(function(e){i[r(e,t)]=i[t]})});var a={isUnitlessNumber:i,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}}};e.exports=a},{}],1082:[function(t,e,n){"use strict";var r=t(1081),i=t(109),o=(t(1139),t(111),t(1178)),a=t(122),s=t(126),l=(t(130),s(function(t){return a(t)})),u=!1,c="cssFloat";if(i.canUseDOM){var h=document.createElement("div").style;try{h.font=""}catch(t){u=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var f={createMarkupForStyles:function(t,e){var n="";for(var r in t)if(t.hasOwnProperty(r)){var i=0===r.indexOf("--"),a=t[r];null!=a&&(n+=l(r)+":",n+=o(r,a,e,i)+";")}return n||null},setValueForStyles:function(t,e,n){var i=t.style;for(var a in e)if(e.hasOwnProperty(a)){var s=0===a.indexOf("--"),l=o(a,e[a],n,s);if("float"!==a&&"cssFloat"!==a||(a=c),s)i.setProperty(a,l);else if(l)i[a]=l;else{var h=u&&r.shorthandPropertyExpansions[a];if(h)for(var f in h)i[f]="";else i[a]=""}}}};e.exports=f},{1081:1081,109:109,111:111,1139:1139,1178:1178,122:122,126:126,130:130}],1083:[function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=t(1197),o=t(1101),a=(t(123),function(){function t(e){r(this,t),this._callbacks=null,this._contexts=null,this._arg=e}return t.prototype.enqueue=function(t,e){this._callbacks=this._callbacks||[],this._callbacks.push(t),this._contexts=this._contexts||[],this._contexts.push(e)},t.prototype.notifyAll=function(){var t=this._callbacks,e=this._contexts,n=this._arg;if(t&&e){t.length!==e.length&&i("24"),this._callbacks=null,this._contexts=null;for(var r=0;r8));var z=!1;M.canUseDOM&&(z=C("input")&&(!document.documentMode||document.documentMode>9));var j={eventTypes:P,_allowSimulatedPassThrough:!0,_isInputEventSupported:z,extractEvents:function(t,e,n,o){var a,s,l=e?k.getNodeFromInstance(e):window;if(i(l)?D?a=c:s=h:L(l)?z?a=x:(a=v,s=m):g(l)&&(a=y),a){var u=a(t,e,n);if(u)return r(u,n,o)}s&&s(t,l,e),"topBlur"===t&&b(e,l)}};e.exports=j},{109:109,1093:1093,1096:1096,1110:1110,1154:1154,1163:1163,1186:1186,1192:1192,1194:1194,1195:1195}],1085:[function(t,e,n){"use strict";function r(t,e){return Array.isArray(e)&&(e=e[1]),e?e.nextSibling:t.firstChild}function i(t,e,n){u.insertTreeBefore(t,e,n)}function o(t,e,n){Array.isArray(e)?s(t,e[0],e[1],n):p(t,e,n)}function a(t,e){if(Array.isArray(e)){var n=e[1];l(t,e=e[0],n),t.removeChild(n)}t.removeChild(e)}function s(t,e,n,r){for(var i=e;;){var o=i.nextSibling;if(p(t,i,r),i===n)break;i=o}}function l(t,e,n){for(;;){var r=e.nextSibling;if(r===n)break;t.removeChild(r)}}var u=t(1086),c=t(1090),h=(t(1110),t(1139),t(1177)),f=t(1199),d=t(1200),p=h(function(t,e,n){t.insertBefore(e,n)}),m=c.dangerouslyReplaceNodeWithMarkup,v={dangerouslyReplaceNodeWithMarkup:m,replaceDelimitedText:function(t,e,n){var r=t.parentNode,i=t.nextSibling;i===e?n&&p(r,document.createTextNode(n),i):n?(d(i,n),l(r,i,e)):l(r,t,e)},processUpdates:function(t,e){for(var n=0;n-1||a("96",t),!u.plugins[n]){e.extractEvents||a("97",t),u.plugins[n]=e;var r=e.eventTypes;for(var o in r)i(r[o],e,o)||a("98",o,t)}}}function i(t,e,n){u.eventNameDispatchConfigs.hasOwnProperty(n)&&a("99",n),u.eventNameDispatchConfigs[n]=t;var r=t.phasedRegistrationNames;if(r){for(var i in r)r.hasOwnProperty(i)&&o(r[i],e,n);return!0}return!!t.registrationName&&(o(t.registrationName,e,n),!0)}function o(t,e,n){u.registrationNameModules[t]&&a("100",t),u.registrationNameModules[t]=e,u.registrationNameDependencies[t]=e.eventTypes[n].dependencies}var a=t(1197),s=(t(123),null),l={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(t){s&&a("101"),s=Array.prototype.slice.call(t),r()},injectEventPluginsByName:function(t){var e=!1;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];l.hasOwnProperty(n)&&l[n]===i||(l[n]&&a("102",n),l[n]=i,e=!0)}e&&r()},getPluginModuleForEvent:function(t){var e=t.dispatchConfig;if(e.registrationName)return u.registrationNameModules[e.registrationName]||null;if(void 0!==e.phasedRegistrationNames){var n=e.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var i=u.registrationNameModules[n[r]];if(i)return i}}return null},_resetEventPlugins:function(){s=null;for(var t in l)l.hasOwnProperty(t)&&delete l[t];u.plugins.length=0;var e=u.eventNameDispatchConfigs;for(var n in e)e.hasOwnProperty(n)&&delete e[n];var r=u.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};e.exports=u},{1197:1197,123:123}],1095:[function(t,e,n){"use strict";function r(t,e,n,r){var i=t.type||"unknown-event";t.currentTarget=u.getNodeFromInstance(r),e?l.invokeGuardedCallbackWithCatch(i,n,t):l.invokeGuardedCallback(i,n,t),t.currentTarget=null}function i(t){var e=t._dispatchListeners,n=t._dispatchInstances;if(Array.isArray(e)){for(var r=0;r1?1-e:void 0;return this._fallbackText=i.slice(t,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},{1101:1101,1190:1190,470:470}],1098:[function(t,e,n){"use strict";var r=t(1088),i=r.injection.MUST_USE_PROPERTY,o=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,l=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,u={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:o,allowTransparency:0,alt:0,as:0,async:o,autoComplete:0,autoPlay:o,capture:o,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:i|o,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:o,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:o,defer:o,dir:0,disabled:o,download:l,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:o,formTarget:0,frameBorder:0,headers:0,height:0,hidden:o,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:o,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:i|o,muted:i|o,name:0,nonce:0,noValidate:o,open:o,optimum:0,pattern:0,placeholder:0,playsInline:o,poster:0,preload:0,profile:0,radioGroup:0,readOnly:o,referrerPolicy:0,rel:0,required:o,reversed:o,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:o,scrolling:0,seamless:o,selected:i|o,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:o,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(t,e){if(null==e)return t.removeAttribute("value");"number"!==t.type||!1===t.hasAttribute("value")?t.setAttribute("value",""+e):t.validity&&!t.validity.badInput&&t.ownerDocument.activeElement!==t&&t.setAttribute("value",""+e)}}};e.exports=u},{1088:1088}],1099:[function(t,e,n){"use strict";var r={escape:function(t){var e=/[=:]/g,n={"=":"=0",":":"=2"};return"$"+(""+t).replace(e,function(t){return n[t]})},unescape:function(t){var e=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1))).replace(e,function(t){return n[t]})}};e.exports=r},{}],1100:[function(t,e,n){"use strict";function r(t){null!=t.checkedLink&&null!=t.valueLink&&s("87")}function i(t){r(t),(null!=t.value||null!=t.onChange)&&s("88")}function o(t){r(t),(null!=t.checked||null!=t.onChange)&&s("89")}function a(t){if(t){var e=t.getName();if(e)return" Check the render method of `"+e+"`."}return""}var s=t(1197),l=t(1147),u=t(1056)(t(1206).isValidElement),c=(t(123),t(130),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),h={value:function(t,e,n){return!t[e]||c[t.type]||t.onChange||t.readOnly||t.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(t,e,n){return!t[e]||t.onChange||t.readOnly||t.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:u.func},f={},d={checkPropTypes:function(t,e,n){for(var r in h){if(h.hasOwnProperty(r))var i=h[r](e,r,t,"prop",null,l);if(i instanceof Error&&!(i.message in f)){f[i.message]=!0;a(n)}}},getValue:function(t){return t.valueLink?(i(t),t.valueLink.value):t.value},getChecked:function(t){return t.checkedLink?(o(t),t.checkedLink.value):t.checked},executeOnChange:function(t,e){return t.valueLink?(i(t),t.valueLink.requestChange(e.target.value)):t.checkedLink?(o(t),t.checkedLink.requestChange(e.target.checked)):t.onChange?t.onChange.call(void 0,e):void 0}};e.exports=d},{1056:1056,1147:1147,1197:1197,1206:1206,123:123,130:130}],1101:[function(t,e,n){"use strict";var r=t(1197),i=(t(123),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),o=function(t){var e=this;t instanceof e||r("25"),t.destructor(),e.instancePool.length=0||null!=e.is}function m(t){var e=t.type;d(e),this._currentElement=t,this._tag=e.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var v=t(1197),g=t(470),y=t(1079),x=t(1082),b=t(1086),_=t(1087),w=t(1088),M=t(1089),k=t(1093),T=t(1094),A=t(1102),S=t(1109),E=t(1110),C=t(1115),L=t(1118),P=t(1119),I=t(1122),O=(t(1139),t(1143)),D=t(1151),z=(t(115),t(1179)),j=(t(123),t(1194),t(129),t(1192)),N=(t(1203),t(130),S),R=k.deleteListener,F=E.getNodeFromInstance,B=A.listenTo,U=T.registrationNameModules,V={string:!0,number:!0},H="__html",q={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},W=11,G={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"},Y={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},X={listing:!0,pre:!0,textarea:!0},Z=g({menuitem:!0},Y),K=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,J={},$={}.hasOwnProperty,Q=1;m.displayName="ReactDOMComponent",m.Mixin={mountComponent:function(t,e,n,r){this._rootNodeID=Q++,this._domID=n._idCounter++,this._hostParent=e,this._hostContainerInfo=n;var o=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(h,this);break;case"input":C.mountWrapper(this,o,e),o=C.getHostProps(this,o),t.getReactMountReady().enqueue(c,this),t.getReactMountReady().enqueue(h,this);break;case"option":L.mountWrapper(this,o,e),o=L.getHostProps(this,o);break;case"select":P.mountWrapper(this,o,e),o=P.getHostProps(this,o),t.getReactMountReady().enqueue(h,this);break;case"textarea":I.mountWrapper(this,o,e),o=I.getHostProps(this,o),t.getReactMountReady().enqueue(c,this),t.getReactMountReady().enqueue(h,this)}i(this,o);var a,f;null!=e?(a=e._namespaceURI,f=e._tag):n._tag&&(a=n._namespaceURI,f=n._tag),(null==a||a===_.svg&&"foreignobject"===f)&&(a=_.html),a===_.html&&("svg"===this._tag?a=_.svg:"math"===this._tag&&(a=_.mathml)),this._namespaceURI=a;var d;if(t.useCreateElement){var p,m=n._ownerDocument;if(a===_.html)if("script"===this._tag){var v=m.createElement("div"),g=this._currentElement.type;v.innerHTML="<"+g+">",p=v.removeChild(v.firstChild)}else p=o.is?m.createElement(this._currentElement.type,o.is):m.createElement(this._currentElement.type);else p=m.createElementNS(a,this._currentElement.type);E.precacheNode(this,p),this._flags|=N.hasCachedChildNodes,this._hostParent||M.setAttributeForRoot(p),this._updateDOMProperties(null,o,t);var x=b(p);this._createInitialChildren(t,o,r,x),d=x}else{var w=this._createOpenTagMarkupAndPutListeners(t,o),k=this._createContentMarkup(t,o,r);d=!k&&Y[this._tag]?w+"/>":w+">"+k+""}switch(this._tag){case"input":t.getReactMountReady().enqueue(s,this),o.autoFocus&&t.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"textarea":t.getReactMountReady().enqueue(l,this),o.autoFocus&&t.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"select":case"button":o.autoFocus&&t.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"option":t.getReactMountReady().enqueue(u,this)}return d},_createOpenTagMarkupAndPutListeners:function(t,e){var n="<"+this._currentElement.type;for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(null!=i)if(U.hasOwnProperty(r))i&&o(this,r,i,t);else{"style"===r&&(i&&(i=this._previousStyleCopy=g({},e.style)),i=x.createMarkupForStyles(i,this));var a=null;null!=this._tag&&p(this._tag,e)?q.hasOwnProperty(r)||(a=M.createMarkupForCustomAttribute(r,i)):a=M.createMarkupForProperty(r,i),a&&(n+=" "+a)}}return t.renderToStaticMarkup?n:(this._hostParent||(n+=" "+M.createMarkupForRoot()),n+=" "+M.createMarkupForID(this._domID))},_createContentMarkup:function(t,e,n){var r="",i=e.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&(r=i.__html);else{var o=V[typeof e.children]?e.children:null,a=null!=o?null:e.children;null!=o?r=z(o):null!=a&&(r=this.mountChildren(a,t,n).join(""))}return X[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(t,e,n,r){var i=e.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&b.queueHTML(r,i.__html);else{var o=V[typeof e.children]?e.children:null,a=null!=o?null:e.children;if(null!=o)""!==o&&b.queueText(r,o);else if(null!=a)for(var s=this.mountChildren(a,t,n),l=0;le.end?(n=e.end,r=e.start):(n=e.start,r=e.end),i.moveToElementText(t),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}:function(t,e){if(window.getSelection){var n=window.getSelection(),r=t[a()].length,i=Math.min(e.start,r),s=void 0===e.end?i:Math.min(e.end,r);if(!n.extend&&i>s){var l=s;s=i,i=l}var u=o(t,i),c=o(t,s);if(u&&c){var h=document.createRange();h.setStart(u.node,u.offset),n.removeAllRanges(),i>s?(n.addRange(h),n.extend(c.node,c.offset)):(h.setEnd(c.node,c.offset),n.addRange(h))}}}};e.exports=l},{109:109,1189:1189,1190:1190}],1121:[function(t,e,n){"use strict";var r=t(1197),i=t(470),o=t(1085),a=t(1086),s=t(1110),l=t(1179),u=(t(123),t(1203),function(t){this._currentElement=t,this._stringText=""+t,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});i(u.prototype,{mountComponent:function(t,e,n,r){var i=n._idCounter++,o=" react-text: "+i+" ";if(this._domID=i,this._hostParent=e,t.useCreateElement){var u=n._ownerDocument,c=u.createComment(o),h=u.createComment(" /react-text "),f=a(u.createDocumentFragment());return a.queueChild(f,a(c)),this._stringText&&a.queueChild(f,a(u.createTextNode(this._stringText))),a.queueChild(f,a(h)),s.precacheNode(this,c),this._closingComment=h,f}var d=l(this._stringText);return t.renderToStaticMarkup?d:"\x3c!--"+o+"--\x3e"+d+"\x3c!-- /react-text --\x3e"},receiveComponent:function(t,e){if(t!==this._currentElement){this._currentElement=t;var n=""+t;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();o.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var t=this._commentNodes;if(t)return t;if(!this._closingComment)for(var e=s.getNodeFromInstance(this).nextSibling;;){if(null==e&&r("67",this._domID),8===e.nodeType&&" /react-text "===e.nodeValue){this._closingComment=e;break}e=e.nextSibling}return t=[this._hostNode,this._closingComment],this._commentNodes=t,t},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=u},{1085:1085,1086:1086,1110:1110,1179:1179,1197:1197,1203:1203,123:123,470:470}],1122:[function(t,e,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function i(t){var e=this._currentElement.props,n=s.executeOnChange(e,t);return u.asap(r,this),n}var o=t(1197),a=t(470),s=t(1100),l=t(1110),u=t(1154),c=(t(123),t(130),{getHostProps:function(t,e){return null!=e.dangerouslySetInnerHTML&&o("91"),a({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue,onChange:t._wrapperState.onChange})},mountWrapper:function(t,e){var n=s.getValue(e),r=n;if(null==n){var a=e.defaultValue,l=e.children;null!=l&&(null!=a&&o("92"),Array.isArray(l)&&(l.length<=1||o("93"),l=l[0]),a=""+l),null==a&&(a=""),r=a}t._wrapperState={initialValue:""+r,listeners:null,onChange:i.bind(t)}},updateWrapper:function(t){var e=t._currentElement.props,n=l.getNodeFromInstance(t),r=s.getValue(e);if(null!=r){var i=""+r;i!==n.value&&(n.value=i),null==e.defaultValue&&(n.defaultValue=i)}null!=e.defaultValue&&(n.defaultValue=e.defaultValue)},postMountWrapper:function(t){var e=l.getNodeFromInstance(t),n=e.textContent;n===t._wrapperState.initialValue&&(e.value=n)}});e.exports=c},{1100:1100,1110:1110,1154:1154,1197:1197,123:123,130:130,470:470}],1123:[function(t,e,n){"use strict";function r(t,e){"_hostNode"in t||i("33"),"_hostNode"in e||i("33");for(var n=0,r=t;r;r=r._hostParent)n++;for(var o=0,a=e;a;a=a._hostParent)o++;for(;n-o>0;)t=t._hostParent,n--;for(;o-n>0;)e=e._hostParent,o--;for(var s=n;s--;){if(t===e)return t;t=t._hostParent,e=e._hostParent}return null}var i=t(1197);t(123);e.exports={isAncestor:function(t,e){"_hostNode"in t||i("35"),"_hostNode"in e||i("35");for(;e;){if(e===t)return!0;e=e._hostParent}return!1},getLowestCommonAncestor:r,getParentInstance:function(t){return"_hostNode"in t||i("36"),t._hostParent},traverseTwoPhase:function(t,e,n){for(var r=[];t;)r.push(t),t=t._hostParent;var i;for(i=r.length;i-- >0;)e(r[i],"captured",n);for(i=0;i0;)n(l[u],"captured",o)}}},{1197:1197,123:123}],1124:[function(t,e,n){"use strict";function r(t,e){null!=e&&"string"==typeof e.type&&(e.type.indexOf("-")>=0||e.props.is||o(t,e))}t(1088),t(1094),t(1209),t(130);var i,o=function(t,e){var n=[];for(var r in e.props)i(e.type,r,t)||n.push(r);n.map(function(t){return"`"+t+"`"}).join(", ");1===n.length||n.length},a={onBeforeMountComponent:function(t,e){r(t,e)},onBeforeUpdateComponent:function(t,e){r(t,e)}};e.exports=a},{1088:1088,1094:1094,1209:1209,130:130}],1125:[function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){try{e.call(n,r,i,o,a,s)}catch(e){w[t]=!0}}function i(t,e,n,i,o,a){for(var s=0;s<_.length;s++){var l=_[s],u=l[t];u&&r(t,u,l,e,n,i,o,a)}}function o(){y.purgeUnmountedComponents(),g.clearHistory()}function a(t){return t.reduce(function(t,e){var n=y.getOwnerID(e),r=y.getParentID(e);return t[e]={displayName:y.getDisplayName(e),text:y.getText(e),updateCount:y.getUpdateCount(e),childIDs:y.getChildIDs(e),ownerID:n||r&&y.getOwnerID(r)||0,parentID:r},t},{})}function s(){var t=E,e=S,n=g.getHistory();if(0===A)return E=0,S=[],void o();if(e.length||n.length){var r=y.getRegisteredIDs();k.push({duration:b()-t,measurements:e||[],operations:n||[],treeSnapshot:a(r)})}o(),E=b(),S=[]}function l(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1]}function u(t,e){0!==A&&(I&&!O&&(O=!0),L=b(),P=0,C=t,I=e)}function c(t,e){0!==A&&(I===e||O||(O=!0),M&&S.push({timerType:e,instanceID:t,duration:b()-L-P}),L=0,P=0,C=null,I=null)}function h(){var t={startTime:L,nestedFlushStartTime:b(),debugID:C,timerType:I};T.push(t),L=0,P=0,C=null,I=null}function f(){var t=T.pop(),e=t.startTime,n=t.nestedFlushStartTime,r=t.debugID,i=t.timerType,o=b()-n;L=e,P+=o,C=r,I=i}function d(t){if(!M||!z)return!1;var e=y.getElement(t);return null!=e&&"object"==typeof e&&!("string"==typeof e.type)}function p(t,e){if(d(t)){var n=t+"::"+e;D=b(),performance.mark(n)}}function m(t,e){if(d(t)){var n=t+"::"+e,r=y.getDisplayName(t)||"Unknown";if(b()-D>.1){var i=r+" ["+e+"]";performance.measure(i,n)}performance.clearMarks(n),i&&performance.clearMeasures(i)}}var v=t(1140),g=t(1135),y=t(1209),x=t(109),b=t(128),_=(t(130),[]),w={},M=!1,k=[],T=[],A=0,S=[],E=0,C=null,L=0,P=0,I=null,O=!1,D=0,z="undefined"!=typeof performance&&"function"==typeof performance.mark&&"function"==typeof performance.clearMarks&&"function"==typeof performance.measure&&"function"==typeof performance.clearMeasures,j={addHook:function(t){_.push(t)},removeHook:function(t){for(var e=0;e<_.length;e++)_[e]===t&&(_.splice(e,1),e--)},isProfiling:function(){return M},beginProfiling:function(){M||(M=!0,k.length=0,s(),j.addHook(g))},endProfiling:function(){M&&(M=!1,s(),j.removeHook(g))},getFlushHistory:function(){return k},onBeginFlush:function(){A++,s(),h(),i("onBeginFlush")},onEndFlush:function(){s(),A--,f(),i("onEndFlush")},onBeginLifeCycleTimer:function(t,e){l(t),i("onBeginLifeCycleTimer",t,e),p(t,e),u(t,e)},onEndLifeCycleTimer:function(t,e){l(t),c(t,e),m(t,e),i("onEndLifeCycleTimer",t,e)},onBeginProcessingChildContext:function(){i("onBeginProcessingChildContext")},onEndProcessingChildContext:function(){i("onEndProcessingChildContext")},onHostOperation:function(t){l(t.instanceID),i("onHostOperation",t)},onSetState:function(){i("onSetState")},onSetChildren:function(t,e){l(t),e.forEach(l),i("onSetChildren",t,e)},onBeforeMountComponent:function(t,e,n){l(t),l(n,!0),i("onBeforeMountComponent",t,e,n),p(t,"mount")},onMountComponent:function(t){l(t),m(t,"mount"),i("onMountComponent",t)},onBeforeUpdateComponent:function(t,e){l(t),i("onBeforeUpdateComponent",t,e),p(t,"update")},onUpdateComponent:function(t){l(t),m(t,"update"),i("onUpdateComponent",t)},onBeforeUnmountComponent:function(t){l(t),i("onBeforeUnmountComponent",t),p(t,"unmount")},onUnmountComponent:function(t){l(t),m(t,"unmount"),i("onUnmountComponent",t)},onTestEvent:function(){i("onTestEvent")}};j.addDevtool=j.addHook,j.removeDevtool=j.removeHook,j.addHook(v),j.addHook(y);var N=x.canUseDOM&&window.location.href||"";/[?&]react_perf\b/.test(N)&&j.beginProfiling(),e.exports=j},{109:109,1135:1135,1140:1140,1209:1209,128:128,130:130}],1126:[function(t,e,n){"use strict";function r(){this.reinitializeTransaction()}var i=t(470),o=t(1154),a=t(1172),s=t(115),l={initialize:s,close:function(){h.isBatchingUpdates=!1}},u=[{initialize:s,close:o.flushBatchedUpdates.bind(o)},l];i(r.prototype,a,{getTransactionWrappers:function(){return u}});var c=new r,h={isBatchingUpdates:!1,batchedUpdates:function(t,e,n,r,i,o){var a=h.isBatchingUpdates;return h.isBatchingUpdates=!0,a?t(e,n,r,i,o):c.perform(t,null,e,n,r,i,o)}};e.exports=h},{115:115,1154:1154,1172:1172,470:470}],1127:[function(t,e,n){"use strict";var r=t(1078),i=t(1080),o=t(1084),a=t(1091),s=t(1092),l=t(1098),u=t(1104),c=t(1108),h=t(1110),f=t(1112),d=t(1123),p=t(1121),m=t(1126),v=t(1132),g=t(1136),y=t(1148),x=t(1156),b=t(1157),_=t(1158),w=!1;e.exports={inject:function(){w||(w=!0,g.EventEmitter.injectReactEventListener(v),g.EventPluginHub.injectEventPluginOrder(a),g.EventPluginUtils.injectComponentTree(h),g.EventPluginUtils.injectTreeTraversal(d),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:_,EnterLeaveEventPlugin:s,ChangeEventPlugin:o,SelectEventPlugin:b,BeforeInputEventPlugin:i}),g.HostComponent.injectGenericComponentClass(c),g.HostComponent.injectTextComponentClass(p),g.DOMProperty.injectDOMPropertyConfig(r),g.DOMProperty.injectDOMPropertyConfig(l),g.DOMProperty.injectDOMPropertyConfig(x),g.EmptyComponent.injectEmptyComponentFactory(function(t){return new f(t)}),g.Updates.injectReconcileTransaction(y),g.Updates.injectBatchingStrategy(m),g.Component.injectEnvironment(u))}}},{1078:1078,1080:1080,1084:1084,1091:1091,1092:1092,1098:1098,1104:1104,1108:1108,1110:1110,1112:1112,1121:1121,1123:1123,1126:1126,1132:1132,1136:1136,1148:1148,1156:1156,1157:1157,1158:1158}],1128:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},{}],1129:[function(t,e,n){"use strict";var r,i={injectEmptyComponentFactory:function(t){r=t}},o={create:function(t){return r(t)}};o.injection=i,e.exports=o},{}],1130:[function(t,e,n){"use strict";function r(t,e,n){try{e(n)}catch(t){null===i&&(i=t)}}var i=null,o={invokeGuardedCallback:r,invokeGuardedCallbackWithCatch:r,rethrowCaughtError:function(){if(i){var t=i;throw i=null,t}}};e.exports=o},{}],1131:[function(t,e,n){"use strict";function r(t){i.enqueueEvents(t),i.processEventQueue(!1)}var i=t(1093),o={handleTopLevel:function(t,e,n,o){r(i.extractEvents(t,e,n,o))}};e.exports=o},{1093:1093}],1132:[function(t,e,n){"use strict";function r(t){for(;t._hostParent;)t=t._hostParent;var e=h.getNodeFromInstance(t).parentNode;return h.getClosestInstanceFromNode(e)}function i(t,e){this.topLevelType=t,this.nativeEvent=e,this.ancestors=[]}function o(t){var e=d(t.nativeEvent),n=h.getClosestInstanceFromNode(e),i=n;do{t.ancestors.push(i),i=i&&r(i)}while(i);for(var o=0;o/,o=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(t){var e=r(t);return o.test(t)?t:t.replace(i," "+a.CHECKSUM_ATTR_NAME+'="'+e+'"$&')},canReuseMarkup:function(t,e){var n=e.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(t)===n}};e.exports=a},{1175:1175}],1142:[function(t,e,n){"use strict";function r(t,e){for(var n=Math.min(t.length,e.length),r=0;r.":"function"==typeof e?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=e&&void 0!==e.props?" This may be caused by unintentionally loading two independent copies of React.":"");var a,s=v.createElement(R,{child:e});if(t){var l=w.get(t);a=l._processChildContext(l._context)}else a=S;var c=f(n);if(c){var h=c._currentElement.props.child;if(L(h,e)){var p=c._renderedComponent.getPublicInstance(),m=r&&function(){r.call(p)};return F._updateRootComponent(c,s,a,n,m),p}F.unmountComponentAtNode(n)}var g=i(n),y=g&&!!o(g),x=u(n),b=y&&!c&&!x,_=F._renderNewRootComponent(s,n,b,a)._renderedComponent.getPublicInstance();return r&&r.call(_),_},render:function(t,e,n){return F._renderSubtreeIntoContainer(null,t,e,n)},unmountComponentAtNode:function(t){c(t)||d("40");var e=f(t);if(!e){u(t),1===t.nodeType&&t.hasAttribute(I);return!1}return delete j[e._instance.rootID],A.batchedUpdates(l,e,t,!1),!0},_mountImageIntoNode:function(t,e,n,o,a){if(c(e)||d("41"),o){var s=i(e);if(M.canReuseMarkup(t,s))return void y.precacheNode(n,s);var l=s.getAttribute(M.CHECKSUM_ATTR_NAME);s.removeAttribute(M.CHECKSUM_ATTR_NAME);var u=s.outerHTML;s.setAttribute(M.CHECKSUM_ATTR_NAME,l);var h=t,f=r(h,u),m=" (client) "+h.substring(f-20,f+20)+"\n (server) "+u.substring(f-20,f+20);e.nodeType===D&&d("42",m)}if(e.nodeType===D&&d("43"),a.useCreateElement){for(;e.lastChild;)e.removeChild(e.lastChild);p.insertTreeBefore(e,t,null)}else C(e,t),y.precacheNode(n,e.firstChild)}};e.exports=F},{1086:1086,1088:1088,1102:1102,1110:1110,1111:1111,1113:1113,1133:1133,1138:1138,1139:1139,1141:1141,1149:1149,1153:1153,1154:1154,116:116,1193:1193,1197:1197,1199:1199,1201:1201,1206:1206,1210:1210,123:123,130:130}],1143:[function(t,e,n){"use strict";function r(t,e,n){return{type:"INSERT_MARKUP",content:t,fromIndex:null,fromNode:null,toIndex:n,afterNode:e}}function i(t,e,n){return{type:"MOVE_EXISTING",content:null,fromIndex:t._mountIndex,fromNode:f.getHostNode(t),toIndex:n,afterNode:e}}function o(t,e){return{type:"REMOVE_NODE",content:null,fromIndex:t._mountIndex,fromNode:e,toIndex:null,afterNode:null}}function a(t){return{type:"SET_MARKUP",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(t){return{type:"TEXT_CONTENT",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function l(t,e){return e&&(t=t||[]).push(e),t}function u(t,e){h.processChildrenUpdates(t,e)}var c=t(1197),h=t(1105),f=(t(1138),t(1139),t(1210),t(1149)),d=t(1103),p=(t(115),t(1181)),m=(t(123),{Mixin:{_reconcilerInstantiateChildren:function(t,e,n){return d.instantiateChildren(t,e,n)},_reconcilerUpdateChildren:function(t,e,n,r,i,o){var a,s=0;return a=p(e,s),d.updateChildren(t,a,n,r,i,this,this._hostContainerInfo,o,s),a},mountChildren:function(t,e,n){var r=this._reconcilerInstantiateChildren(t,e,n);this._renderedChildren=r;var i=[],o=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],l=0,u=f.mountComponent(s,e,this,this._hostContainerInfo,n,l);s._mountIndex=o++,i.push(u)}return i},updateTextContent:function(t){var e=this._renderedChildren;d.unmountChildren(e,!1);for(var n in e)e.hasOwnProperty(n)&&c("118");u(this,[s(t)])},updateMarkup:function(t){var e=this._renderedChildren;d.unmountChildren(e,!1);for(var n in e)e.hasOwnProperty(n)&&c("118");u(this,[a(t)])},updateChildren:function(t,e,n){this._updateChildren(t,e,n)},_updateChildren:function(t,e,n){var r=this._renderedChildren,i={},o=[],a=this._reconcilerUpdateChildren(r,t,o,i,e,n);if(a||r){var s,c=null,h=0,d=0,p=0,m=null;for(s in a)if(a.hasOwnProperty(s)){var v=r&&r[s],g=a[s];v===g?(c=l(c,this.moveChild(v,m,h,d)),d=Math.max(v._mountIndex,d),v._mountIndex=h):(v&&(d=Math.max(v._mountIndex,d)),c=l(c,this._mountChildAtIndex(g,o[p],m,h,e,n)),p++),h++,m=f.getHostNode(g)}for(s in i)i.hasOwnProperty(s)&&(c=l(c,this._unmountChild(r[s],i[s])));c&&u(this,c),this._renderedChildren=a}},unmountChildren:function(t){var e=this._renderedChildren;d.unmountChildren(e,t),this._renderedChildren=null},moveChild:function(t,e,n,r){if(t._mountIndex0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function o(t,e){var n=s.get(t);if(!n){return null}return n}var a=t(1197),s=(t(1210),t(1138)),l=(t(1139),t(1154)),u=(t(123),t(130),{isMounted:function(t){var e=s.get(t);return!!e&&!!e._renderedComponent},enqueueCallback:function(t,e,n){u.validateCallback(e,n);var i=o(t);if(!i)return null;i._pendingCallbacks?i._pendingCallbacks.push(e):i._pendingCallbacks=[e],r(i)},enqueueCallbackInternal:function(t,e){t._pendingCallbacks?t._pendingCallbacks.push(e):t._pendingCallbacks=[e],r(t)},enqueueForceUpdate:function(t){var e=o(t);e&&(e._pendingForceUpdate=!0,r(e))},enqueueReplaceState:function(t,e,n){var i=o(t);i&&(i._pendingStateQueue=[e],i._pendingReplaceState=!0,void 0!==n&&null!==n&&(u.validateCallback(n,"replaceState"),i._pendingCallbacks?i._pendingCallbacks.push(n):i._pendingCallbacks=[n]),r(i))},enqueueSetState:function(t,e){var n=o(t);n&&((n._pendingStateQueue||(n._pendingStateQueue=[])).push(e),r(n))},enqueueElementInternal:function(t,e,n){t._pendingElement=e,t._context=n,r(t)},validateCallback:function(t,e){t&&"function"!=typeof t&&a("122",e,i(t))}});e.exports=u},{1138:1138,1139:1139,1154:1154,1197:1197,1210:1210,123:123,130:130}],1154:[function(t,e,n){"use strict";function r(){M.ReactReconcileTransaction&&b||l("123")}function i(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=M.ReactReconcileTransaction.getPooled(!0)}function o(t,e){return t._mountOrder-e._mountOrder}function a(t){var e=t.dirtyComponentsLength;e!==v.length&&l("124",e,v.length),v.sort(o),g++;for(var n=0;n]/;e.exports=function(t){return"boolean"==typeof t||"number"==typeof t?""+t:r(t)}},{}],1180:[function(t,e,n){"use strict";var r=t(1197),i=(t(1210),t(1110)),o=t(1138),a=t(1187);t(123),t(130);e.exports=function(t){if(null==t)return null;if(1===t.nodeType)return t;var e=o.get(t);if(e)return(e=a(e))?i.getNodeFromInstance(e):null;"function"==typeof t.render?r("44"):r("45",Object.keys(t))}},{1110:1110,1138:1138,1187:1187,1197:1197,1210:1210,123:123,130:130}],1181:[function(t,e,n){(function(n){"use strict";function r(t,e,n,r){if(t&&"object"==typeof t){var i=t,o=void 0===i[n];o&&null!=e&&(i[n]=e)}}t(1099);var i=t(1202);t(130);void 0!==n&&n.env,e.exports=function(t,e){if(null==t)return t;var n={};return i(t,r,n),n}}).call(this,t(1054))},{1054:1054,1099:1099,1202:1202,1209:1209,130:130}],1182:[function(t,e,n){"use strict";e.exports=function(t,e,n){Array.isArray(t)?t.forEach(e,n):t&&e.call(n,t)}},{}],1183:[function(t,e,n){"use strict";e.exports=function(t){var e,n=t.keyCode;return"charCode"in t?0===(e=t.charCode)&&13===n&&(e=13):e=n,e>=32||13===e?e:0}},{}],1184:[function(t,e,n){"use strict";var r=t(1183),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=function(t){if(t.key){var e=i[t.key]||t.key;if("Unidentified"!==e)return e}if("keypress"===t.type){var n=r(t);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===t.type||"keyup"===t.type?o[t.keyCode]||"Unidentified":""}},{1183:1183}],1185:[function(t,e,n){"use strict";function r(t){var e=this.nativeEvent;if(e.getModifierState)return e.getModifierState(t);var n=i[t];return!!n&&!!e[n]}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=function(t){return r}},{}],1186:[function(t,e,n){"use strict";e.exports=function(t){var e=t.target||t.srcElement||window;return e.correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}},{}],1187:[function(t,e,n){"use strict";var r=t(1144);e.exports=function(t){for(var e;(e=t._renderedNodeType)===r.COMPOSITE;)t=t._renderedComponent;return e===r.HOST?t._renderedComponent:e===r.EMPTY?null:void 0}},{1144:1144}],1188:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=function(t){var e=t&&(r&&t[r]||t[i]);if("function"==typeof e)return e}},{}],1189:[function(t,e,n){"use strict";function r(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function i(t){for(;t;){if(t.nextSibling)return t.nextSibling;t=t.parentNode}}e.exports=function(t,e){for(var n=r(t),o=0,a=0;n;){if(3===n.nodeType){if(a=o+n.textContent.length,o<=e&&a>=e)return{node:n,offset:e-o};o=a}n=r(i(n))}}},{}],1190:[function(t,e,n){"use strict";var r=t(109),i=null;e.exports=function(){return!i&&r.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}},{109:109}],1191:[function(t,e,n){"use strict";function r(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n["ms"+t]="MS"+e,n["O"+t]="o"+e.toLowerCase(),n}var i=t(109),o={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},a={},s={};i.canUseDOM&&(s=document.createElement("div").style,"AnimationEvent"in window||(delete o.animationend.animation,delete o.animationiteration.animation,delete o.animationstart.animation),"TransitionEvent"in window||delete o.transitionend.transition),e.exports=function(t){if(a[t])return a[t];if(!o[t])return t;var e=o[t];for(var n in e)if(e.hasOwnProperty(n)&&n in s)return a[t]=e[n];return""}},{109:109}],1192:[function(t,e,n){"use strict";function r(t){var e=t.type,n=t.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===e||"radio"===e)}function i(t){return t._wrapperState.valueTracker}function o(t,e){t._wrapperState.valueTracker=e}function a(t){t._wrapperState.valueTracker=null}function s(t){var e;return t&&(e=r(t)?""+t.checked:t.value),e}var l=t(1110),u={_getTrackerFromNode:function(t){return i(l.getInstanceFromNode(t))},track:function(t){if(!i(t)){var e=l.getNodeFromInstance(t),n=r(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),u=""+e[n];e.hasOwnProperty(n)||"function"!=typeof s.get||"function"!=typeof s.set||(Object.defineProperty(e,n,{enumerable:s.enumerable,configurable:!0,get:function(){return s.get.call(this)},set:function(t){u=""+t,s.set.call(this,t)}}),o(t,{getValue:function(){return u},setValue:function(t){u=""+t},stopTracking:function(){a(t),delete e[n]}}))}},updateValueIfChanged:function(t){if(!t)return!1;var e=i(t);if(!e)return u.track(t),!0;var n=e.getValue(),r=s(l.getNodeFromInstance(t));return r!==n&&(e.setValue(r),!0)},stopTracking:function(t){var e=i(t);e&&e.stopTracking()}};e.exports=u},{1110:1110}],1193:[function(t,e,n){"use strict";function r(t){if(t){var e=t.getName();if(e)return" Check the render method of `"+e+"`."}return""}function i(t){return"function"==typeof t&&void 0!==t.prototype&&"function"==typeof t.prototype.mountComponent&&"function"==typeof t.prototype.receiveComponent}function o(t,e){var n;if(null===t||!1===t)n=u.create(o);else if("object"==typeof t){var s=t,l=s.type;if("function"!=typeof l&&"string"!=typeof l){var f="";f+=r(s._owner),a("130",null==l?l:typeof l,f)}"string"==typeof s.type?n=c.createInternalComponent(s):i(s.type)?(n=new s.type(s)).getHostNode||(n.getHostNode=n.getNativeNode):n=new h(s)}else"string"==typeof t||"number"==typeof t?n=c.createInstanceForText(t):a("131",typeof t);return n._mountIndex=0,n._mountImage=null,n}var a=t(1197),s=t(470),l=t(1106),u=t(1129),c=t(1134),h=(t(1224),t(123),t(130),function(t){this.construct(t)});s(h.prototype,l,{_instantiateReactComponent:o}),e.exports=o},{1106:1106,1129:1129,1134:1134,1197:1197,1224:1224,123:123,130:130,470:470}],1194:[function(t,e,n){"use strict";var r,i=t(109);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(t,e){if(!i.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,o=n in document;if(!o){var a=document.createElement("div");a.setAttribute(n,"return;"),o="function"==typeof a[n]}return!o&&r&&"wheel"===t&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}},{109:109}],1195:[function(t,e,n){"use strict";var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=function(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!r[t.type]:"textarea"===e}},{}],1196:[function(t,e,n){"use strict";var r=t(1179);e.exports=function(t){return'"'+r(t)+'"'}},{1179:1179}],1197:[function(t,e,n){"use strict";e.exports=function(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r]/,l=t(1177)(function(t,e){if(t.namespaceURI!==o.svg||"innerHTML"in t)t.innerHTML=e;else{(r=r||document.createElement("div")).innerHTML=""+e+"";for(var n=r.firstChild;n.firstChild;)t.appendChild(n.firstChild)}});if(i.canUseDOM){var u=document.createElement("div");u.innerHTML=" ",""===u.innerHTML&&(l=function(t,e){if(t.parentNode&&t.parentNode.replaceChild(t,t),a.test(e)||"<"===e[0]&&s.test(e)){t.innerHTML=String.fromCharCode(65279)+e;var n=t.firstChild;1===n.data.length?t.removeChild(n):n.deleteData(0,1)}else t.innerHTML=e}),u=null}e.exports=l},{1087:1087,109:109,1177:1177}],1200:[function(t,e,n){"use strict";var r=t(109),i=t(1179),o=t(1199),a=function(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&3===n.nodeType)return void(n.nodeValue=e)}t.textContent=e};r.canUseDOM&&("textContent"in document.documentElement||(a=function(t,e){3!==t.nodeType?o(t,i(e)):t.nodeValue=e})),e.exports=a},{109:109,1179:1179,1199:1199}],1201:[function(t,e,n){"use strict";e.exports=function(t,e){var n=null===t||!1===t,r=null===e||!1===e;if(n||r)return n===r;var i=typeof t,o=typeof e;return"string"===i||"number"===i?"string"===o||"number"===o:"object"===o&&t.type===e.type&&t.key===e.key}},{}],1202:[function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?l.escape(t.key):e.toString(36)}function i(t,e,n,h){var f=typeof t;if("undefined"!==f&&"boolean"!==f||(t=null),null===t||"string"===f||"number"===f||"object"===f&&t.$$typeof===a)return n(h,t,""===e?u+r(t,0):e),1;var d,p=0,m=""===e?u:e+c;if(Array.isArray(t))for(var v=0;v1){for(var p=Array(d),m=0;m1){for(var g=Array(v),y=0;y.")}return e}function a(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var n=p.uniqueKey||(p.uniqueKey={}),r=o(e);if(!n[r]){n[r]=!0;t&&t._owner&&t._owner!==u.current&&" It was passed a child from "+t._owner.getName()+"."}}}function s(t,e){if("object"==typeof t)if(Array.isArray(t))for(var n=0;n0){var u=t[n-1];if(0===r(s,u)&&o(u)!==l){n-=1;continue}}t[n++]=s}}return t.length=n,t}},{58:58,76:76,77:77}],1231:[function(t,e,n){!function(t,r){"object"==typeof n&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.createREGL=r()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function n(t,n){t||e(n)}function r(t){return t?": "+t:""}function i(t,n,i){n.indexOf(t)<0&&e("invalid value"+r(i)+". must be one of: "+n)}function o(t,e){for(t+="";t.length0&&e.push(new l("unknown",0,t))}}),e}function d(t,e){e.forEach(function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function p(t){t._commandRef=u()}function m(t,n){var r=c();e(t+" in command "+(n||u())+("unknown"===r?"":" called from "+r))}function v(t,e,n,i){typeof t!==e&&m("invalid parameter type"+r(n)+". expected "+e+", got "+typeof t,i||u())}function g(t,e){return t===Ut||t===Bt||t===Vt?2:t===Ht?4:qt[t]*e}function y(t){return!(t&t-1||!t)}function x(t,e){this.id=Gt++,this.type=t,this.data=e}function b(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function _(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+b(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return _(t.substr(0,r.index)).concat(_(r[1])).concat(_(t.substr(r.index+r[0].length)));var i=t.split(".");if(1===i.length)return['"'+b(t)+'"'];for(var o=[],a=0;a0,"invalid pixel ratio")):Wt.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?r=e:n=e),!i){if(!r){Wt("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=k(n||document.body,h,u);if(!d)return null;r=d.canvas,f=d.onDestroy}i=T(r,a)}return i?{gl:i,canvas:r,container:n,extensions:s,optionalExtensions:l,pixelRatio:u,profile:c,onDone:h,onDestroy:f}:(f(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){function n(e){Wt.type(e,"string","extension name must be string");var n,i=e.toLowerCase();try{n=r[i]=t.getExtension(i)}catch(t){}return!!n}for(var r={},i=0;i65535)<<4,t>>>=e,n=(t>255)<<3,t>>>=n,e|=n,n=(t>15)<<2,t>>>=n,e|=n,n=(t>3)<<1,t>>>=n,(e|=n)|t>>1}function j(t){var e=D(t),n=ae[z(e)>>2];return n.length>0?n.pop():new ArrayBuffer(e)}function N(t){ae[z(t.byteLength)>>2].push(t)}function R(t,e,n){for(var r=0;r0){var l;if(Array.isArray(e[0])){s=fe(e);for(var u=1,c=1;c0)if("number"==typeof t[0]){var i=se.allocType(d.dtype,t.length);H(i,t),f(i,r),se.freeType(i)}else if(Array.isArray(t[0])||Lt(t[0])){n=fe(t);var o=he(t,n,d.dtype);f(o,r),se.freeType(o)}else Wt.raise("invalid buffer data")}else if(Lt(t))f(t,r);else if(I(t)){n=t.shape;var a=t.stride,s=0,l=0,u=0,c=0;1===n.length?(s=n[0],l=1,u=a[0],c=0):2===n.length?(s=n[0],l=n[1],u=a[0],c=a[1]):Wt.raise("invalid shape");var p=Array.isArray(t.data)?d.dtype:V(t.data),m=se.allocType(p,s*l);q(m,t.data,s,l,u,c,t.offset),f(m,r),se.freeType(m)}else Wt.raise("invalid data for buffer subdata");return h},n.profile&&(h.stats=d.stats),h.destroy=function(){a(d)},h},createStream:function(t,e){var n=u.pop();return n||(n=new r(t)),n.bind(),o(n,e,pe,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){$t(l).forEach(a),u.forEach(a)},getBuffer:function(t){return t&&t._buffer instanceof r?t._buffer:null},restore:function(){$t(l).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})},_initBuffer:o}}function G(t,e,n,r){function i(t){this.id=l++,s[this.id]=this,this.buffer=t,this.primType=_e,this.vertCount=0,this.type=0}function o(r,i,o,a,s,l,u){if(r.buffer.bind(),i){var c=u;u||Lt(i)&&(!I(i)||Lt(i.data))||(c=e.oes_element_index_uint?Se:Te),n._initBuffer(r.buffer,i,o,c,3)}else t.bufferData(Ee,l,o),r.buffer.dtype=h||Me,r.buffer.usage=o,r.buffer.dimension=3,r.buffer.byteLength=l;var h=u;if(!u){switch(r.buffer.dtype){case Me:case we:h=Me;break;case Te:case ke:h=Te;break;case Se:case Ae:h=Se;break;default:Wt.raise("unsupported type for element array")}r.buffer.dtype=h}r.type=h,Wt(h!==Se||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=s;f<0&&(f=r.buffer.byteLength,h===Te?f>>=1:h===Se&&(f>>=2)),r.vertCount=f;var d=a;if(a<0){d=_e;var p=r.buffer.dimension;1===p&&(d=xe),2===p&&(d=be),3===p&&(d=_e)}r.primType=d}function a(t){r.elementsCount--,Wt(null!==t.buffer,"must not double destroy elements"),delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},l=0,u={uint8:Me,uint16:Te};e.oes_element_index_uint&&(u.uint32=Se),i.prototype.bind=function(){this.buffer.bind()};var c=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)l(t),c.primType=_e,c.vertCount=0|t,c.type=Me;else{var e=null,n=Le,r=-1,i=-1,a=0,h=0;Array.isArray(t)||Lt(t)||I(t)?e=t:(Wt.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,Wt(Array.isArray(e)||Lt(e)||I(e),"invalid data for element buffer")),"usage"in t&&(Wt.parameter(t.usage,ce,"invalid element buffer usage"),n=ce[t.usage]),"primitive"in t&&(Wt.parameter(t.primitive,ye,"invalid element buffer primitive"),r=ye[t.primitive]),"count"in t&&(Wt("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(Wt.parameter(t.type,u,"invalid buffer type"),h=u[t.type]),"length"in t?a=0|t.length:(a=i,h===Te||h===ke?a*=2:h!==Se&&h!==Ae||(a*=4))),o(c,e,n,r,i,a,h)}else l(),c.primType=_e,c.vertCount=0,c.type=Me;return s}var l=n.create(null,Ee,!0),c=new i(l._buffer);return r.elementsCount++,s(t),s._reglType="elements",s._elements=c,s.subdata=function(t,e){return l.subdata(t,e),s},s.destroy=function(){a(c)},s},createStream:function(t){var e=c.pop();return e||(e=new i(n.create(null,Ee,!0,!1)._buffer)),o(e,t,Ce,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){$t(s).forEach(a)}}}function Y(t){for(var e=se.allocType(Oe,t.length),n=0;n>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var s=-14-o;e[n]=i+(a+1024>>s)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function X(t){return Array.isArray(t)||Lt(t)}function Z(t){return"[object "+t+"]"}function K(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function J(t){return!!Array.isArray(t)&&!(0===t.length||!X(t[0]))}function $(t){return Object.prototype.toString.call(t)}function Q(t){return $(t)===Wn}function tt(t){return $(t)===Gn}function et(t){return $(t)===Yn}function nt(t){return $(t)===Xn}function rt(t){if(!t)return!1;var e=$(t);return Zn.indexOf(e)>=0||(K(t)||J(t)||I(t))}function it(t){return 0|Ct[Object.prototype.toString.call(t)]}function ot(t,e){var n=e.length;switch(t.type){case pn:case mn:case vn:case gn:var r=se.allocType(t.type,n);r.set(e),t.data=r;break;case tn:t.data=Y(e);break;default:Wt.raise("unsupported texture type, must specify a typed array")}}function at(t,e){return se.allocType(t.type===tn?gn:t.type,e)}function st(t,e){t.type===tn?(t.data=Y(e),se.freeType(e)):t.data=e}function lt(t,e,n,r,i,o){for(var a=t.width,s=t.height,l=t.channels,u=at(t,a*s*l),c=0,h=0;h=1;)s+=a*l*l,l/=2;return s}return a*n*r}function ct(t,e,n,r,i,o,a){function s(){this.internalformat=Re,this.format=Re,this.type=pn,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function u(t,r){if("object"==typeof r&&r){if("premultiplyAlpha"in r&&(Wt.type(r.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=r.premultiplyAlpha),"flipY"in r&&(Wt.type(r.flipY,"boolean","invalid texture flip"),t.flipY=r.flipY),"alignment"in r&&(Wt.oneOf(r.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=r.alignment),"colorSpace"in r&&(Wt.parameter(r.colorSpace,z,"invalid colorSpace"),t.colorSpace=z[r.colorSpace]),"type"in r){var i=r.type;Wt(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),Wt(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Wt(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Wt.parameter(i,j,"invalid texture type"),t.type=j[i]}var o=t.width,a=t.height,s=t.channels,l=!1;"shape"in r?(Wt(Array.isArray(r.shape)&&r.shape.length>=2,"shape must be an array"),o=r.shape[0],a=r.shape[1],3===r.shape.length&&(s=r.shape[2],Wt(s>0&&s<=4,"invalid number of channels"),l=!0),Wt(o>=0&&o<=n.maxTextureSize,"invalid width"),Wt(a>=0&&a<=n.maxTextureSize,"invalid height")):("radius"in r&&(o=a=r.radius,Wt(o>=0&&o<=n.maxTextureSize,"invalid radius")),"width"in r&&(o=r.width,Wt(o>=0&&o<=n.maxTextureSize,"invalid width")),"height"in r&&(a=r.height,Wt(a>=0&&a<=n.maxTextureSize,"invalid height")),"channels"in r&&(s=r.channels,Wt(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|o,t.height=0|a,t.channels=0|s;var u=!1;if("format"in r){var c=r.format;Wt(e.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Wt.parameter(c,N,"invalid texture format");var h=t.internalformat=N[c];t.format=G[h],c in j&&("type"in r||(t.type=j[c])),c in R&&(t.compressed=!0),u=!0}!l&&u?t.channels=qn[t.format]:l&&!u?t.channels!==Hn[t.format]&&(t.format=t.internalformat=Hn[t.channels]):u&&l&&Wt(t.channels===qn[t.format],"number of channels inconsistent with specified format")}}function c(e){t.pixelStorei(Nn,e.flipY),t.pixelStorei(Rn,e.premultiplyAlpha),t.pixelStorei(Fn,e.colorSpace),t.pixelStorei(jn,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var r=null;if(rt(e)?r=e:e&&(Wt.type(e,"object","invalid pixel data type"),u(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),rt(e.data)&&(r=e.data)),Wt(!t.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){Wt(!r,"can not specify copy and data field for the same texture");var o=i.viewportWidth,a=i.viewportHeight;t.width=t.width||o-t.xOffset,t.height=t.height||a-t.yOffset,t.needsCopy=!0,Wt(t.xOffset>=0&&t.xOffset=0&&t.yOffset0&&t.width<=o&&t.height>0&&t.height<=a,"copy texture read out of bounds")}else if(r){if(Lt(r))t.channels=t.channels||4,t.data=r,"type"in e||t.type!==pn||(t.type=it(r));else if(K(r))t.channels=t.channels||4,ot(t,r),t.alignment=1,t.needsFree=!0;else if(I(r)){var s=r.data;Array.isArray(s)||t.type!==pn||(t.type=it(s));var l,c,h,f,d,p,m=r.shape,v=r.stride;3===m.length?(h=m[2],p=v[2]):(Wt(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),l=m[0],c=m[1],f=v[0],d=v[1],t.alignment=1,t.width=l,t.height=c,t.channels=h,t.format=t.internalformat=Hn[h],t.needsFree=!0,lt(t,s,f,d,p,r.offset)}else if(Q(r)||tt(r))Q(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(et(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(nt(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(J(r)){var g=t.width||r[0].length,y=t.height||r.length,x=t.channels;x=X(r[0][0])?x||r[0][0].length:x||1;for(var b=le.shape(r),_=1,w=0;w=0,"oes_texture_float extension not enabled"):t.type===tn&&Wt(n.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,n,i){var o=e.element,a=e.data,s=e.internalformat,l=e.format,u=e.type,h=e.width,f=e.height;c(e),o?t.texImage2D(n,i,l,l,u,o):e.compressed?t.compressedTexImage2D(n,i,s,h,f,0,a):e.needsCopy?(r(),t.copyTexImage2D(n,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(n,i,l,h,f,0,l,u,a)}function p(e,n,i,o,a){var s=e.element,l=e.data,u=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;c(e),s?t.texSubImage2D(n,a,i,o,h,f,s):e.compressed?t.compressedTexSubImage2D(n,a,i,o,u,d,p,l):e.needsCopy?(r(),t.copyTexSubImage2D(n,a,i,o,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(n,a,i,o,d,p,h,f,l)}function m(){return Y.pop()||new h}function v(t){t.needsFree&&se.freeType(t.data),h.call(t),Y.push(t)}function g(){s.call(this),this.genMipmaps=!1,this.mipmapHint=In,this.mipmask=0,this.images=Array(16)}function y(t,e,n){var r=t.images[0]=m();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function x(t,e){var n=null;if(rt(e))l(n=t.images[0]=m(),t),f(n,e),t.mipmask=1;else if(u(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i>=i,n.height>>=i,f(n,r[i]),t.mipmask|=1<=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;Wt.parameter(i,O),t.magFilter=O[i]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(Wt.parameter(s,P),o=a=P[s]):Array.isArray(s)&&(Wt.parameter(s[0],P),Wt.parameter(s[1],P),o=P[s[0]],a=P[s[1]])}else{if("wrapS"in e){var l=e.wrapS;Wt.parameter(l,P),o=P[l]}if("wrapT"in e){var u=e.wrapT;Wt.parameter(u,P),a=P[u]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var c=e.anisotropic;Wt("number"==typeof c&&c>=1&&c<=n.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var h=!1;switch(typeof e.mipmap){case"string":Wt.parameter(e.mipmap,L,"invalid mipmap hint"),t.mipmapHint=L[e.mipmap],t.genMipmaps=!0,h=!0;break;case"boolean":h=t.genMipmaps=e.mipmap;break;case"object":Wt(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,h=!0;break;default:Wt.raise("invalid mipmap type")}!h||"min"in e||(t.minFilter=Sn)}}function T(n,r){t.texParameteri(r,kn,n.minFilter),t.texParameteri(r,Mn,n.magFilter),t.texParameteri(r,yn,n.wrapS),t.texParameteri(r,xn,n.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(r,zn,n.anisotropic),n.genMipmaps&&(t.hint(Pn,n.mipmapHint),t.generateMipmap(r))}function A(e){s.call(this),this.mipmask=0,this.internalformat=Re,this.id=$++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,a.profile&&(this.stats={size:0})}function S(e){t.activeTexture(Un),t.bindTexture(e.target,e.texture)}function E(){var e=ft[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(ze,null)}function C(e){var n=e.texture;Wt(n,"must not double destroy texture");var r=e.unit,i=e.target;r>=0&&(t.activeTexture(Un+r),t.bindTexture(i,null),ft[r]=null),t.deleteTexture(n),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete ct[e.id],o.textureCount--}var L={"don't care":In,"dont care":In,nice:Dn,fast:On},P={repeat:bn,clamp:_n,mirror:wn},O={nearest:Tn,linear:An},D=Pt({mipmap:Ln,"nearest mipmap nearest":Sn,"linear mipmap nearest":En,"nearest mipmap linear":Cn,"linear mipmap linear":Ln},O),z={none:0,browser:Bn},j={uint8:pn,rgba4:Ge,rgb565:Xe,"rgb5 a1":Ye},N={alpha:Fe,luminance:Ue,"luminance alpha":Ve,rgb:Be,rgba:Re,rgba4:He,"rgb5 a1":qe,rgb565:We},R={};e.ext_srgb&&(N.srgb=$e,N.srgba=Qe),e.oes_texture_float&&(j.float32=j.float=gn),e.oes_texture_half_float&&(j.float16=j["half float"]=tn),e.webgl_depth_texture&&(Pt(N,{depth:Ke,"depth stencil":Je}),Pt(j,{uint16:mn,uint32:vn,"depth stencil":Ze})),e.webgl_compressed_texture_s3tc&&Pt(R,{"rgb s3tc dxt1":en,"rgba s3tc dxt1":nn,"rgba s3tc dxt3":rn,"rgba s3tc dxt5":on}),e.webgl_compressed_texture_atc&&Pt(R,{"rgb atc":an,"rgba atc explicit alpha":sn,"rgba atc interpolated alpha":ln}),e.webgl_compressed_texture_pvrtc&&Pt(R,{"rgb pvrtc 4bppv1":un,"rgb pvrtc 2bppv1":cn,"rgba pvrtc 4bppv1":hn,"rgba pvrtc 2bppv1":fn}),e.webgl_compressed_texture_etc1&&(R["rgb etc1"]=dn);var F=Array.prototype.slice.call(t.getParameter(De));Object.keys(R).forEach(function(t){var e=R[t];F.indexOf(e)>=0&&(N[t]=e)});var B=Object.keys(N);n.textureFormats=B;var U=[];Object.keys(N).forEach(function(t){var e=N[t];U[e]=t});var V=[];Object.keys(j).forEach(function(t){var e=j[t];V[e]=t});var H=[];Object.keys(O).forEach(function(t){var e=O[t];H[e]=t});var q=[];Object.keys(D).forEach(function(t){var e=D[t];q[e]=t});var W=[];Object.keys(P).forEach(function(t){var e=P[t];W[e]=t});var G=B.reduce(function(t,e){var n=N[e];return n===Ue||n===Fe||n===Ue||n===Ve||n===Ke||n===Je?t[n]=n:n===qe||e.indexOf("rgba")>=0?t[n]=Re:t[n]=Be,t},{}),Y=[],Z=[],$=0,ct={},ht=n.maxTextureUnits,ft=Array(ht).map(function(){return null});return Pt(A.prototype,{bind:function(){var e=this;e.bindCount+=1;var n=e.unit;if(n<0){for(var r=0;r0)continue;i.unit=-1}ft[r]=e,n=r;break}n>=ht&&Wt.raise("insufficient number of texture units"),a.profile&&o.maxTextureUnits>u)-o,c.height=c.height||(s.height>>u)-a,Wt(s.type===c.type&&s.format===c.format&&s.internalformat===c.internalformat,"incompatible format for texture.subimage"),Wt(o>=0&&a>=0&&o+c.width<=s.width&&a+c.height<=s.height,"texture.subimage write out of bounds"),Wt(s.mipmask&1<>l;++l)t.texImage2D(ze,l,s.format,r>>l,o>>l,0,s.format,s.type,null);return E(),a.profile&&(s.stats.size=ut(s.internalformat,s.type,r,o,!1,!1)),i},i._reglType="texture2d",i._texture=s,a.profile&&(i.stats=s.stats),i.destroy=function(){s.decRef()},i},createCube:function(e,r,i,s,c,h){function d(t,e,r,i,o,s){var c,h=g.texInfo;for(M.call(h),c=0;c<6;++c)C[c]=_();if("number"!=typeof t&&t)if("object"==typeof t)if(e)x(C[0],t),x(C[1],e),x(C[2],r),x(C[3],i),x(C[4],o),x(C[5],s);else if(k(h,t),u(g,t),"faces"in t){var f=t.faces;for(Wt(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),c=0;c<6;++c)Wt("object"==typeof f[c]&&!!f[c],"invalid input for cube map face"),l(C[c],g),x(C[c],f[c])}else for(c=0;c<6;++c)x(C[c],t);else Wt.raise("invalid arguments to cube map");else{var p=0|t||1;for(c=0;c<6;++c)y(C[c],p,p)}for(l(g,C[0]),h.genMipmaps?g.mipmask=(C[0].width<<1)-1:g.mipmask=C[0].mipmask,Wt.textureCube(g,h,C,n),g.internalformat=C[0].internalformat,d.width=C[0].width,d.height=C[0].height,S(g),c=0;c<6;++c)b(C[c],Ne+c);for(T(h,je),E(),a.profile&&(g.stats.size=ut(g.internalformat,g.type,d.width,d.height,h.genMipmaps,!0)),d.format=U[g.internalformat],d.type=V[g.type],d.mag=H[h.magFilter],d.min=q[h.minFilter],d.wrapS=W[h.wrapS],d.wrapT=W[h.wrapT],c=0;c<6;++c)w(C[c]);return d}var g=new A(je);ct[g.id]=g,o.cubeCount++;var C=new Array(6);return d(e,r,i,s,c,h),d.subimage=function(t,e,n,r,i){Wt(!!e,"must specify image data"),Wt("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=m();return l(u,g),u.width=0,u.height=0,f(u,e),u.width=u.width||(g.width>>s)-o,u.height=u.height||(g.height>>s)-a,Wt(g.type===u.type&&g.format===u.format&&g.internalformat===u.internalformat,"incompatible format for texture.subimage"),Wt(o>=0&&a>=0&&o+u.width<=g.width&&a+u.height<=g.height,"texture.subimage write out of bounds"),Wt(g.mipmask&1<>i;++i)t.texImage2D(Ne+r,i,g.format,n>>i,n>>i,0,g.format,g.type,null);return E(),a.profile&&(g.stats.size=ut(g.internalformat,g.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=g,a.profile&&(d.stats=g.stats),d.destroy=function(){g.decRef()},d},clear:function(){for(var e=0;e>n,e.height>>n,0,e.internalformat,e.type,null);else for(var r=0;r<6;++r)t.texImage2D(Ne+r,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);T(e.texInfo,e.target)})}}}function ht(t,e,n){return tr[t]*e*n}function ft(t,e,n,r,i,o){function a(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);Wt(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;Wt(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function u(e,n){n&&(n.texture?t.framebufferTexture2D(nr,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(nr,e,rr,n.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=ir,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),Wt.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,Wt(e===ir)):"textureCube"===o?(n=i,Wt(e>=or&&e=2,"invalid shape for framebuffer"),u=I[0],d=I[1]}else"radius"in P&&(u=d=P.radius),"width"in P&&(u=P.width),"height"in P&&(d=P.height);("color"in P||"colors"in P)&&(y=P.color||P.colors,Array.isArray(y)&&Wt(1===y.length||s,"multiple render targets not supported")),y||("colorCount"in P&&(A=0|P.colorCount,Wt(A>0,"invalid color buffer count")),"colorTexture"in P&&(M=!!P.colorTexture,k="rgba4"),"colorType"in P&&(T=P.colorType,M?(Wt(e.oes_texture_float||!("float"===T||"float32"===T),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Wt(e.oes_texture_half_float||!("half float"===T||"float16"===T),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===T||"float16"===T?(Wt(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),k="rgba16f"):"float"!==T&&"float32"!==T||(Wt(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),k="rgba32f"),Wt.oneOf(T,w,"invalid color type")),"colorFormat"in P&&(k=P.colorFormat,b.indexOf(k)>=0?M=!0:_.indexOf(k)>=0?M=!1:M?Wt.oneOf(P.colorFormat,b,"invalid color format for texture"):Wt.oneOf(P.colorFormat,_,"invalid color format for renderbuffer"))),("depthTexture"in P||"depthStencilTexture"in P)&&(L=!(!P.depthTexture&&!P.depthStencilTexture),Wt(!L||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in P&&("boolean"==typeof P.depth?p=P.depth:(S=P.depth,v=!1)),"stencil"in P&&("boolean"==typeof P.stencil?v=P.stencil:(E=P.stencil,p=!1)),"depthStencil"in P&&("boolean"==typeof P.depthStencil?p=v=P.depthStencil:(C=P.depthStencil,p=!1,v=!1))}else u=d=1;var O=null,D=null,z=null,j=null;if(Array.isArray(y))O=y.map(c);else if(y)O=[c(y)];else for(O=new Array(A),o=0;o=0||O[o].renderbuffer&&yr.indexOf(O[o].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+o+" is invalid"),O[o]&&O[o].texture){var R=dr[O[o].texture._texture.format]*pr[O[o].texture._texture.type];null===N?N=R:Wt(N===R,"all color attachments much have the same number of bits per pixel.")}return l(D,u,d),Wt(!D||D.texture&&D.texture._texture.format===hr||D.renderbuffer&&D.renderbuffer._renderbuffer.format===mr,"invalid depth attachment for framebuffer object"),l(z,u,d),Wt(!z||z.renderbuffer&&z.renderbuffer._renderbuffer.format===vr,"invalid stencil attachment for framebuffer object"),l(j,u,d),Wt(!j||j.texture&&j.texture._texture.format===gr||j.renderbuffer&&j.renderbuffer._renderbuffer.format===gr,"invalid depth-stencil attachment for framebuffer object"),m(a),a.width=u,a.height=d,a.colorAttachments=O,a.depthAttachment=D,a.stencilAttachment=z,a.depthStencilAttachment=j,i.color=O.map(f),i.depth=f(D),i.stencil=f(z),i.depthStencil=f(j),i.width=a.width,i.height=a.height,g(a),i}var a=new p;return o.framebufferCount++,i(t,r),Pt(i,{resize:function(t,e){Wt(x.next!==a,"can not resize a framebuffer which is currently in use");var n=0|t,r=0|e||n;if(n===a.width&&r===a.height)return i;for(var o=a.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),Wt(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&Wt(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(u=d.color||d.colors,Array.isArray(u)&&Wt(1===u.length||a,"multiple render targets not supported")),u||("colorCount"in d&&(f=0|d.colorCount,Wt(f>0,"invalid color buffer count")),"colorType"in d&&(Wt.oneOf(d.colorType,w,"invalid color type"),h=d.colorType),"colorFormat"in d&&(c=d.colorFormat,Wt.oneOf(d.colorFormat,b,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(u)if(Array.isArray(u))for(m=[],n=0;n0&&(s.depth=o[0].depth,s.stencil=o[0].stencil,s.depthStencil=o[0].depthStencil),o[n]?o[n](s):o[n]=y(s)}return Pt(i,{width:l,height:l,color:m})}var o=Array(6);return i(t),Pt(i,{faces:o,resize:function(t){var e,r=0|t;if(Wt(r>0&&r<=n.maxCubeMapSize,"invalid radius for cube fbo"),r===i.width)return i;var a=i.color;for(e=0;e1)for(var m=0;mt&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);$t(u).forEach(e),u={},$t(c).forEach(e),c={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,h={},n.shaderCount=0},program:function(t,e,r){Wt.command(t>=0,"missing vertex shader",r),Wt.command(e>=0,"missing fragment shader",r);var i=h[e];i||(i=h[e]={});var o=i[t];return o||(o=new s(e,t),n.shaderCount++,l(o,r),i[t]=o,f.push(o)),o},restore:function(){u={},c={};for(var t=0;t=0&&l=0&&u0&&c+l<=r.framebufferWidth,"invalid width for read pixels"),Wt(h>0&&h+u<=r.framebufferHeight,"invalid height for read pixels"),n();var d=c*h*4;return f||(s===Ar?f=new Uint8Array(d):s===Er&&(f=f||new Float32Array(d))),Wt.isTypedArray(f,"data buffer for regl.read() must be a typedarray"),Wt(f.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(Sr,4),t.readPixels(l,u,c,h,Tr,s,f),f}function s(t){var n;return e.setFBO({framebuffer:t.framebuffer},function(){n=a(t)}),n}return function(t){return t&&"framebuffer"in t?s(t):a(t)}}function gt(t){return Array.prototype.slice.call(t)}function yt(t){return gt(t).join("")}function xt(){function t(){var t=[],e=[];return Pt(function(){t.push.apply(t,gt(arguments))},{def:function(){var r="v"+n++;return e.push(r),arguments.length>0&&(t.push(r,"="),t.push.apply(t,gt(arguments)),t.push(";")),r},toString:function(){return yt([e.length>0?"var "+e+";":"",yt(t)])}})}function e(){function e(t,e){r(t,e,"=",n.def(t,e),";")}var n=t(),r=t(),i=n.toString,o=r.toString;return Pt(function(){n.apply(n,gt(arguments))},{def:n.def,entry:n,exit:r,save:e,set:function(t,r,i){e(t,r),n(t,r,"=",i,";")},toString:function(){return i()+o()}})}var n=0,r=[],i=[],o=t(),a={};return{global:o,link:function(t){for(var e=0;e=1,r>=2,e)}if(n===Nr){var i=t.data;return new wt(i.thisDep,i.contextDep,i.propDep,e)}return new wt(n===jr,n===zr,n===Dr,e)}function At(t,e,n,r,i,o,a,s,l,u,c,h,f,d,p){function m(t){return t.replace(".","_")}function v(t,e,n){var r=m(t);et.push(t),tt[r]=Q[r]=!!n,nt[r]=e}function g(t,e,n){var r=m(t);et.push(t),Array.isArray(n)?(Q[r]=n.slice(),tt[r]=n.slice()):Q[r]=tt[r]=n,rt[r]=e}function y(){var t=xt(),n=t.link,r=t.global;t.id=at++,t.batchId="0";var i=n(it),o=t.shared={props:"a0"};Object.keys(it).forEach(function(t){o[t]=r.def(i,".",t)}),Wt.optional(function(){t.CHECK=n(Wt),t.commandStr=Wt.guessCommand(),t.command=n(t.commandStr),t.assert=function(t,e,r){t("if(!(",e,"))",this.CHECK,".commandRaise(",n(r),",",this.command,");")},ot.invalidBlendCombinations=bo});var a=t.next={},s=t.current={};Object.keys(rt).forEach(function(t){Array.isArray(Q[t])&&(a[t]=r.def(o.next,".",t),s[t]=r.def(o.current,".",t))});var l=t.constants={};Object.keys(ot).forEach(function(t){l[t]=r.def(JSON.stringify(ot[t]))}),t.invoke=function(e,r){switch(r.type){case Or:var i=["this",o.context,o.props,t.batchId];return e.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case Dr:return e.def(o.props,r.data);case zr:return e.def(o.context,r.data);case jr:return e.def("this",r.data);case Nr:return r.data.append(t,e),r.data.ref}},t.attribCache={};var c={};return t.scopeAttrib=function(t){var r=e.id(t);if(r in c)return c[r];var i=u.scope[r];return i||(i=u.scope[r]=new Z),c[r]=n(i)},t}function x(t){var e,n=t.static,r=t.dynamic;if(hi in n){var i=!!n[hi];(e=kt(function(t,e){return i})).enable=i}else if(hi in r){var o=r[hi];e=Tt(o,function(t,e){return t.invoke(e,o)})}return e}function b(t,e){var n=t.static,r=t.dynamic;if(fi in n){var i=n[fi];return i?(i=s.getFramebuffer(i),Wt.command(i,"invalid framebuffer object"),kt(function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+bi,n+".width"),e.set(o,"."+_i,n+".height"),n})):kt(function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+bi,r+"."+ki),e.set(r,"."+_i,r+"."+Ti),"null"})}if(fi in r){var o=r[fi];return Tt(o,function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");Wt.optional(function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")}),e.set(i,".next",a);var s=r.context;return e.set(s,"."+bi,a+"?"+a+".width:"+s+"."+ki),e.set(s,"."+_i,a+"?"+a+".height:"+s+"."+Ti),a})}return null}function _(t,e,n){function r(t){if(t in i){var r=i[t];Wt.commandType(r,"object","invalid "+t,n.commandStr);var a,s,l=!0,u=0|r.x,c=0|r.y;return"width"in r?(a=0|r.width,Wt.command(a>=0,"invalid "+t,n.commandStr)):l=!1,"height"in r?(s=0|r.height,Wt.command(s>=0,"invalid "+t,n.commandStr)):l=!1,new wt(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var n=t.shared.context,i=a;"width"in r||(i=e.def(n,".",bi,"-",u));var o=s;return"height"in r||(o=e.def(n,".",_i,"-",c)),[u,c,i,o]})}if(t in o){var h=o[t],f=Tt(h,function(e,n){var r=e.invoke(n,h);Wt.optional(function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)});var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",bi,"-",o,")"),l=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",_i,"-",a,")");return Wt.optional(function(){e.assert(n,s+">=0&&"+l+">=0","invalid "+t)}),[o,a,s,l]});return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new wt(e.thisDep,e.contextDep,e.propDep,function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",bi),e.def(n,".",_i)]}):null}var i=t.static,o=t.dynamic,a=r(ci);if(a){var s=a;a=new wt(a.thisDep,a.contextDep,a.propDep,function(t,e){var n=s.append(t,e),r=t.shared.context;return e.set(r,"."+wi,n[2]),e.set(r,"."+Mi,n[3]),n})}return{viewport:a,scissor_box:r(ui)}}function w(t){function n(t){if(t in i){var n=e.id(i[t]);Wt.optional(function(){c.shader(Mo[t],n,Wt.guessCommand())});var r=kt(function(){return n});return r.id=n,r}if(t in o){var a=o[t];return Tt(a,function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return Wt.optional(function(){n(e.shared.shader,".shader(",Mo[t],",",i,",",e.command,");")}),i})}return null}var r,i=t.static,o=t.dynamic,a=n(pi),s=n(di),l=null;return Mt(a)&&Mt(s)?(l=c.program(s.id,a.id),r=kt(function(t,e){return t.link(l)})):r=new wt(a&&a.thisDep||s&&s.thisDep,a&&a.contextDep||s&&s.contextDep,a&&a.propDep||s&&s.propDep,function(t,e){var n,r=t.shared.shader;n=a?a.append(t,e):e.def(r,".",pi);var i,o=r+".program("+(i=s?s.append(t,e):e.def(r,".",di))+","+n;return Wt.optional(function(){o+=","+t.command}),e.def(o+")")}),{frag:a,vert:s,progVar:r,program:l}}function M(t,e){function n(t,n){if(t in r){var o=0|r[t];return Wt.command(!n||o>=0,"invalid "+t,e.commandStr),kt(function(t,e){return n&&(t.OFFSET=o),o})}if(t in i){var s=i[t];return Tt(s,function(e,r){var i=e.invoke(r,s);return n&&(e.OFFSET=i,Wt.optional(function(){e.assert(r,i+">=0","invalid "+t)})),i})}return n&&a?kt(function(t,e){return t.OFFSET="0",0}):null}var r=t.static,i=t.dynamic,a=function(){if(mi in r){var t=r[mi];bt(t)?t=o.getElements(o.create(t,!0)):t&&(t=o.getElements(t),Wt.command(t,"invalid elements",e.commandStr));var n=kt(function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null});return n.value=t,n}if(mi in i){var a=i[mi];return Tt(a,function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,o=t.invoke(e,a),s=e.def("null"),l=e.def(r,"(",o,")"),u=t.cond(l).then(s,"=",i,".createStream(",o,");").else(s,"=",i,".getElements(",o,");");return Wt.optional(function(){t.assert(u.else,"!"+o+"||"+s,"invalid elements")}),e.entry(u),e.exit(t.cond(l).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}(),s=n(yi,!0);return{elements:a,primitive:function(){if(vi in r){var t=r[vi];return Wt.commandParameter(t,ye,"invalid primitve",e.commandStr),kt(function(e,n){return ye[t]})}if(vi in i){var n=i[vi];return Tt(n,function(t,e){var r=t.constants.primTypes,i=t.invoke(e,n);return Wt.optional(function(){t.assert(e,i+" in "+r,"invalid primitive, must be one of "+Object.keys(ye))}),e.def(r,"[",i,"]")})}return a?Mt(a)?kt(a.value?function(t,e){return e.def(t.ELEMENTS,".primType")}:function(){return ro}):new wt(a.thisDep,a.contextDep,a.propDep,function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",ro)}):null}(),count:function(){if(gi in r){var t=0|r[gi];return Wt.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),kt(function(){return t})}if(gi in i){var n=i[gi];return Tt(n,function(t,e){var r=t.invoke(e,n);return Wt.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">=0&&"+r+"===("+r+"|0)","invalid vertex count")}),r})}if(a){if(Mt(a)){if(a)return s?new wt(s.thisDep,s.contextDep,s.propDep,function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return Wt.optional(function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")}),n}):kt(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var o=kt(function(){return-1});return Wt.optional(function(){o.MISSING=!0}),o}var l=new wt(a.thisDep||s.thisDep,a.contextDep||s.contextDep,a.propDep||s.propDep,function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")});return Wt.optional(function(){l.DYNAMIC=!0}),l}return null}(),instances:n(xi,!1),offset:s}}function k(t,e){var n=t.static,i=t.dynamic,o={};return et.forEach(function(t){function a(e,r){if(t in n){var a=e(n[t]);o[s]=kt(function(){return a})}else if(t in i){var l=i[t];o[s]=Tt(l,function(t,e){return r(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case Xr:case Fr:case Rr:case ri:case Hr:case li:case $r:case ti:case ei:case Gr:return a(function(n){return Wt.commandType(n,"boolean",t,e.commandStr),n},function(e,n,r){return Wt.optional(function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)}),r});case qr:return a(function(n){return Wt.commandParameter(n,_o,"invalid "+t,e.commandStr),_o[n]},function(e,n,r){var i=e.constants.compareFuncs;return Wt.optional(function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(_o))}),n.def(i,"[",r,"]")});case Wr:return a(function(t){return Wt.command(X(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,n){return Wt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")}),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]});case Vr:return a(function(t){Wt.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return Wt.commandParameter(n,xo,s+".srcRGB",e.commandStr),Wt.commandParameter(r,xo,s+".srcAlpha",e.commandStr),Wt.commandParameter(i,xo,s+".dstRGB",e.commandStr),Wt.commandParameter(o,xo,s+".dstAlpha",e.commandStr),Wt.command(-1===bo.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[xo[n],xo[i],xo[r],xo[o]]},function(e,n,r){function i(i,a){var s=n.def('"',i,a,'" in ',r,"?",r,".",i,a,":",r,".",i);return Wt.optional(function(){e.assert(n,s+" in "+o,"invalid "+t+"."+i+a+", must be one of "+Object.keys(xo))}),s}var o=e.constants.blendFuncs;Wt.optional(function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")});var a=i("src","RGB"),s=i("dst","RGB");Wt.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var l=n.def(o,"[",a,"]"),u=n.def(o,"[",i("src","Alpha"),"]");return[l,n.def(o,"[",s,"]"),u,n.def(o,"[",i("dst","Alpha"),"]")]});case Ur:return a(function(n){return"string"==typeof n?(Wt.commandParameter(n,K,"invalid "+t,e.commandStr),[K[n],K[n]]):"object"==typeof n?(Wt.commandParameter(n.rgb,K,t+".rgb",e.commandStr),Wt.commandParameter(n.alpha,K,t+".alpha",e.commandStr),[K[n.rgb],K[n.alpha]]):void Wt.commandRaise("invalid blend.equation",e.commandStr)},function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),s=e.cond("typeof ",r,'==="string"');return Wt.optional(function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(K))}n(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")}),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]});case Br:return a(function(t){return Wt.command(X(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),O(4,function(e){return+t[e]})},function(t,e,n){return Wt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")}),O(4,function(t){return e.def("+",n,"[",t,"]")})});case ii:return a(function(t){return Wt.commandType(t,"number",s,e.commandStr),0|t},function(t,e,n){return Wt.optional(function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")}),e.def(n,"|0")});case oi:return a(function(n){Wt.commandType(n,"object",s,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return Wt.commandParameter(r,_o,t+".cmp",e.commandStr),Wt.commandType(i,"number",t+".ref",e.commandStr),Wt.commandType(o,"number",t+".mask",e.commandStr),[_o[r],i,o]},function(t,e,n){var r=t.constants.compareFuncs;return Wt.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")}),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",ho),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]});case ai:case si:return a(function(n){Wt.commandType(n,"object",s,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return Wt.commandParameter(r,wo,t+".fail",e.commandStr),Wt.commandParameter(i,wo,t+".zfail",e.commandStr),Wt.commandParameter(o,wo,t+".zpass",e.commandStr),[t===si?oo:io,wo[r],wo[i],wo[o]]},function(e,n,r){function i(i){return Wt.optional(function(){e.assert(n,'!("'+i+'" in '+r+")||("+r+"."+i+" in "+o+")","invalid "+t+"."+i+", must be one of "+Object.keys(wo))}),n.def('"',i,'" in ',r,"?",o,"[",r,".",i,"]:",ho)}var o=e.constants.stencilOps;return Wt.optional(function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}),[t===si?oo:io,i("fail"),i("zfail"),i("zpass")]});case Qr:return a(function(t){Wt.commandType(t,"object",s,e.commandStr);var n=0|t.factor,r=0|t.units;return Wt.commandType(n,"number",s+".factor",e.commandStr),Wt.commandType(r,"number",s+".units",e.commandStr),[n,r]},function(e,n,r){return Wt.optional(function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}),[n.def(r,".factor|0"),n.def(r,".units|0")]});case Zr:return a(function(t){var n=0;return"front"===t?n=io:"back"===t&&(n=oo),Wt.command(!!n,s,e.commandStr),n},function(t,e,n){return Wt.optional(function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")}),e.def(n,'==="front"?',io,":",oo)});case Jr:return a(function(t){return Wt.command("number"==typeof t&&t>=r.lineWidthDims[0]&&t<=r.lineWidthDims[1],"invalid line width, must positive number between "+r.lineWidthDims[0]+" and "+r.lineWidthDims[1],e.commandStr),t},function(t,e,n){return Wt.optional(function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+r.lineWidthDims[0]+"&&"+n+"<="+r.lineWidthDims[1],"invalid line width")}),n});case Kr:return a(function(t){return Wt.commandParameter(t,ko,s,e.commandStr),ko[t]},function(t,e,n){return Wt.optional(function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(n+'==="cw"?'+ao+":"+so)});case Yr:return a(function(t){return Wt.command(X(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,n){return Wt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")}),O(4,function(t){return"!!"+n+"["+t+"]"})});case ni:return a(function(t){Wt.command("object"==typeof t&&t,s,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return Wt.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]},function(t,e,n){return Wt.optional(function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]})}}),o}function T(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach(function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=kt(function(){return o});else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=kt(function(t){return t.link(o)}):"framebuffer"===a||"framebufferCube"===a?(Wt.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=kt(function(t){return t.link(o.color[0])})):Wt.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else X(o)?r=kt(function(e){return e.global.def("[",O(o.length,function(n){return Wt.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]}),"]")}):Wt.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r}),Object.keys(r).forEach(function(t){var e=r[t];i[t]=Tt(e,function(t,n){return t.invoke(n,e)})}),i}function A(t,n){var r=t.static,o=t.dynamic,a={};return Object.keys(r).forEach(function(t){var o=r[t],s=e.id(t),l=new Z;if(bt(o))l.state=Pr,l.buffer=i.getBuffer(i.create(o,Si,!1,!0)),l.type=0;else{var u=i.getBuffer(o);if(u)l.state=Pr,l.buffer=u,l.type=0;else if(Wt.command("object"==typeof o&&o,"invalid data for attribute "+t,n.commandStr),o.constant){var c=o.constant;l.buffer="null",l.state=Ir,"number"==typeof c?l.x=c:(Wt.command(X(c)&&c.length>0&&c.length<=4,"invalid constant for attribute "+t,n.commandStr),Cr.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',n.commandStr);var f=0|o.stride;Wt.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',n.commandStr);var d=0|o.size;Wt.command(!("size"in o)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',n.commandStr);var p=!!o.normalized,m=0;"type"in o&&(Wt.commandParameter(o.type,ue,"invalid type for attribute "+t,n.commandStr),m=ue[o.type]);var v=0|o.divisor;"divisor"in o&&(Wt.command(0===v||J,'cannot specify divisor for attribute "'+t+'", instancing not supported',n.commandStr),Wt.command(v>=0,'invalid divisor for attribute "'+t+'"',n.commandStr)),Wt.optional(function(){var e=n.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(o).forEach(function(n){Wt.command(r.indexOf(n)>=0,'unknown parameter "'+n+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",e)})}),l.buffer=u,l.state=Pr,l.size=d,l.normalized=p,l.type=m||u.dtype,l.offset=h,l.stride=f,l.divisor=v}}a[t]=kt(function(t,e){var n=t.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(l).forEach(function(t){r[t]=l[t]}),l.buffer&&(r.buffer=t.link(l.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r})}),Object.keys(o).forEach(function(t){var e=o[t];a[t]=Tt(e,function(n,r){function i(t){r(u[t],"=",o,".",t,"|0;")}var o=n.invoke(r,e),a=n.shared,s=a.isBufferArgs,l=a.buffer;Wt.optional(function(){n.assert(r,o+"&&(typeof "+o+'==="object"||typeof '+o+'==="function")&&('+s+"("+o+")||"+l+".getBuffer("+o+")||"+l+".getBuffer("+o+".buffer)||"+s+"("+o+'.buffer)||("constant" in '+o+"&&(typeof "+o+'.constant==="number"||'+a.isArrayLike+"("+o+".constant))))",'invalid dynamic attribute "'+t+'"')});var u={isStream:r.def(!1)},c=new Z;c.state=Pr,Object.keys(c).forEach(function(t){u[t]=r.def(""+c[t])});var h=u.buffer,f=u.type;return r("if(",s,"(",o,")){",u.isStream,"=true;",h,"=",l,".createStream(",Si,",",o,");",f,"=",h,".dtype;","}else{",h,"=",l,".getBuffer(",o,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',o,"){",u.state,"=",Ir,";","if(typeof "+o+'.constant === "number"){',u[Cr[0]],"=",o,".constant;",Cr.slice(1).map(function(t){return u[t]}).join("="),"=0;","}else{",Cr.map(function(t,e){return u[t]+"="+o+".constant.length>="+e+"?"+o+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",o,".buffer)){",h,"=",l,".createStream(",Si,",",o,".buffer);","}else{",h,"=",l,".getBuffer(",o,".buffer);","}",f,'="type" in ',o,"?",a.glTypes,"[",o,".type]:",h,".dtype;",u.normalized,"=!!",o,".normalized;"),i("size"),i("offset"),i("stride"),i("divisor"),r("}}"),r.exit("if(",u.isStream,"){",l,".destroyStream(",h,");","}"),u})}),a}function S(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach(function(t){var n=e[t];r[t]=kt(function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)})}),Object.keys(n).forEach(function(t){var e=n[t];r[t]=Tt(e,function(t,n){return t.invoke(n,e)})}),r}function E(t,e,n,r,i){function o(t){var e=u[t];e&&(h[t]=e)}var a=t.static,s=t.dynamic;Wt.optional(function(){function t(t){Object.keys(t).forEach(function(t){Wt.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',i.commandStr)})}var e=[fi,di,pi,mi,vi,yi,gi,xi,hi].concat(et);t(a),t(s)});var l=b(t,i),u=_(t,l,i),c=M(t,i),h=k(t,i),f=w(t,i);o(ci),o(m(ui));var d=Object.keys(h).length>0,p={framebuffer:l,draw:c,shader:f,state:h,dirty:d};return p.profile=x(t,i),p.uniforms=T(n,i),p.attributes=A(e,i),p.context=S(r,i),p}function C(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach(function(o){e.save(r,"."+o);var a=n[o];i(r,".",o,"=",a.append(t,e),";")}),e(i)}function L(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;$&&(i=e.def(o.extensions,".webgl_draw_buffers"));var l,u=t.constants,c=u.drawBuffer,h=u.backBuffer;l=n?n.append(t,e):e.def(s,".next"),r||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",a,".bindFramebuffer(",go,",",l,".framebuffer);"),$&&e(i,".drawBuffersWEBGL(",c,"[",l,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",go,",null);"),$&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),r||e("}")}function P(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,l=r.next,u=t.cond(s,".dirty");et.forEach(function(e){var r=m(e);if(!(r in n.state)){var c,h;if(r in a){c=a[r],h=o[r];var f=O(Q[r].length,function(t){return u.def(c,"[",t,"]")});u(t.cond(f.map(function(t,e){return t+"!=="+h+"["+e+"]"}).join("||")).then(i,".",rt[r],"(",f,");",f.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";"))}else{c=u.def(l,".",r);var d=t.cond(c,"!==",s,".",r);u(d),r in nt?d(t.cond(c).then(i,".enable(",nt[r],");").else(i,".disable(",nt[r],");"),s,".",r,"=",c,";"):d(i,".",rt[r],"(",c,");",s,".",r,"=",c,";")}}}),0===Object.keys(n.state).length&&u(s,".dirty=false;"),e(u)}function I(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;_t(Object.keys(n)).forEach(function(i){var l=n[i];if(!r||r(l)){var u=l.append(t,e);if(nt[i]){var c=nt[i];Mt(l)?u?e(s,".enable(",c,");"):e(s,".disable(",c,");"):e(t.cond(u).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(a,".",i,"=",u,";")}else if(X(u)){var h=o[i];e(s,".",rt[i],"(",u,");",u.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";")}else e(s,".",rt[i],"(",u,");",a,".",i,"=",u,";")}})}function D(t,e){J&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,n,r,i){function o(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function a(t){t(u=e.def(),"=",o(),";"),"string"==typeof i?t(p,".count+=",i,";"):t(p,".count++;"),d&&(r?t(c=e.def(),"=",v,".getNumPendingQueries();"):t(v,".beginQuery(",p,");"))}function s(t){t(p,".cpuTime+=",o(),"-",u,";"),d&&(r?t(v,".pushScopeStats(",c,",",v,".getNumPendingQueries(),",p,");"):t(v,".endQuery();"))}function l(t){var n=e.def(m,".profile");e(m,".profile=",t,";"),e.exit(m,".profile=",n,";")}var u,c,h,f=t.shared,p=t.stats,m=f.current,v=f.timer,g=n.profile;if(g){if(Mt(g))return void(g.enable?(a(e),s(e.exit),l("true")):l("false"));l(h=g.append(t,e))}else h=e.def(m,".profile");var y=t.block();a(y),e("if(",h,"){",y,"}");var x=t.block();s(x),e.exit("if(",h,"){",x,"}")}function j(t,e,n,r,i){function o(t){switch(t){case Ui:case Wi:case Zi:return 2;case Vi:case Gi:case Ki:return 3;case Hi:case Yi:case Ji:return 4;default:return 1}}function a(n,r,i){function o(){e("if(!",c,".buffer){",l,".enableVertexAttribArray(",u,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",c,".type!==",o,"||",c,".size!==",n,"||",p.map(function(t){return c+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",Si,",",f,".buffer);",l,".vertexAttribPointer(",[u,n,o,i.normalized,i.stride,i.offset],");",c,".type=",o,";",c,".size=",n,";",p.map(function(t){return c+"."+t+"="+i[t]+";"}).join(""),"}"),J){var a=i.divisor;e("if(",c,".divisor!==",a,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,a],");",c,".divisor=",a,";}")}}function a(){e("if(",c,".buffer){",l,".disableVertexAttribArray(",u,");","}if(",Cr.map(function(t,e){return c+"."+t+"!=="+d[e]}).join("||"),"){",l,".vertexAttrib4f(",u,",",d,");",Cr.map(function(t,e){return c+"."+t+"="+d[e]+";"}).join(""),"}")}var l=s.gl,u=e.def(n,".location"),c=e.def(s.attributes,"[",u,"]"),h=i.state,f=i.buffer,d=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];h===Pr?o():h===Ir?a():(e("if(",h,"===",Pr,"){"),o(),e("}else{"),a(),e("}"))}var s=t.shared;r.forEach(function(r){var s,l=r.name,u=n.attributes[l];if(u){if(!i(u))return;s=u.append(t,e)}else{if(!i(To))return;var c=t.scopeAttrib(l);Wt.optional(function(){t.assert(e,c+".state","missing attribute "+l)}),s={},Object.keys(new Z).forEach(function(t){s[t]=e.def(c,".",t)})}a(t.link(r),o(r.info.type),s)})}function N(t,n,r,i,o){for(var a,s=t.shared,l=s.gl,u=0;u1?O(b,function(t){return c+"["+t+"]"}):c);n(");")}}function R(t,e,n,r){function i(i){var o=c[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(u,".",i)}function o(){function t(){n(v,".drawElementsInstancedANGLE(",[f,p,g,d+"<<(("+g+"-"+Lr+")>>1)",m],");")}function e(){n(v,".drawArraysInstancedANGLE(",[f,d,p,m],");")}h?y?t():(n("if(",h,"){"),t(),n("}else{"),e(),n("}")):e()}function a(){function t(){n(l+".drawElements("+[f,p,g,d+"<<(("+g+"-"+Lr+")>>1)"]+");")}function e(){n(l+".drawArrays("+[f,d,p]+");")}h?y?t():(n("if(",h,"){"),t(),n("}else{"),e(),n("}")):e()}var s=t.shared,l=s.gl,u=s.draw,c=r.draw,h=function(){var i,o=c.elements,a=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(a=n),i=o.append(t,a)):i=a.def(u,".",mi),i&&a("if("+i+")"+l+".bindBuffer("+Ei+","+i+".buffer.buffer);"),i}(),f=i(vi),d=i(yi),p=function(){var i,o=c.count,a=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(a=n),i=o.append(t,a),Wt.optional(function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(a,i+">=0","missing vertex count")})):(i=a.def(u,".",gi),Wt.optional(function(){t.assert(a,i+">=0","missing vertex count")})),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");var m,v;J&&(m=i(xi),v=t.instancing);var g=h+".type",y=c.elements&&Mt(c.elements);J&&("number"!=typeof m||m>=0)?"string"==typeof m?(n("if(",m,">0){"),o(),n("}else if(",m,"<0){"),a(),n("}")):o():a()}function F(t,e,n,r,i){var o=y(),a=o.proc("body",i);return Wt.optional(function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)}),J&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function B(t,e,n,r){D(t,e),j(t,e,n,r.attributes,function(){return!0}),N(t,e,n,r.uniforms,function(){return!0}),R(t,e,e,n)}function U(t,e){var n=t.proc("draw",1);D(t,n),C(t,n,e.context),L(t,n,e.framebuffer),P(t,n,e),I(t,n,e.state),z(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)B(t,n,e,e.shader.program);else{var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link(function(n){return F(B,t,e,n,1)}),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}function V(t,e,n,r){function i(){return!0}t.batchId="a1",D(t,e),j(t,e,n,r.attributes,i),N(t,e,n,r.uniforms,i),R(t,e,e,n)}function H(t,e,n,r){function i(t){return t.contextDep&&a||t.propDep}function o(t){return!i(t)}D(t,e);var a=n.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();if(e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),n.needsContext&&C(t,c,n.context),n.needsFramebuffer&&L(t,c,n.framebuffer),I(t,c,n.state,i),n.profile&&i(n.profile)&&z(t,c,n,!1,!0),r)j(t,u,n,r.attributes,o),j(t,c,n,r.attributes,i),N(t,u,n,r.uniforms,o),N(t,c,n,r.uniforms,i),R(t,u,c,n);else{var h=t.global.def("{}"),f=n.shader.progVar.append(t,c),d=c.def(f,".id"),p=c.def(h,"[",d,"]");c(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link(function(e){return F(V,t,n,e,2)}),"(",f,");}",p,".call(this,a0[",s,"],",s,");")}}function q(t,e){function n(t){return t.contextDep&&i||t.propDep}var r=t.proc("batch",2);t.batchId="0",D(t,r);var i=!1,o=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(C(t,r,e.context),o=!1);var a=e.framebuffer,s=!1;a?(a.propDep?i=s=!0:a.contextDep&&i&&(s=!0),s||L(t,r,a)):L(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),P(t,r,e),I(t,r,e.state,function(t){return!n(t)}),e.profile&&n(e.profile)||z(t,r,e,!1,"a1"),e.contextDep=i,e.needsContext=o,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)H(t,r,e,null);else{var u=l.append(t,r);if(r(t.shared.gl,".useProgram(",u,".program);"),e.shader.program)H(t,r,e,e.shader.program);else{var c=t.global.def("{}"),h=r.def(u,".id"),f=r.def(c,"[",h,"]");r(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",c,"[",h,"]=",t.link(function(n){return F(H,t,e,n,2)}),"(",u,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}function W(t,n){function r(e){var r=n.shader[e];r&&i.set(o.shader,"."+e,r.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var o=t.shared,a=o.current;C(t,i,n.context),n.framebuffer&&n.framebuffer.append(t,i),_t(Object.keys(n.state)).forEach(function(e){var r=n.state[e].append(t,i);X(r)?r.forEach(function(n,r){i.set(t.next[e],"["+r+"]",n)}):i.set(o.next,"."+e,r)}),z(t,i,n,!0,!0),[mi,yi,gi,xi,vi].forEach(function(e){var r=n.draw[e];r&&i.set(o.draw,"."+e,""+r.append(t,i))}),Object.keys(n.uniforms).forEach(function(r){i.set(o.uniforms,"["+e.id(r)+"]",n.uniforms[r].append(t,i))}),Object.keys(n.attributes).forEach(function(e){var r=n.attributes[e].append(t,i),o=t.scopeAttrib(e);Object.keys(new Z).forEach(function(t){i.set(o,"."+t,r[t])})}),r(di),r(pi),Object.keys(n.state).length>0&&(i(a,".dirty=true;"),i.exit(a,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function G(t){if("object"==typeof t&&!X(t)){for(var e=Object.keys(t),n=0;n=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+r(n)+". must be a nonnegative integer")},oneOf:i,shaderError:function(t,e,r,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),l=i===t.FRAGMENT_SHADER?"fragment":"vertex";v(r,"string",l+" shader source must be a string",a);var u=h(r,a),c=f(s);d(u,c),Object.keys(u).forEach(function(t){function e(t,e){r.push(t),i.push(e||"")}var n=u[t];if(n.hasErrors){var r=[""],i=[""];e("file number "+t+": "+n.name+"\n","color:red;text-decoration:underline;font-weight:bold"),n.lines.forEach(function(t){if(t.errors.length>0){e(o(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var n=0;t.errors.forEach(function(r){var i=r.message,a=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(a){var s=a[1];switch(i=a[2],s){case"assign":s="="}n=Math.max(t.line.indexOf(s,n),0)}else n=0;e(o("| ",6)),e(o("^^^",n+3)+"\n","font-weight:bold"),e(o("| ",6)),e(i+"\n","font-weight:bold")}),e(o("| ",6)+"\n")}else e(o(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=r.join("%c"),console.log.apply(console,i)):console.log(r.join(""))}}),n.raise("Error compiling "+l+" shader, "+u[0].name)}},linkError:function(t,e,r,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),s=h(r,o),l='Error linking program with vertex shader, "'+h(i,o)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+l+"\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(l+"\n"+a),n.raise(l)}},callSite:c,saveCommandRef:p,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach(function(e){t[r.id(e)]=!0})}p(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,n.static),o(s,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?i(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):i(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:u,texture2D:function(t,e,r){var i,o=e.width,a=e.height,s=e.channels;n(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),t.wrapS===Ot&&t.wrapT===Ot||n(y(o)&&y(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&n(t.minFilter!==zt&&t.minFilter!==Nt&&t.minFilter!==jt&&t.minFilter!==Rt,"min filter requires mipmap"):(n(y(o)&&y(a),"texture must be a square power of 2 to support mipmapping"),n(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),e.type===Ft&&(r.extensions.indexOf("oes_texture_float_linear")<0&&n(t.minFilter===Dt&&t.magFilter===Dt,"filter not supported, must enable oes_texture_float_linear"),n(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var u=o>>i,c=a>>i;n(e.mipmask&1<0&&o<=i.maxTextureSize&&a>0&&a<=i.maxTextureSize,"invalid texture shape"),n(o===a,"cube map must be square"),n(e.wrapS===Ot&&e.wrapT===Ot,"wrap mode not supported by cube map");for(var l=0;l>h,p=a>>h;n(u.mipmask&1<=2,"invalid renderbuffer shape"),o=0|d[0],a=0|d[1]}else"radius"in f&&(o=a=0|f.radius),"width"in f&&(o=0|f.width),"height"in f&&(a=0|f.height);"format"in f&&(Wt.parameter(f.format,s,"invalid renderbuffer format"),c=s[f.format])}else"number"==typeof e?(o=0|e,a="number"==typeof r?0|r:o):e?Wt.raise("invalid arguments to renderbuffer constructor"):o=a=1;if(Wt(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),o!==h.width||a!==h.height||c!==h.format)return u.width=h.width=o,u.height=h.height=a,h.format=c,t.bindRenderbuffer($n,h.renderbuffer),t.renderbufferStorage($n,c,o,a),i.profile&&(h.stats.size=ht(h.format,h.width,h.height)),u.format=l[h.format],u}var h=new o(t.createRenderbuffer());return c[h.id]=h,r.renderbufferCount++,u(e,a),u.resize=function(e,r){var o=0|e,a=0|r||o;return o===h.width&&a===h.height?u:(Wt(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),u.width=h.width=o,u.height=h.height=a,t.bindRenderbuffer($n,h.renderbuffer),t.renderbufferStorage($n,h.format,o,a),i.profile&&(h.stats.size=ht(h.format,h.width,h.height)),u)},u._reglType="renderbuffer",u._renderbuffer=h,i.profile&&(u.stats=h.stats),u.destroy=function(){h.decRef()},u},clear:function(){$t(c).forEach(a)},restore:function(){$t(c).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer($n,e.renderbuffer),t.renderbufferStorage($n,e.format,e.width,e.height)}),t.bindRenderbuffer($n,null)}}},nr=36160,rr=36161,ir=3553,or=34069,ar=36064,sr=36096,lr=36128,ur=33306,cr=36053,hr=6402,fr=[6408],dr=[];dr[6408]=4;var pr=[];pr[5121]=1,pr[5126]=4,pr[36193]=2;var mr=33189,vr=36168,gr=34041,yr=[32854,32855,36194,35907,34842,34843,34836],xr={};xr[cr]="complete",xr[36054]="incomplete attachment",xr[36057]="incomplete dimensions",xr[36055]="incomplete, missing attachment",xr[36061]="unsupported";var br=5126,_r=35632,wr=35633,Mr=35718,kr=35721,Tr=6408,Ar=5121,Sr=3333,Er=5126,Cr="xyzw".split(""),Lr=5121,Pr=1,Ir=2,Or=0,Dr=1,zr=2,jr=3,Nr=4,Rr="dither",Fr="blend.enable",Br="blend.color",Ur="blend.equation",Vr="blend.func",Hr="depth.enable",qr="depth.func",Wr="depth.range",Gr="depth.mask",Yr="colorMask",Xr="cull.enable",Zr="cull.face",Kr="frontFace",Jr="lineWidth",$r="polygonOffset.enable",Qr="polygonOffset.offset",ti="sample.alpha",ei="sample.enable",ni="sample.coverage",ri="stencil.enable",ii="stencil.mask",oi="stencil.func",ai="stencil.opFront",si="stencil.opBack",li="scissor.enable",ui="scissor.box",ci="viewport",hi="profile",fi="framebuffer",di="vert",pi="frag",mi="elements",vi="primitive",gi="count",yi="offset",xi="instances",bi=fi+"Width",_i=fi+"Height",wi=ci+"Width",Mi=ci+"Height",ki="drawingBufferWidth",Ti="drawingBufferHeight",Ai=[Vr,Ur,oi,ai,si,ni,ci,ui,Qr],Si=34962,Ei=34963,Ci=3553,Li=34067,Pi=2884,Ii=3042,Oi=3024,Di=2960,zi=2929,ji=3089,Ni=32823,Ri=32926,Fi=32928,Bi=5126,Ui=35664,Vi=35665,Hi=35666,qi=5124,Wi=35667,Gi=35668,Yi=35669,Xi=35670,Zi=35671,Ki=35672,Ji=35673,$i=35674,Qi=35675,to=35676,eo=35678,no=35680,ro=4,io=1028,oo=1029,ao=2304,so=2305,lo=32775,uo=32776,co=519,ho=7680,fo=0,po=1,mo=32774,vo=513,go=36160,yo=36064,xo={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},bo=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],_o={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},wo={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Mo={frag:35632,vert:35633},ko={cw:ao,ccw:so},To=new wt(!1,!1,!1,function(){}),Ao=34918,So=34919,Eo=35007,Co=function(t,e){function n(){return u.pop()||l.createQueryEXT()}function r(t){u.push(t)}function i(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}function o(){return h.pop()||new i}function a(t){h.push(t)}function s(t,e,n){var r=o();r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,f.push(r)}var l=e.ext_disjoint_timer_query;if(!l)return null;var u=[],c=[],h=[],f=[],d=[],p=[];return{beginQuery:function(t){var e=n();l.beginQueryEXT(Eo,e),c.push(e),s(c.length-1,c.length,t)},endQuery:function(){l.endQueryEXT(Eo)},pushScopeStats:s,update:function(){var t,e,n=c.length;if(0!==n){p.length=Math.max(p.length,n+1),d.length=Math.max(d.length,n+1),d[0]=0,p[0]=0;var i=0;for(t=0,e=0;e=0;--t){var n=H[t];n&&n(A,null,0)}p.flush(),_&&_.update()}function n(){!Z&&H.length>0&&(Z=Zt.next(e))}function r(){Z&&(Zt.cancel(e),Z=null)}function i(t){t.preventDefault(),v=!0,r(),q.forEach(function(t){t()})}function o(t){p.getError(),v=!1,g.restore(),z.restore(),I.restore(),j.restore(),N.restore(),R.restore(),_&&_.restore(),F.procs.refresh(),n(),Y.forEach(function(t){t()})}function a(t){function e(t){var e={},n={};return Object.keys(t).forEach(function(r){var i=t[r];Xt.isDynamic(i)?n[r]=Xt.unbox(i,r):e[r]=i}),{dynamic:n,static:e}}function n(t){for(;f.length0)return c.call(this,n(0|t),0|t)}else{if(!Array.isArray(t))return u.call(this,t);if(t.length)return c.call(this,t,t.length)}},{stats:s})}function s(t,e){var n=0;F.procs.poll();var r=e.color;r&&(p.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=Lo),"depth"in e&&(p.clearDepth(+e.depth),n|=Po),"stencil"in e&&(p.clearStencil(0|e.stencil),n|=Io),Wt(!!n,"called regl.clear with no buffer specified"),p.clear(n)}function l(t){return Wt.type(t,"function","regl.frame() callback must be a function"),H.push(t),n(),{cancel:function(){function e(){var t=Et(H,e);H[t]=H[H.length-1],H.length-=1,H.length<=0&&r()}var n=Et(H,t);Wt(n>=0,"cannot cancel a frame twice"),H[n]=e}}}function u(){var t=U.viewport,e=U.scissor_box;t[0]=t[1]=e[0]=e[1]=0,A.viewportWidth=A.framebufferWidth=A.drawingBufferWidth=t[2]=e[2]=p.drawingBufferWidth,A.viewportHeight=A.framebufferHeight=A.drawingBufferHeight=t[3]=e[3]=p.drawingBufferHeight}function c(){A.tick+=1,A.time=f(),u(),F.procs.poll()}function h(){u(),F.procs.refresh(),_&&_.update()}function f(){return(Kt()-w)/1e3}var d=L(t);if(!d)return null;var p=d.gl,m=p.getContextAttributes(),v=p.isContextLost(),g=P(p,d);if(!g)return null;var y=M(),x=St(),b=g.extensions,_=Co(p,b),w=Kt(),k=p.drawingBufferWidth,T=p.drawingBufferHeight,A={tick:0,time:0,viewportWidth:k,viewportHeight:T,framebufferWidth:k,framebufferHeight:T,drawingBufferWidth:k,drawingBufferHeight:T,pixelRatio:d.pixelRatio},S={},E={elements:null,primitive:4,count:-1,offset:0,instances:-1},C=Jt(p,b),I=W(p,x,d),O=G(p,b,I,x),D=pt(p,b,C,I,y),z=mt(p,y,x,d),j=ct(p,b,C,function(){F.procs.poll()},A,x,d),N=er(p,b,C,x,d),R=ft(p,b,C,j,N,x),F=At(p,y,b,C,I,O,j,R,S,D,z,E,A,_,d),B=vt(p,R,F.procs.poll,A,m,b),U=F.next,V=p.canvas,H=[],q=[],Y=[],X=[d.onDestroy],Z=null;V&&(V.addEventListener(Do,i,!1),V.addEventListener(zo,o,!1));var K=R.setFBO=a({framebuffer:Xt.define.call(null,jo,"framebuffer")});h();var J=Pt(a,{clear:function(t){if(Wt("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;e<6;++e)K(Pt({framebuffer:t.framebuffer.faces[e]},t),s);else K(t,s);else s(null,t)},prop:Xt.define.bind(null,jo),context:Xt.define.bind(null,No),this:Xt.define.bind(null,Ro),draw:a({}),buffer:function(t){return I.create(t,Oo,!1,!1)},elements:function(t){return O.create(t,!1)},texture:j.create2D,cube:j.createCube,renderbuffer:N.create,framebuffer:R.create,framebufferCube:R.createCube,attributes:m,frame:l,on:function(t,e){Wt.type(e,"function","listener callback must be a function");var n;switch(t){case"frame":return l(e);case"lost":n=q;break;case"restore":n=Y;break;case"destroy":n=X;break;default:Wt.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t=0},read:B,destroy:function(){H.length=0,r(),V&&(V.removeEventListener(Do,i),V.removeEventListener(zo,o)),z.clear(),R.clear(),N.clear(),j.clear(),O.clear(),I.clear(),_&&_.clear(),X.forEach(function(t){t()})},_gl:p,_refresh:h,poll:function(){c(),_&&_.update()},now:f,stats:x});return d.onDone(null,J),J}})},{}],1232:[function(t,e,n){"use strict";var r,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var n=t.length*e;if(r!==t||void 0===r)r=t,i="";else if(i.length>=n)return i.substr(0,n);for(;n>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,n)}},{}],1233:[function(t,e,n){!function(t,r){"function"==typeof define&&define.amd?define(r):"object"==typeof n?e.exports=r():t.resolveUrl=r()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var n=document.getElementsByTagName("head")[0];n.insertBefore(e,n.firstChild);for(var r,i=document.createElement("a"),o=1;o=0;--i){var o=n;(u=(s=t[i])-(l=(n=o+s)-o))&&(t[--r]=n,n=u)}for(var a=0,i=r;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],n=0;n>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var n=t.split("[");return["w",e.substr(1),"m",n[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function s(t){return!0&t?"-":""}function l(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],n=0;n0&&n.push(","),n.push("[");for(var a=0;a0&&n.push(","),a===r?n.push("+b[",o,"]"):n.push("+A[",o,"][",a,"]");n.push("]")}n.push("]),")}n.push("det(A)]}return ",e);var s=new Function("det",n.join(""));return s(t<6?i[t]:i)}var i=t(1236),o=6,a=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;a.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n0){if(o<=0)return a;r=i+o}else{if(!(i<0))return a;if(o>=0)return a;r=-(i+o)}var s=3.3306690738754716e-16*r;return a>=s||a<=-s?a:m(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],a=n[0]-r[0],s=t[1]-r[1],l=e[1]-r[1],u=n[1]-r[1],c=t[2]-r[2],h=e[2]-r[2],f=n[2]-r[2],d=o*u,p=a*l,m=a*s,g=i*u,y=i*l,x=o*s,b=c*(d-p)+h*(m-g)+f*(y-x),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(h)+(Math.abs(y)+Math.abs(x))*Math.abs(f));return b>_||-b>_?b:v(t,e,n,r)}];!function(){for(;g.length<=p;)g.push(l(g.length));for(var t=[],n=["slow"],r=0;r<=p;++r)t.push("a"+r),n.push("o"+r);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],r=2;r<=p;++r)i.push("case ",r,":return o",r,"(",t.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&s>0||a<0&&s<0)return!1;var l=i(n,t,e),u=i(o,t,e);return!(l>0&&u>0||l<0&&u<0)&&(0!==a||0!==s||0!==l||0!==u||r(t,e,n,o))};var i=t(1240)[3]},{1240:1240}],1244:[function(t,e,n){"use strict";function r(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}e.exports=function(t,e){var n=0|t.length,i=0|e.length;if(1===n&&1===i)return r(t[0],-e[0]);var o,a,s=n+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=-e[h],v=f(m);p=i?(o=d,(c+=1)=i?(o=d,(c+=1)0){for(var s=0,l=0,u=0;ur.h||t>r.free||nc)&&(h=2*Math.max(t,c)),(ll)&&(u=2*Math.max(n,l)),this.resize(h,u),this.packOne(t,n)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var n=0;nthis.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,{x:n,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],1247:[function(t,e,n){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],1248:[function(t,e,n){"use strict";e.exports=function(t){return i(r(t))};var r=t(42),i=t(1230)},{1230:1230,42:42}],1249:[function(t,e,n){"use strict";function r(t){for(var e=t.length,n=0,r=0;r>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--l){l0&&s.push(","),s.push("[");for(var r=0;r0&&s.push(","),s.push("B(C,E,c[",i[0],"],c[",i[1],"])")}s.push("]")}s.push(");")}}(r[a]),s.push("break;");s.push("}}")}return s.push("}return R;};return getContour",t,"d"),new Function("pool",s.join(""))(i)}e.exports=function(t){var e=a[t];return e||(e=a[t]=r(t)),e};var i=t(1273),o=t(445),a={}},{1273:1273,445:445}],1251:[function(t,e,n){"use strict";"use restrict";function r(t,e){var n=t.length,r=t.length-e.length,i=Math.min;if(r)return r;switch(n){case 0:return 0;case 1:return t[0]-e[0];case 2:return(u=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],a=e[0]+e[1];if(u=o+t[2]-(a+e[2]))return u;var s=i(t[0],t[1]),l=i(e[0],e[1]),u=i(s,t[2])-i(l,e[2]);return u||i(s+t[2],o)-i(l+e[2],a);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f>1,s=r(t[a],e);s<=0?(0===s&&(o=a),n=a+1):s>0&&(i=a-1)}return o}function l(t,e){for(var n=new Array(t.length),i=0,o=n.length;i=t.length||0!==r(t[v],a))break}return n}function u(t,e){if(e<0)return[];for(var n=[],r=(1<>>c&1&&u.push(i[c]);e.push(u)}return o(e)},n.skeleton=u,n.boundary=function(t){for(var e=[],n=0,r=t.length;n>1:(t>>1)-1}function u(t){for(var e=s(t);;){var n=e,r=2*t+1,i=2*(t+1),o=t;if(r0;){var n=l(t);if(!(n>=0&&e0){var t=k[0];return a(0,A-1),A-=1,u(0),t}return-1}function f(t,e){var n=k[t];return y[n]===e?t:(y[n]=-1/0,c(t),h(),y[n]=e,A+=1,c(A-1))}function d(t,e){if(t[e]<0)return e;var n=e,r=e;do{var i=t[r];if(!x[r]||i<0||i===r)break;if(r=i,i=t[r],!x[r]||i<0||i===r)break;r=i,n=t[n]}while(n!==r);for(var o=e;o!==r;o=t[o])t[o]=r;return r}for(var p=e.length,m=t.length,v=new Array(p),g=new Array(p),y=new Array(p),x=new Array(p),b=0;b>1;b>=0;--b)u(b);for(;;){var S=h();if(S<0||y[S]>n)break;!function(t){if(!x[t]){x[t]=!0;var e=v[t],n=g[t];v[n]>=0&&(v[n]=e),g[e]>=0&&(g[e]=n),T[e]>=0&&f(T[e],i(e)),T[n]>=0&&f(T[n],i(n))}}(S)}for(var E=[],b=0;b=0&&n>=0&&e!==n){var r=T[e],i=T[n];r!==i&&C.push([r,i])}}),o.unique(o.normalize(C)),{positions:E,edges:C}};var i=t(1240),o=t(1253)},{1240:1240,1253:1253}],1256:[function(t,e,n){"use strict";function r(t,e){var n,r;if(e[0][0]e[1][0])){var o=Math.min(t[0][1],t[1][1]),a=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return al?o-l:a-l}n=e[1],r=e[0]}var u,c;t[0][1]e[1][0]))return r(e,t);n=e[1],o=e[0]}var a,s;if(t[0][0]t[1][0]))return-r(t,e);a=t[1],s=t[0]}var l=i(n,o,s),u=i(n,o,a);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=i(s,a,o),u=i(s,a,n),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return o[0]-s[0]};var i=t(1240)},{1240:1240}],1257:[function(t,e,n){"use strict";function r(t,e,n){this.slabs=t,this.coordinates=e,this.horizontal=n}function i(t,e){return t.y-e}function o(t,e){for(var n=null;t;){var r,i,a=t.key;a[0][0]0)if(e[0]!==a[1][0])n=t,t=t.right;else{if(l=o(t.right,e))return l;t=t.left}else{if(e[0]!==a[1][0])return t;var l=o(t.right,e);if(l)return l;t=t.left}}return n}function a(t,e,n,r){this.y=t,this.index=e,this.start=n,this.closed=r}function s(t,e,n,r){this.x=t,this.segment=e,this.create=n,this.index=r}e.exports=function(t){for(var e=t.length,n=2*e,i=new Array(n),o=0;o0){var s=o(this.slabs[e-1],t);s&&(a?h(s.key,a)>0&&(a=s.key,r=s.value):(r=s.value,a=s.key))}var u=this.horizontal[e];if(u.length>0){var f=l.ge(u,t[1],i);if(f=u.length)return r;d=u[f]}}if(d.start)if(a){var p=c(a[0],a[1],[t[0],d.y]);a[0][0]>a[1][0]&&(p=-p),p>0&&(r=d.index)}else r=d.index;else d.y!==t[1]&&(r=d.index)}}}return r}},{1240:1240,1256:1256,134:134,39:39}],1258:[function(t,e,n){"use strict";function r(t,e){var n=a(o(t,e),[e[e.length-1]]);return n[n.length-1]}function i(t,e,n,r){var i=-e/(r-e);i<0?i=0:i>1&&(i=1);for(var o=1-i,a=t.length,s=new Array(a),l=0;l0||a>0&&c<0){var h=i(s,c,l,a);n.push(h),o.push(h.slice())}c<0?o.push(l.slice()):c>0?n.push(l.slice()):(n.push(l.slice()),o.push(l.slice())),a=c}return{positive:n,negative:o}},e.exports.positive=function(t,e){for(var n=[],o=r(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||o>0&&u<0)&&n.push(i(a,u,s,o)),u>=0&&n.push(s.slice()),o=u}return n},e.exports.negative=function(t,e){for(var n=[],o=r(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||o>0&&u<0)&&n.push(i(a,u,s,o)),u<=0&&n.push(s.slice()),o=u}return n}},{1237:1237,1245:1245}],1259:[function(t,e,n){!function(t){function e(){var t=arguments[0],n=e.cache;return n[t]&&n.hasOwnProperty(t)||(n[t]=e.parse(t)),e.format.call(null,n[t],arguments)}function r(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function i(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};e.format=function(t,n){var a,s,l,u,c,h,f,d=1,p=t.length,m="",v=[],g=!0,y="";for(s=0;s=0),u[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,u[6]?parseInt(u[6]):0);break;case"e":a=u[7]?a.toExponential(u[7]):a.toExponential();break;case"f":a=u[7]?parseFloat(a).toFixed(u[7]):parseFloat(a);break;case"g":a=u[7]?parseFloat(a).toPrecision(u[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&u[7]?a.substring(0,u[7]):a;break;case"u":a>>>=0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}o.json.test(u[8])?v[v.length]=a:(!o.number.test(u[8])||g&&!u[3]?y="":(y=g?"+":"-",a=a.toString().replace(o.sign,"")),h=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",f=u[6]-(y+a).length,c=u[6]&&f>0?i(h,f):"",v[v.length]=u[5]?y+a+c:"0"===h?y+c+a:c+y+a)}return v.join("")},e.cache={},e.parse=function(t){for(var e=t,n=[],r=[],i=0;e;){if(null!==(n=o.text.exec(e)))r[r.length]=n[0];else if(null!==(n=o.modulo.exec(e)))r[r.length]="%";else{if(null===(n=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){i|=1;var a=[],s=n[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}n[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r[r.length]=n}e=e.substring(n[0].length)}return r};var a=function(t,n,r){return(r=(n||[]).slice(0)).splice(0,0,t),e.apply(null,r)};void 0!==n?(n.sprintf=e,n.vsprintf=a):(t.sprintf=e,t.vsprintf=a,"function"==typeof define&&define.amd&&define(function(){return{sprintf:e,vsprintf:a}}))}("undefined"==typeof window?this:window)},{}],1260:[function(t,e,n){"use strict";e.exports=function(t){for(var e=t.length,n=new Array(e),r=new Array(e),i=new Array(e),o=new Array(e),a=new Array(e),s=new Array(e),l=0;l0;){e=f[f.length-1];var d=t[e];if(o[e]=0&&s[e].push(a[p])}o[e]=y}else{if(r[e]===n[e]){for(var m=[],v=[],g=0,y=l.length-1;y>=0;--y){var x=l[y];if(i[x]=!1,m.push(x),v.push(s[x]),g+=s[x].length,a[x]=c.length,x===e){l.length=y;break}}c.push(m);for(var b=new Array(g),y=0;y=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return f(f({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function l(t){return t/360+.5}function u(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function c(t){return 360*(t-.5)}function h(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function f(t,e){for(var n in e)t[n]=e[n];return t}function d(t){return t.x}function p(t){return t.y}var m=t(290);e.exports=function(t){return new r(t)},r.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var n="prepare "+t.length+" points";e&&console.time(n),this.points=t;var r=t.map(o);e&&console.timeEnd(n);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=m(r,d,p,this.options.nodeSize,Float32Array),r=this._cluster(r,i),e&&console.log("z%d: %d clusters in %dms",i,r.length,+Date.now()-a)}return this.trees[this.options.minZoom]=m(r,d,p,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var n=this.trees[this._limitZoom(e)],r=n.range(l(t[0]),u(t[3]),l(t[2]),u(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&r.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){h.length>0&&f.push("}}");var d="vExtra"+h.length;r.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),f=["function ",d,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&u,":");for(var p=new Array(n),m=new Array(n),v=new Array(n),g=new Array(n),y=0,x=0;xx)&&!(u&1<0&&(T="+"+v[k]+"*c");var A=p[k].length/y*.5,S=.5+g[k]/y*.5;M.push("d"+k+"-"+S+"-"+A+"*("+p[k].join("+")+T+")/("+m[k].join("+")+")")}f.push("a.push([",M.join(),"]);","break;")}r.push("}},"),h.length>0&&f.push("}}");for(var E=[],u=0;u<1<0&&(f+=.02);for(var p=new Float32Array(h),m=0,v=-.5*f,d=0;d=0?1.2:1))}function i(t,e,n,r,i,a,s){for(var l=0;l.5?l/(2-o-a):l/(o+a),o){case t:r=(e-n)/l+(e1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var i,o,a;if(t=A(t,360),e=A(e,100),n=A(n,100),0===e)i=o=a=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;i=r(l,s,t+1/3),o=r(l,s,t),a=r(l,s,t-1/3)}return{r:255*i,g:255*o,b:255*a}}function s(t,e,n){t=A(t,255),e=A(e,255),n=A(n,255);var r,i,o=H(t,e,n),a=V(t,e,n),s=o,l=o-a;if(i=0===o?0:l/o,o==a)r=0;else{switch(o){case t:r=(e-n)/l+(e>1)+720)%360;--e;)i.h=(i.h+o)%360,a.push(n(i));return a}function k(t,e){e=e||6;for(var r=n(t).toHsv(),i=r.h,o=r.s,a=r.v,s=[],l=1/e;e--;)s.push(n({h:i,s:o,v:a})),a=(a+l)%1;return s}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function A(e,n){C(e)&&(e="100%");var r=L(e);return e=V(n,H(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),t.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function S(t){return V(1,H(0,t))}function E(t){return parseInt(t,16)}function C(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function L(t){return"string"==typeof t&&-1!=t.indexOf("%")}function P(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function D(t){return E(t)/255}function z(t){return!!Y.CSS_UNIT.exec(t)}function j(t){t=t.replace(R,"").replace(F,"").toLowerCase();var e=!1;if(W[t])t=W[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Y.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=Y.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Y.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=Y.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Y.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=Y.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Y.hex8.exec(t))?{r:E(n[1]),g:E(n[2]),b:E(n[3]),a:D(n[4]),format:e?"name":"hex8"}:(n=Y.hex6.exec(t))?{r:E(n[1]),g:E(n[2]),b:E(n[3]),format:e?"name":"hex"}:(n=Y.hex4.exec(t))?{r:E(n[1]+""+n[1]),g:E(n[2]+""+n[2]),b:E(n[3]+""+n[3]),a:D(n[4]+""+n[4]),format:e?"name":"hex8"}:!!(n=Y.hex3.exec(t))&&{r:E(n[1]+""+n[1]),g:E(n[2]+""+n[2]),b:E(n[3]+""+n[3]),format:e?"name":"hex"}}function N(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==n&&"large"!==n&&(n="small"),{level:e,size:n}}var R=/^\s+/,F=/\s+$/,B=0,U=t.round,V=t.min,H=t.max,q=t.random;n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,n,r,i,o,a,s=this.toRgb();return e=s.r/255,n=s.g/255,r=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),.2126*i+.7152*o+.0722*a},setAlpha:function(t){return this._a=T(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=U(360*t.h),n=U(100*t.s),r=U(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=U(360*t.h),n=U(100*t.s),r=U(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return c(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*A(this._r,255))+"%",g:U(100*A(this._g,255))+"%",b:U(100*A(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*A(this._r,255))+"%, "+U(100*A(this._g,255))+"%, "+U(100*A(this._b,255))+"%)":"rgba("+U(100*A(this._r,255))+"%, "+U(100*A(this._g,255))+"%, "+U(100*A(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(G[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+h(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var o=n(t);r="#"+h(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return n(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(g,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]="a"===i?t[i]:I(t[i]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:q(),g:q(),b:q()})},n.mix=function(t,e,r){r=0===r?0:r||50;var i=n(t).toRgb(),o=n(e).toRgb(),a=r/100;return n({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},n.readability=function(e,r){var i=n(e),o=n(r);return(t.max(i.getLuminance(),o.getLuminance())+.05)/(t.min(i.getLuminance(),o.getLuminance())+.05)},n.isReadable=function(t,e,r){var i,o,a=n.readability(t,e);switch(o=!1,(i=N(r)).level+i.size){case"AAsmall":case"AAAlarge":o=a>=4.5;break;case"AAlarge":o=a>=3;break;case"AAAsmall":o=a>=7}return o},n.mostReadable=function(t,e,r){var i,o,a,s,l=null,u=0;o=(r=r||{}).includeFallbackColors,a=r.level,s=r.size;for(var c=0;cu&&(u=i,l=n(e[c]));return n.isReadable(t,l,{level:a,size:s})||!o?l:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var W=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},G=n.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(W),Y=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==e&&e.exports?e.exports=n:"function"==typeof define&&define.amd?define(function(){return n}):window.tinycolor=n}(Math)},{}],1267:[function(t,e,n){"use strict";function r(t,e){var n=a(getComputedStyle(t).getPropertyValue(e));return n[0]*o(n[1],t)}function i(t,e){var n=document.createElement("div");n.style["font-size"]="128"+t,e.appendChild(n);var i=r(n,"font-size")/128;return e.removeChild(n),i}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return i(t,e);case"em":return r(e,"font-size");case"rem":return r(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return s;case"cm":return s/2.54;case"mm":return s/25.4;case"pt":return s/72;case"pc":return s/6}return 1}var a=t(474);e.exports=o;var s=96},{474:474}],1268:[function(t,e,n){!function(t,r){"object"==typeof n&&void 0!==e?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r(t.topojson=t.topojson||{})}(this,function(t){"use strict";function e(t,e){var r=e.id,i=e.bbox,o=null==e.properties?{}:e.properties,a=n(t,e);return null==r&&null==i?{type:"Feature",properties:o,geometry:a}:null==i?{type:"Feature",id:r,properties:o,geometry:a}:{type:"Feature",id:r,bbox:i,properties:o,geometry:a}}function n(t,e){function n(t,e){e.length&&e.pop();for(var n=h[t<0?~t:t],r=0,i=n.length;r1)r=i(t,e,n);else for(o=0,r=new Array(a=t.arcs.length);o1)for(var i,o,l=1,u=a(r[0]);lu&&(o=r[0],r[0]=r[l],r[l]=o,u=i);return r})}}var s=function(t){return t},l=function(t){if(null==(e=t.transform))return s;var e,n,r,i=e.scale[0],o=e.scale[1],a=e.translate[0],l=e.translate[1];return function(t,e){return e||(n=r=0),t[0]=(n+=t[0])*i+a,t[1]=(r+=t[1])*o+l,t}},u=function(t){function e(t){s[0]=t[0],s[1]=t[1],a(s),s[0]h&&(h=s[0]),s[1]f&&(f=s[1])}function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var r=t.bbox;if(!r){var i,o,a=l(t),s=new Array(2),u=1/0,c=u,h=-u,f=-u;t.arcs.forEach(function(t){for(var e=-1,n=t.length;++eh&&(h=s[0]),s[1]f&&(f=s[1])});for(o in t.objects)n(t.objects[o]);r=t.bbox=[u,c,h,f]}return r},c=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},h=function(t,e){function n(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1],e<0?[n,i]:[i,n]}function r(t,e){for(var n in t){var r=t[n];delete e[r.start],delete r.start,delete r.end,r.forEach(function(t){i[t<0?~t:t]=1}),s.push(r)}}var i={},o={},a={},s=[],l=-1;return e.forEach(function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++l],e[l]=n,e[r]=i)}),e.forEach(function(t){var e,r,i=n(t),s=i[0],l=i[1];if(e=a[s])if(delete a[e.end],e.push(t),e.end=l,r=o[l]){delete o[r.start];var u=r===e?e:e.concat(r);o[u.start=e.start]=a[u.end=r.end]=u}else o[e.start]=a[e.end]=e;else if(e=o[l])if(delete o[e.start],e.unshift(t),e.start=s,r=a[s]){delete a[r.end];var c=r===e?e:r.concat(e);o[c.start=r.start]=a[c.end=e.end]=c}else o[e.start]=a[e.end]=e;else o[(e=[t]).start=s]=a[e.end=l]=e}),r(a,o),r(o,a),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},f=function(t,e){for(var n=0,r=t.length;n>>1;t[i]=2))throw new Error("n must be ≥2");if(t.transform)throw new Error("already quantized");var i,o=u(t),a=o[0],s=(o[2]-a)/(e-1)||1,l=o[1],c=(o[3]-l)/(e-1)||1;t.arcs.forEach(function(t){for(var e,n,r,i=1,o=1,u=t.length,h=t[0],f=h[0]=Math.round((h[0]-a)/s),d=h[1]=Math.round((h[1]-l)/c);iMath.max(n,r)?i[2]=1:n>Math.max(e,r)?i[0]=1:i[1]=1;for(var o=0,a=0,s=0;s<3;++s)o+=t[s]*t[s],a+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=a/o*t[s];return h(i,i),i}function a(t,e,n,r,i,o,a,l){this.center=s(n),this.up=s(r),this.right=s(i),this.radius=s([o]),this.angle=s([a,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],n=t.up||[0,1,0],i=t.right||o(n),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),n=[].slice.call(n,0,3),h(n,n),i=[].slice.call(i,0,3),h(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];c(i,p,n),r(i[0],i[1],i[2])<1e-6?i=o(n):h(i,i),s=r(p[0],p[1],p[2]);var m=f(n,p)/s,v=f(i,p)/s;u=Math.acos(m),l=Math.acos(v)}return s=Math.log(s),new a(t.zoomMin,t.zoomMax,e,n,i,s,l,u)};var s=t(132),l=t(180),u=t(184),c=t(262),h=t(266),f=t(263),d=a.prototype;d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,n=this.computedRight,i=0,o=0,a=0;a<3;++a)o+=e[a]*n[a],i+=e[a]*e[a];for(var s=Math.sqrt(i),l=0,a=0;a<3;++a)n[a]-=e[a]*o/i,l+=n[a]*n[a],e[a]/=s;for(var u=Math.sqrt(l),a=0;a<3;++a)n[a]/=u;var f=this.computedToward;c(f,e,n),h(f,f);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],v=Math.cos(p),g=Math.sin(p),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=v*y,w=g*y,M=x,k=-v*x,T=-g*x,A=y,S=this.computedEye,E=this.computedMatrix,a=0;a<3;++a){var C=_*n[a]+w*f[a]+M*e[a];E[4*a+1]=k*n[a]+T*f[a]+A*e[a],E[4*a+2]=C,E[4*a+3]=0}var L=E[1],P=E[5],I=E[9],O=E[2],D=E[6],z=E[10],j=P*z-I*D,N=I*O-L*z,R=L*D-P*O,F=r(j,N,R);j/=F,N/=F,R/=F,E[0]=j,E[4]=N,E[8]=R;for(a=0;a<3;++a)S[a]=b[a]+E[2+4*a]*d;for(a=0;a<3;++a){for(var l=0,B=0;B<3;++B)l+=E[a+4*B]*S[B];E[12+a]=-l}E[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var n=this.computedMatrix;if(e){for(var r=0;r<16;++r)e[r]=n[r];return e}return n};var p=[0,0,0];d.rotate=function(t,e,n,r){if(this.angle.move(t,e,n),r){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var o=this.computedUp,a=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=o[l],i[4*l+1]=a[l],i[4*l+2]=s[l];u(i,i,r,p);for(l=0;l<3;++l)o[l]=i[4*l],a[l]=i[4*l+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,a[0],a[1],a[2])}},d.pan=function(t,e,n,i){e=e||0,n=n||0,i=i||0,this.recalcMatrix(t);var o=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),o[1]),s=o[5],l=o[9],u=r(a,s,l);a/=u,s/=u,l/=u;var c=o[0],h=o[4],f=o[8],d=c*a+h*s+f*l,p=r(c-=a*d,h-=s*d,f-=l*d),m=(c/=p)*e+a*n,v=(h/=p)*e+s*n,g=(f/=p)*e+l*n;this.center.move(t,m,v,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},d.translate=function(t,e,n,r){this.center.move(t,e||0,n||0,r||0)},d.setMatrix=function(t,e,n,o){var a=1;"number"==typeof n&&(a=0|n),(a<0||a>3)&&(a=1);var s=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var u=e[a],c=e[a+4],h=e[a+8];if(o){var f=Math.abs(u),d=Math.abs(c),p=Math.abs(h),m=Math.max(f,d,p);f===m?(u=u<0?-1:1,c=h=0):p===m?(h=h<0?-1:1,u=c=0):(c=c<0?-1:1,u=h=0)}else{var v=r(u,c,h);u/=v,c/=v,h/=v}var g=e[s],y=e[s+4],x=e[s+8],b=g*u+y*c+x*h,_=r(g-=u*b,y-=c*b,x-=h*b),w=c*(x/=_)-h*(y/=_),M=h*(g/=_)-u*x,k=u*y-c*g,T=r(w,M,k);w/=T,M/=T,k/=T,this.center.jump(t,q,W,G),this.radius.idle(t),this.up.jump(t,u,c,h),this.right.jump(t,g,y,x);var A,S;if(2===a){var E=e[1],C=e[5],L=e[9],P=E*g+C*y+L*x,I=E*w+C*M+L*k;A=j<0?-Math.PI/2:Math.PI/2,S=Math.atan2(I,P)}else{var O=e[2],D=e[6],z=e[10],j=O*u+D*c+z*h,N=O*g+D*y+z*x,R=O*w+D*M+z*k;A=Math.asin(i(j)),S=Math.atan2(R,N)}this.angle.jump(t,S,A),this.recalcMatrix(t);var F=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var H=V[15],q=V[12]/H,W=V[13]/H,G=V[14]/H,Y=Math.exp(this.computedRadius[0]);this.center.jump(t,q-F*Y,W-B*Y,G-U*Y)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,n,o){this.recalcMatrix(t),e=e||this.computedEye,n=n||this.computedCenter;var a=(o=o||this.computedUp)[0],s=o[1],l=o[2],u=r(a,s,l);if(!(u<1e-6)){a/=u,s/=u,l/=u;var c=e[0]-n[0],h=e[1]-n[1],f=e[2]-n[2],d=r(c,h,f);if(!(d<1e-6)){c/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],v=p[1],g=p[2],y=a*m+s*v+l*g,x=r(m-=y*a,v-=y*s,g-=y*l);if(!(x<.01&&(m=s*f-l*h,v=l*c-a*f,g=a*h-s*c,(x=r(m,v,g))<1e-6))){m/=x,v/=x,g/=x,this.up.set(t,a,s,l),this.right.set(t,m,v,g),this.center.set(t,n[0],n[1],n[2]),this.radius.set(t,Math.log(d));var b=s*g-l*v,_=l*m-a*g,w=a*v-s*m,M=r(b,_,w),k=a*c+s*h+l*f,T=m*c+v*h+g*f,A=(b/=M)*c+(_/=M)*h+(w/=M)*f,S=Math.asin(i(k)),E=Math.atan2(A,T),C=this.angle._state,L=C[C.length-1],P=C[C.length-2];L%=2*Math.PI;var I=Math.abs(L+2*Math.PI-E),O=Math.abs(L-E),D=Math.abs(L-2*Math.PI-E);I0?n.pop():new ArrayBuffer(t)}function a(t){return new Uint8Array(o(t),0,t)}function s(t){return new Uint16Array(o(2*t),0,t)}function l(t){return new Uint32Array(o(4*t),0,t)}function u(t){return new Int8Array(o(t),0,t)}function c(t){return new Int16Array(o(2*t),0,t)}function h(t){return new Int32Array(o(4*t),0,t)}function f(t){return new Float32Array(o(4*t),0,t)}function d(t){return new Float64Array(o(8*t),0,t)}function p(t){return x?new Uint8ClampedArray(o(t),0,t):a(t)}function m(t){return new DataView(o(t),0,t)}function v(t){t=g.nextPow2(t);var e=g.log2(t),n=w[e];return n.length>0?n.pop():new r(t)}var g=t(40),y=t(101);e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var x="undefined"!=typeof Uint8ClampedArray,b=e.__TYPEDARRAY_POOL;b.UINT8C||(b.UINT8C=y([32,0])),b.BUFFER||(b.BUFFER=y([32,0]));var _=b.DATA,w=b.BUFFER;n.free=function(t){if(r.isBuffer(t))w[g.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,n=0|g.log2(e);_[n].push(t)}},n.freeUint8=n.freeUint16=n.freeUint32=n.freeInt8=n.freeInt16=n.freeInt32=n.freeFloat32=n.freeFloat=n.freeFloat64=n.freeDouble=n.freeUint8Clamped=n.freeDataView=function(t){i(t.buffer)},n.freeArrayBuffer=i,n.freeBuffer=function(t){w[g.log2(t.length)].push(t)},n.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return a(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return u(t);case"int16":return c(t);case"int32":return h(t);case"float":case"float32":return f(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return v(t);case"data":case"dataview":return m(t);default:return null}return null},n.mallocArrayBuffer=o,n.mallocUint8=a,n.mallocUint16=s,n.mallocUint32=l,n.mallocInt8=u,n.mallocInt16=c,n.mallocInt32=h,n.mallocFloat32=n.mallocFloat=f,n.mallocFloat64=n.mallocDouble=d,n.mallocUint8Clamped=p,n.mallocDataView=m,n.mallocBuffer=v,n.clearCache=function(){for(var t=0;t<32;++t)b.UINT8[t].length=0,b.UINT16[t].length=0,b.UINT32[t].length=0,b.INT8[t].length=0,b.INT16[t].length=0,b.INT32[t].length=0,b.FLOAT[t].length=0,b.DOUBLE[t].length=0,b.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t(51).Buffer)},{101:101,40:40,51:51}],1274:[function(t,e,n){"use strict";"use restrict";function r(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;er)return r;for(;no?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],1277:[function(t,e,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,n){if(t&&a.isObject(t)&&t instanceof r)return t;var i=new r;return i.parse(t,e,n),i}var o=t(1061),a=t(1278);n.parse=i,n.resolve=function(t,e){return i(t,!1,!0).resolve(e)},n.resolveObject=function(t,e){return t?i(t,!1,!0).resolveObject(e):e},n.format=function(t){return a.isString(t)&&(t=i(t)),t instanceof r?t.format():r.prototype.format.call(t)},n.Url=r;var s=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["<",">",'"',"`"," ","\r","\n","\t"],h=["{","}","|","\\","^","`"].concat(c),f=["'"].concat(h),d=["%","/","?",";","#"].concat(f),p=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=t(1065);r.prototype.parse=function(t,e,n){if(!a.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),i=-1!==r&&r127?D+="x":D+=O[z];if(!D.match(m)){var N=P.slice(0,A),R=P.slice(A+1),F=O.match(v);F&&(N.push(F[1]),R.unshift(F[2])),R.length&&(h="/"+R.join(".")+h),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=o.toASCII(this.hostname));var B=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+B,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==h[0]&&(h="/"+h))}if(!g[M])for(var A=0,I=f.length;A0)&&n.host.split("@"))&&(n.auth=L.shift(),n.host=n.hostname=L.shift())),n.search=t.search,n.query=t.query,a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var T=w.slice(-1)[0],A=(n.host||t.host||w.length>1)&&("."===T||".."===T)||""===T,S=0,E=w.length;E>=0;E--)"."===(T=w[E])?w.splice(E,1):".."===T?(w.splice(E,1),S++):S&&(w.splice(E,1),S--);if(!b&&!_)for(;S--;S)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),A&&"/"!==w.join("/").substr(-1)&&w.push("");var C=""===w[0]||w[0]&&"/"===w[0].charAt(0);if(k){n.hostname=n.host=C?"":w.length?w.shift():"";var L=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");L&&(n.auth=L.shift(),n.host=n.hostname=L.shift())}return(b=b||n.host&&w.length)&&!C&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{1061:1061,1065:1065,1278:1278}],1278:[function(t,e,n){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],1279:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],1280:[function(t,e,n){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],1281:[function(t,e,n){(function(e,r){function i(t,e){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(e)?r.showHidden=e:e&&n._extend(r,e),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),l(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function l(t,e,r){if(t.customInspect&&e&&k(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return y(i)||(i=l(t,i,r)),i}var o=u(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),M(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(k(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(b(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(w(e))return t.stylize(Date.prototype.toString.call(e),"date");if(M(e))return c(e)}var g="",x=!1,_=["{","}"];if(p(e)&&(x=!0,_=["[","]"]),k(e)&&(g=" [Function"+(e.name?": "+e.name:"")+"]"),b(e)&&(g=" "+RegExp.prototype.toString.call(e)),w(e)&&(g=" "+Date.prototype.toUTCString.call(e)),M(e)&&(g=" "+c(e)),0===a.length&&(!x||0==e.length))return _[0]+g+_[1];if(r<0)return b(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var T;return T=x?h(t,e,r,m,a):a.map(function(n){return f(t,e,r,m,n,x)}),t.seen.pop(),d(T,g,_)}function u(t,e){if(x(e))return t.stylize("undefined","undefined");if(y(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,r,i){for(var o=[],a=0,s=e.length;a-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t,e,n){var r=0;return t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function x(t){return void 0===t}function b(t){return _(t)&&"[object RegExp]"===T(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===T(t)}function M(t){return _(t)&&("[object Error]"===T(t)||t instanceof Error)}function k(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}function S(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),I[t.getMonth()],e].join(" ")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var C=/%[sdj%]/g;n.format=function(t){if(!y(t)){for(var e=[],n=0;n=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),s=r[n];n>3}if(i--,1===r||2===r)o+=t.readSVarint(),a+=t.readSVarint(),1===r&&(e&&s.push(e),e=[]),e.push(new l(o,a));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&s.push(e),s},r.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(r--,1===n||2===n)i+=t.readSVarint(),o+=t.readSVarint(),is&&(s=i),ou&&(u=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,l,s,u]},r.prototype.toGeoJSON=function(t,e,n){function i(t){for(var e=0;e>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}var a=t(1284);e.exports=r,r.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{1284:1284}],1286:[function(t,e,n){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),r(t,e.canvas||i,e.context||o,e)};var r=t(1287),i=null,o=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,o=i.getContext("2d"))},{1287:1287}],1287:[function(t,e,n){"use strict";function r(t,e,n){for(var r=e.textAlign||"start",i=e.textBaseline||"alphabetic",o=[1<<30,1<<30],a=[0,0],s=t.length,l=0;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var o=3*r;t.height>31}function s(t){for(var e=[],n=0,r=0,i=t.length,s=0;s=0?e[a]:o})},has___:{value:i(function(e){var i=r(e);return i?n in i:t.indexOf(e)>=0})},set___:{value:i(function(i,o){var a,s=r(i);return s?s[n]=o:(a=t.indexOf(i))>=0?e[a]=o:(a=t.length,e[a]=o,t[a]=i),this})},delete___:{value:i(function(i){var o,a,s=r(i);return s?n in s&&delete s[n]:!((o=t.indexOf(i))<0||(a=t.length-1,t[o]=void 0,e[o]=e[a],t[o]=t[a],t.length=a,e.length=a,0))})}})};b.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?function(){function n(){this instanceof b||o();var e,n=new s,r=void 0,l=!1;return e=a?function(t,e){return n.set(t,e),n.has(t)||(r||(r=new b),r.set(t,e)),this}:function(t,e){if(l)try{n.set(t,e)}catch(n){r||(r=new b),r.set___(t,e)}else n.set(t,e);return this},Object.create(b.prototype,{get___:{value:i(function(t,e){return r?n.has(t)?n.get(t):r.get___(t,e):n.get(t,e)})},has___:{value:i(function(t){return n.has(t)||!!r&&r.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!n.delete(t);return r?r.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}a&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=b.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=b)}}()},{}],1292:[function(t,e,n){var r=t(1293);e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var n=e.valueOf(t);return n&&n.identity===t?n:r(e,t)}}},{1293:1293}],1293:[function(t,e,n){e.exports=function(t,e){var n={identity:e},r=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?r.apply(this,arguments):n},writable:!0}),n}},{}],1294:[function(t,e,n){var r=t(1292);e.exports=function(){var t=r();return{get:function(e,n){var r=t(e);return r.hasOwnProperty("value")?r.value:n},set:function(e,n){return t(e).value=n,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{1292:1292}],1295:[function(t,e,n){var r=t(146);e.exports=function(t){return r("webgl",t)}},{146:146}],1296:[function(t,e,n){var r=arguments[3],i=arguments[4],o=arguments[5],a=JSON.stringify;e.exports=function(t,e){function n(t){v[t]=!0;for(var e in i[t][1]){var r=i[t][1][e];v[r]||n(r)}}for(var s,l=Object.keys(o),u=0,c=l.length;u=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof n&&n>=1&&n<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:n},o=r||{}}var a=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;o.year=s>=a?i.year:i.year-1;var l,u=(a=p[o.year-p[0]])>>9&4095,c=a>>5&15,h=31&a,f=new Date(u,c-1,h),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-f)/864e5);var v,g=d[o.year-d[0]];for(v=0;v<13;v++){var y=g&1<<12-v?30:29;if(l>13;return!x||v=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof n&&n>=1&&n<=30))throw new Error("Lunar day outside range 1 - 30");var s;"object"==typeof r?(s=!1,o=r):(s=!!r,o=i||{}),a={year:t,month:e,day:n,isIntercalary:s}}var l;l=a.day-1;var u,c=d[a.year-d[0]],h=c>>13;u=h?a.month>h?a.month:a.isIntercalary?a.month:a.month-1:a.month-1;for(var f=0;f>9&4095,g=m>>5&15,y=31&m,x=new Date(v,g-1,y+l);return o.year=x.getFullYear(),o.month=1+x.getMonth(),o.day=x.getDate(),o}var a=t(1313),s=t(470),l=a.instance();s(r.prototype=new a.baseCalendar,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var n=t.match(c);return n?n[0]:""}var r=this._validateYear(t),i=t.month(),o=""+this.toChineseMonth(r,i);return e&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(r,i)&&(o+="i"),o},monthNames:function(t){if("string"==typeof t){var e=t.match(h);return e?e[0]:""}var n=this._validateYear(t),r=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(n,r)-1];return this.isIntercalaryMonth(n,r)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(f);return e?e[0]:""}var n=this._validateYear(t),r=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(n,r)-1];return this.isIntercalaryMonth(n,r)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var n,r=parseInt(e);if(isNaN(r))"闰"===e[0]&&(n=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),r=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];n="i"===i||"I"===i}return this.toMonthIndex(t,r,n)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,n){var r=this.intercalaryMonth(t);if(n&&e!==r||e<1||e>12)throw a.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?!n&&e<=r?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var n=this.intercalaryMonth(t),r=n?12:11;if(e<0||e>r)throw a.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var n=this.intercalaryMonth(t);return!!n&&n===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,n){var r,i=this._validateYear(t,a.local.invalidyear),o=p[i-p[0]],s=o>>9&4095,u=o>>5&15,c=31&o;(r=l.newDate(s,u,c)).add(4-(r.dayOfWeek()||7),"d");var h=this.toJD(t,e,n)-r.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var n=d[t-d[0]];if(e>(n>>13?12:11))throw a.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-e?30:29},weekDay:function(t,e,n){return(this.dayOfWeek(t,e,n)||7)<6},toJD:function(t,e,n){var r=this._validate(t,s,n,a.local.invalidDate);t=this._validateYear(r.year()),e=r.month(),n=r.day();var i=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),u=o(t,s,n,i);return l.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=l.fromJD(t),n=i(e.year(),e.month(),e.day()),r=this.toMonthIndex(n.year,n.month,n.isIntercalary);return this.newDate(n.year,r,n.day)},fromString:function(t){var e=t.match(u),n=this._validateYear(+e[1]),r=+e[2],i=!!e[3],o=this.toMonthIndex(n,r,i),a=+e[4];return this.newDate(n,o,a)},add:function(t,e,n){var i=t.year(),o=t.month(),a=this.isIntercalaryMonth(i,o),s=this.toChineseMonth(i,o),l=Object.getPrototypeOf(r.prototype).add.call(this,t,e,n);if("y"===n){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),f=a&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);f!==c&&l.month(f)}return l}});var u=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,c=/^\d?\d[iI]?/m,h=/^闰?十?[一二三四五六七八九]?月/m,f=/^闰?十?[一二三四五六七八九]?/m;a.calendars.chinese=r;var d=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{1313:1313,470:470}],1300:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313);t(470)(r.prototype=new i.baseCalendar,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return(this.dayOfWeek(t,e,n)||7)<6},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate);return(t=r.year())<0&&t++,r.day()+30*(r.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,n=Math.floor((e-Math.floor((e+366)/1461))/365)+1;n<=0&&n--,e=Math.floor(t)+.5-this.newDate(n,1,1).toJD();var r=Math.floor(e/30)+1,i=e-30*(r-1)+1;return this.newDate(n,r,i)}}),i.calendars.coptic=r},{1313:1313,470:470}],1301:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313);t(470)(r.prototype=new i.baseCalendar,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),400},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,n){return(this._validate(t,e,n,i.local.invalidDate).day()+1)%8},weekDay:function(t,e,n){var r=this.dayOfWeek(t,e,n);return r>=2&&r<=6},extraInfo:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate);return{century:o[Math.floor((r.year()-1)/100)+1]||""}},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate);return t=r.year()+(r.year()<0?1:0),e=r.month(),(n=r.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var n=Math.floor(t/32)+1,r=t-32*(n-1)+1;return this.newDate(e<=0?e-1:e,n,r)}});var o={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=r},{1313:1313,470:470}],1302:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313);t(470)(r.prototype=new i.baseCalendar,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return(this.dayOfWeek(t,e,n)||7)<6},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate);return(t=r.year())<0&&t++,r.day()+30*(r.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,n=Math.floor((e-Math.floor((e+366)/1461))/365)+1;n<=0&&n--,e=Math.floor(t)+.5-this.newDate(n,1,1).toJD();var r=Math.floor(e/30)+1,i=e-30*(r-1)+1;return this.newDate(n,r,i)}}),i.calendars.ethiopian=r},{1313:1313,470:470}],1303:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var o=t(1313);t(470)(r.prototype=new o.baseCalendar,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,o.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,n){return 6!==this.dayOfWeek(t,e,n)},extraInfo:function(t,e,n){var r=this._validate(t,e,n,o.local.invalidDate);return{yearType:(this.leapYear(r)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(r)%10-3]}},toJD:function(t,e,n){var r=this._validate(t,e,n,o.local.invalidDate);t=r.year(),e=r.month(),n=r.day();var i=t<=0?t+1:t,a=this.jdEpoch+this._delay1(i)+this._delay2(i)+n+1;if(e<7){for(s=7;s<=this.monthsInYear(t);s++)a+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var n=tthis.toJD(e,n,this.daysInMonth(e,n));)n++;var r=t-this.toJD(e,n,1)+1;return this.newDate(e,n,r)}}),o.calendars.hebrew=r},{1313:1313,470:470}],1304:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313);t(470)(r.prototype=new i.baseCalendar,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return 5!==this.dayOfWeek(t,e,n)},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate);return t=r.year(),e=r.month(),n=r.day(),t=t<=0?t+1:t,n+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var n=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),r=t-this.toJD(e,n,1)+1;return this.newDate(e,n,r)}}),i.calendars.islamic=r},{1313:1313,470:470}],1305:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313);t(470)(r.prototype=new i.baseCalendar,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(4-(r.dayOfWeek()||7),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return(this.dayOfWeek(t,e,n)||7)<6},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate);return t=r.year(),e=r.month(),n=r.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+n-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,n=Math.floor((e-122.1)/365.25),r=Math.floor(365.25*n),i=Math.floor((e-r)/30.6001),o=i-Math.floor(i<14?1:13),a=n-Math.floor(o>2?4716:4715),s=e-r-Math.floor(30.6001*i);return a<=0&&a--,this.newDate(a,o,s)}}),i.calendars.julian=r},{1313:1313,470:470}],1306:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function o(t,e){return i(t-1,e)+1}var a=t(1313);t(470)(r.prototype=new a.baseCalendar,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,n=0;n19||n>0&&r<0)throw"Invalid Mayan year";e=20*e+r}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),18},weekOfYear:function(t,e,n){return this._validate(t,e,n,a.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,a.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,n){return this._validate(t,e,n,a.local.invalidDate).day()},weekDay:function(t,e,n){return this._validate(t,e,n,a.local.invalidDate),!0},extraInfo:function(t,e,n){var r=this._validate(t,e,n,a.local.invalidDate).toJD(),i=this._toHaab(r),o=this._toTzolkin(r);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[o(t+20,20),o(t+4,13)]},toJD:function(t,e,n){var r=this._validate(t,e,n,a.local.invalidDate);return r.day()+20*r.month()+360*r.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var n=Math.floor(t/20),r=t%20;return this.newDate(e,n,r)}}),a.calendars.mayan=r},{1313:1313,470:470}],1307:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313),o=t(470);r.prototype=new i.baseCalendar;var a=i.instance("gregorian");o(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear);return a.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(1-(r.dayOfWeek()||7),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return(this.dayOfWeek(t,e,n)||7)<6},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidMonth);(t=r.year())<0&&t++;for(var o=r.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var n=t-Math.floor(this.toJD(e,1,1)+.5)+1,r=1;n>this.daysInMonth(e,r);)n-=this.daysInMonth(e,r),r++;return this.newDate(e,r,n)}}),i.calendars.nanakshahi=r},{1313:1313,470:470}],1308:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313);t(470)(r.prototype=new i.baseCalendar,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,n=this.minMonth;n<=12;n++)e+=this.NEPALI_CALENDAR_DATA[t][n];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,n){return 6!==this.dayOfWeek(t,e,n)},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate);t=r.year(),e=r.month(),n=r.day();var o=i.instance(),a=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(a=n,s--);9!==s;)s<=0&&(s=12,l--),a+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(a+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(a+=o.daysInYear(u)):a+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],o.newDate(u,1,1).add(a,"d").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),n=e.year(),r=e.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var a=9,s=this.NEPALI_CALENDAR_DATA[o][0],l=this.NEPALI_CALENDAR_DATA[o][a]-s+1;r>l;)++a>12&&(a=1,o++),l+=this.NEPALI_CALENDAR_DATA[o][a];var u=this.NEPALI_CALENDAR_DATA[o][a]-(l-r);return this.newDate(o,a,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var n=t-1;n0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-(r.dayOfWeek()+1)%7,"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,o.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return 5!==this.dayOfWeek(t,e,n)},toJD:function(t,e,n){var r=this._validate(t,e,n,o.local.invalidDate);t=r.year(),e=r.month(),n=r.day();var a=t-(t>=0?474:473),s=474+i(a,2820);return n+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),n=Math.floor(e/1029983),r=i(e,1029983),o=2820;if(1029982!==r){var a=Math.floor(r/366),s=i(r,366);o=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=o+2820*n+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),h=t-this.toJD(l,c,1)+1;return this.newDate(l,c,h)}}),o.calendars.persian=r,o.calendars.jalali=r},{1313:1313,470:470}],1310:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313),o=t(470),a=i.instance();o(r.prototype=new i.baseCalendar,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,n){var r=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(r.year());return a.weekOfYear(t,r.month(),r.day())},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return(this.dayOfWeek(t,e,n)||7)<6},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate),t=this._t2gYear(r.year());return a.toJD(t,r.month(),r.day())},fromJD:function(t){var e=a.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),i.calendars.taiwan=r},{1313:1313,470:470}],1311:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313),o=t(470),a=i.instance();o(r.prototype=new i.baseCalendar,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,n){var r=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(r.year());return a.weekOfYear(t,r.month(),r.day())},daysInMonth:function(t,e){var n=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,n){return(this.dayOfWeek(t,e,n)||7)<6},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate),t=this._t2gYear(r.year());return a.toJD(t,r.month(),r.day())},fromJD:function(t){var e=a.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),i.calendars.thai=r},{1313:1313,470:470}],1312:[function(t,e,n){function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t(1313);t(470)(r.prototype=new i.baseCalendar,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,n){var r=this.newDate(t,e,n);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,n=1;n<=12;n++)e+=this.daysInMonth(t,n);return e},daysInMonth:function(t,e){for(var n=this._validate(t,e,this.minDay,i.local.invalidMonth).toJD()-24e5+.5,r=0,a=0;an)return o[r]-o[r-1];r++}return 30},weekDay:function(t,e,n){return 5!==this.dayOfWeek(t,e,n)},toJD:function(t,e,n){var r=this._validate(t,e,n,i.local.invalidDate),a=12*(r.year()-1)+r.month()-15292;return r.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,n=0,r=0;re);r++)n++;var i=n+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=e-o[n-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,n){var r=i.baseCalendar.prototype.isValid.apply(this,arguments);return r&&(r=(t=null!=t.year?t.year:t)>=1276&&t<=1500),r},_validate:function(t,e,n,r){var o=i.baseCalendar.prototype._validate.apply(this,arguments);if(o.year<1276||o.year>1500)throw r.replace(/\{0\}/,this.local.name);return o}}),i.calendars.ummalqura=r;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{1313:1313,470:470}],1313:[function(t,e,n){function r(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,n,r){if(this._calendar=t,this._year=e,this._month=n,this._day=r,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function a(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t(470);l(r.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var n=this._localCals[t+"-"+e];if(!n&&this.calendars[t]&&(n=new this.calendars[t](e),this._localCals[t+"-"+e]=n),!n)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return n},newDate:function(t,e,n,r,i){return(r=(null!=t&&t.year?t.calendar():"string"==typeof r?this.instance(r,i):r)||this.instance()).newDate(t,e,n)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(n){for(var r="",i=0;n>0;){var o=n%10;r=(0===o?"":t[o]+e[i])+r,i++,n=Math.floor(n/10)}return 0===r.indexOf(t[1]+e[1])&&(r=r.substr(1)),r||t[0]}}}),l(i.prototype,{newDate:function(t,e,n){return this._calendar.newDate(null==t?this:t,e,n)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,n){if(!this._calendar.isValid(t,e,n))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=n,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),l(a.prototype,{_validateLevel:0,newDate:function(t,e,n){return null==t?this.today():(t.year&&(this._validate(t,e,n,u.local.invalidDate||u.regionalOptions[""].invalidDate),n=t.day(),e=t.month(),t=t.year()),new i(this,t,e,n))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var n=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(n.month()+this.monthsInYear(n)-this.firstMonth)%this.monthsInYear(n)+this.minMonth},fromMonthOfYear:function(t,e){var n=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,n,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),n},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,n){var r=this._validate(t,e,n,u.local.invalidDate||u.regionalOptions[""].invalidDate);return r.toJD()-this.newDate(r.year(),this.fromMonthOfYear(r.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,n){var r=this._validate(t,e,n,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(r))+2)%this.daysInWeek()},extraInfo:function(t,e,n){return this._validate(t,e,n,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,n){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,n),e,n)},_add:function(t,e,n){if(this._validateLevel++,"d"===n||"w"===n){var r=t.toJD()+e*("w"===n?this.daysInWeek():1),i=t.calendar().fromJD(r);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var o=t.year()+("y"===n?e:0),a=t.monthOfYear()+("m"===n?e:0),i=t.day();"y"===n?(t.month()!==this.fromMonthOfYear(o,a)&&(a=this.newDate(o,t.month(),this.minDay).monthOfYear()),a=Math.min(a,this.monthsInYear(o)),i=Math.min(i,this.daysInMonth(o,this.fromMonthOfYear(o,a)))):"m"===n&&(!function(t){for(;ae-1+t.minMonth;)o++,a-=e,e=t.monthsInYear(o)}(this),i=Math.min(i,this.daysInMonth(o,this.fromMonthOfYear(o,a))));var s=[o,this.fromMonthOfYear(o,a),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,n,r){if(!(this.hasYearZero||"y"!==r&&"m"!==r||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[r],o=n<0?-1:1;e=this._add(t,n*i[0]+o*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,n){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var r="y"===n?e:t.year(),i="m"===n?e:t.month(),o="d"===n?e:t.day();return"y"!==n&&"m"!==n||(o=Math.min(o,this.daysInMonth(r,i))),t.date(r,i,o)},isValid:function(t,e,n){this._validateLevel++;var r=this.hasYearZero||0!==t;if(r){var i=this.newDate(t,e,this.minDay);r=e>=this.minMonth&&e-this.minMonth=this.minDay&&n-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,n){var r=this._validate(t,e,n,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(r.year(),r.month()-1,r.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new r;u.cdate=i,u.baseCalendar=a,u.calendars.gregorian=s},{470:470}],1314:[function(t,e,n){var r=t(470),i=t(1313);r(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],r(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),r(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,n){if("string"!=typeof t&&(n=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var r=(n=n||{}).dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,a=n.monthNumbers||this.local.monthNumbers,s=n.monthNamesShort||this.local.monthNamesShort,l=n.monthNames||this.local.monthNames,u=(n.calculateWeek||this.local.calculateWeek,function(e,n){for(var r=1;v+r1}),c=function(t,e,n,r){var i=""+e;if(u(t,r))for(;i.length1},x=function(t,n){var r=y(t,n),o=[2,3,r?4:2,r?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],a=new RegExp("^-?\\d{1,"+o+"}"),s=e.substring(M).match(a);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},b=this,_=function(t,n,r,o){for(var a=y(t,o)?r:n,s=0;s-1){d=1,p=m;for(var A=this.daysInMonth(f,d);p>A;A=this.daysInMonth(f,d))d++,p-=A}return h>-1?this.fromJD(h):this.newDate(f,d,p)},determineDate:function(t,e,n,r,i){n&&"object"!=typeof n&&(i=r,r=n,n=null),"string"!=typeof r&&(i=r,r="");var o=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return o.parseDate(r,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&n?n.newDate():null)||o.today(),a=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=a.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=a.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:o.today().add(t,"d"):o.newDate(t)}})},{1313:1313,470:470}],1315:[function(t,e,n){e.exports=t(86)({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{86:86}],1316:[function(t,e,n){"use strict";e.exports=function(t,e){var n=[];return e=+e||0,r(t.hi(t.shape[0]-1),n,e),n};var r=t(1315)},{1315:1315}],1317:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;nthis.props.revision}},{key:"componentDidMount",value:function(){var e=this;this.p=this.p.then(function(){return t.newPlot(e.el,{data:e.props.data,layout:e.sizeAdjustedLayout(e.props.layout),config:e.props.config,frames:e.props.frames})}).then(function(){return e.syncWindowResize(null,!1)}).then(this.syncEventHandlers).then(this.attachUpdateEvents).then(function(){return e.props.onInitialized&&e.props.onInitialized(e.el)}).catch(function(t){return console.error("Error while plotting:",t),e.props.onError&&e.props.onError()})}},{key:"componentWillUpdate",value:function(n){var r=this,i=this.sizeAdjustedLayout(n.layout);this.p=this.p.then(function(){return e?t.react(r.el,{data:n.data,layout:i,config:n.config,frames:n.frames}):t.newPlot(r.el,{data:n.data,layout:i,config:n.config,frames:n.frames})}).then(function(){return r.syncEventHandlers(n)}).then(function(){return r.syncWindowResize(n)}).then(this.attachUpdateEvents).then(function(){return r.handleUpdate(n)}).catch(function(t){console.error("Error while plotting:",t),r.props.onError&&r.props.onError(t)})}},{key:"componentWillUnmount",value:function(){this.resizeHandler&&m&&(window.removeEventListener("resize",this.handleResize),this.resizeHandler=null),this.removeUpdateEvents(),t.purge(this.el)}},{key:"attachUpdateEvents",value:function(){for(var t=this,e=0;e