Skip to content

Instantly share code, notes, and snippets.

@ionelmc
Last active February 12, 2020 09:26
Show Gist options
  • Save ionelmc/1521c5a87df8cf49a23d to your computer and use it in GitHub Desktop.
Save ionelmc/1521c5a87df8cf49a23d to your computer and use it in GitHub Desktop.
A JSON parser benchmark. See README.rst for instructions.
*.cbor
*.log
*.xml
*.yaml
*.json
*.msgpack
*.html
*.marshal
*.pickle
.tox
.idea
.cache
*.pyc

A JSON parsing benchmark

Test code for http://blog.ionelmc.ro/2015/11/22/memory-use-and-speed-of-json-parsers/

Usage

To run:

tox

To run with different dataset (example: canada.json):

tox -- canada.json

For a VERY big data set download (you need tons of RAM for that): https://github.com/zemirco/sf-city-lots-json/raw/master/citylots.json

Other datasets you can try: https://github.com/miloyip/nativejson-benchmark/tree/master/data

If you only want to compare few implementations then run:

BM_IMPL='json simplejson msgpack' tox

On Windows (note that memory measurements are disabled there):

set BM_IMPL=json simplejson msgpack
tox

To bind to a different CPU (default is 0):

BM_CPU='1' tox

CPU binding helps a bit during speed tests, as code is single-threaded.

Measure memory differently: you can use ru_maxrss instead of valgrind (similar to what GNU /bin/time does with %M):

BM_MEM=maxrss tox

Implementations

Implementations that are tested by default:

  • cbor
  • cjson
  • cPickle
  • ijson
  • json
  • jsonlib
  • jsonlib2
  • jsonstreamer
  • msgpack
  • pickle
  • rapidjson
  • simplejson
  • ujson
  • yajl

Extra implementations not included in the defafult BM_IMPL:

  • marshal
  • pyjsmn
  • ruamel.yaml
  • yaml
  • lxml

To test everything plus lxml:

BM_IMPL_ADD='lxml' tox

To test just cbor and msgpack:

BM_IMPL='cbor msgpack' tox

Dependencies

pip install tox

Ubuntu

You might need to run:

apt-get install build-essential git-core python-dev python3.5-dev valgrind libyajl2 libyajl-dev

Python 3.5 is available from the Deadsnakes PPA:

apt-add-repository ppa:fkrull/deadsnakes
def pytest_benchmark_generate_json(config, benchmarks, include_data):
from pytest_benchmark.plugin import pytest_benchmark_generate_json
return pytest_benchmark_generate_json(config=config, benchmarks=benchmarks, include_data=False)
import json
import sys
import dicttoxml
import marshal
import msgpack
import yaml
import cbor
from util import is_format_needed
try:
import cPickle as pickle
except ImportError:
import pickle
if __name__ == '__main__':
if len(sys.argv) > 1:
with open(sys.argv[1]) as fh:
data = json.load(fh)
else:
data = {
"foo": [{
"bar": [
'A"\\ :,;\n1' * 20000000,
],
"b": [
1, 0.333, True,
],
"c": None,
}]
}
if is_format_needed('json'):
with open('data.json', 'w') as fh:
print('Creating data.json ...')
json.dump(data, fh)
if is_format_needed('yaml'):
with open('data.yaml', 'w') as fh:
print('Creating data.yaml ...')
yaml.dump(data, fh)
if is_format_needed('msgpack'):
with open('data.msgpack', 'wb') as fh:
print('Creating data.msgpack ...')
msgpack.dump(data, fh, use_bin_type=True)
if is_format_needed('pickle'):
with open('data.pickle', 'wb') as fh:
print('Creating data.pickle ...')
pickle.dump(data, fh, protocol=pickle.HIGHEST_PROTOCOL)
if is_format_needed('marshal'):
with open('data.marshal', 'wb') as fh:
print('Creating data.marshal ...')
marshal.dump(data, fh)
if is_format_needed('xml'):
with open('data.xml', 'wb') as fh:
print('Creating data.xml ...')
fh.write(dicttoxml.dicttoxml(data))
if is_format_needed('cbor'):
with open('data.cbor', 'wb') as fh:
print('Creating data.cbor ...')
cbor.dump(data, fh)
#!/usr/bin/env python
from __future__ import division
import argparse
import os
import sys
from util import IMPLEMENTATIONS
from util import get_loader
from util import open_data
backend = os.getenv("BM_MEM", "valgrind").lower()
def run(impl):
with open_data(impl) as fh:
data = fh.read()
loader = get_loader(impl)
loader(data)
parser = argparse.ArgumentParser()
parser.add_argument('--save')
parser.add_argument('impl', nargs="?")
if __name__ == '__main__':
args = parser.parse_args()
if args.impl:
run(args.impl)
else:
import operator
import subprocess
results = {}
for impl in IMPLEMENTATIONS:
try:
__import__(impl)
except ImportError:
continue
print('Testing memory use for %r ...' % impl)
if backend == 'valgrind':
massif_log = './massif-%s.log' % impl
subprocess.check_call([
# 'strace',
# '-o',
# './strace-%s.log' % impl,
'valgrind',
'--tool=massif',
'--massif-out-file=%s' % massif_log,
'--pages-as-heap=yes',
'--heap=yes',
'--threshold=0',
'--max-snapshots=1000',
'--peak-inaccuracy=0',
sys.executable,
__file__,
impl
])
memory = 0
with open(massif_log) as fh:
for line in fh:
if line.startswith('mem_heap_B='):
memory = max(memory, int(line.split('=')[-1]))
results[impl] = memory
elif backend == 'maxrss':
pid = os.fork()
if pid:
_, exit_code, usage = os.wait4(pid, 0)
if exit_code:
raise RuntimeError("Failed to run loader. Exit code: %s. Used: %s Mb" % (
exit_code, usage.ru_maxrss / 1024
))
results[impl] = usage.ru_maxrss * 1024
else:
try:
run(impl)
except Exception:
import traceback
traceback.print_exc()
os._exit(5)
finally:
os._exit(0)
else:
raise RuntimeError("Unknown BM_MEM backend %r" % backend)
print('MEMORY USAGE:')
for impl, memory in sorted(results.items(), key=operator.itemgetter(1)):
print('{:>20}: {:>7,.1f} Mb'.format(impl, memory / 1024 / 1024))
if args.save:
import json
dirname = os.path.dirname(args.save)
if not os.path.exists(dirname):
os.makedirs(dirname)
with open(args.save, 'w') as fh:
json.dump(results, fh)
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import pathlib\n",
"import json\n",
"\n",
"from fields import Fields, Namespace\n",
"from collections import defaultdict\n",
"from itertools import chain"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"data = defaultdict(lambda: defaultdict(lambda: defaultdict(~Fields.memory[None].time[None])))\n",
"for name in pathlib.Path('.bm').iterdir():\n",
" for run in name.glob('*.json'):\n",
" env, kind = run.stem.split('.')\n",
" if kind == 'memory':\n",
" for impl, memory in json.load(run.open()).items():\n",
" data[name.stem][impl][env].memory = memory\n",
" elif kind == 'speed':\n",
" for bench in json.load(run.open())['benchmarks']:\n",
" impl = bench['name'].split('[')[1].strip(']')\n",
" data[name.stem][impl][env].time = bench['stats']['min'] "
]
},
{
"cell_type": "raw",
"metadata": {
"collapsed": false
},
"source": [
"data"
]
},
{
"cell_type": "raw",
"metadata": {
"collapsed": false
},
"source": [
"import colorlover\n",
"from IPython.display import HTML\n",
"\n",
"total = len(set(chain.from_iterable(data.values())))\n",
"\n",
"cmatrix = {}\n",
"for size, kinds in colorlover.scales.items():\n",
" if int(size) < 9:\n",
" continue\n",
" cmatrix[size] = {}\n",
" for kind, names in kinds.items():\n",
" if kind != 'qual':\n",
" continue\n",
" cmatrix[size][kind] = {}\n",
" for name, colors in names.items():\n",
" cmatrix[size][kind][name] = colorlover.interp(colors, total+3)\n",
"\n",
"ctable = cmatrix['12']['qual']['Set3']\n",
"\n",
"HTML(colorlover.to_html(cmatrix))"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from plotly import graph_objs\n",
"\n",
"plots = []\n",
"\n",
"def circle(it):\n",
" data = list(it)\n",
" if len(data) > 2:\n",
" data.append(data[0])\n",
" return data\n",
"\n",
"ctable = ['#555555', '#888888', '#9D9D9D', '#DDDDDD', '#BE2633', '#E06F8B', '#493C2B', '#A46422', \n",
" '#EB8931', '#F7E26B', '#2F484E', '#44891A', '#A3CE27', '#1B2632', '#31A2F2', '#B2DCEF']\n",
"ctable = ['#CCCCCC', '#3A3A01', '#106300', '#008C5D', '#005BB7', '#4A00E0', '#FF00D4', '#FF0000', \n",
" '#FFD400', '#54FF00', '#07FF83', '#35BBFF', '#7B60FF', '#FF87FF', '#FFB2BF', '#FFF3DD']\n",
"ctable = ['#999999', '#2E3A01', '#016300', '#008C69', '#0058B7', '#3F00E0', '#FF00F2', '#FF002E',\n",
" '#FF9400', '#A5FF00', '#07FF24', '#35FFE7', '#6098FF', '#B987FF', '#FFB2F0', '#FFDDDF']\n",
"for name, results in data.items():\n",
" plot_data = []\n",
" for counter, item in enumerate(results.items()):\n",
" impl, runs = item\n",
" plot_data.append(graph_objs.Scatter(\n",
" x=circle(k.time for k in runs.values()),\n",
" y=circle(k.memory for k in runs.values()),\n",
" mode='lines+markers',\n",
" marker=dict(\n",
" color=ctable[counter],\n",
" size=12,\n",
" line=dict(\n",
" color='#FFF',\n",
" width=1\n",
" )),\n",
" line=dict(width=4),\n",
" name=impl,\n",
" text=list(runs),\n",
" \n",
" ))\n",
"\n",
" layout = graph_objs.Layout(\n",
" title='Memory usage v. Speed (test data: %s)' % name,\n",
" hovermode='closest',\n",
" xaxis=dict(\n",
" title='Speed (minimum seconds)',\n",
" ticklen=5,\n",
" zeroline=False,\n",
" gridwidth=2,\n",
" ),\n",
" yaxis=dict(\n",
" title='Memory',\n",
" ticklen=5,\n",
" gridwidth=2,\n",
" ),\n",
" )\n",
" fig = graph_objs.Figure(data=plot_data, layout=layout)\n",
" plots.append((name, fig))"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<script type=\"text/javascript\">require=requirejs=define=undefined;</script><script type=\"text/javascript\">!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 e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l=\"function\"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error(\"Cannot find module '\"+o+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a=\"function\"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){\"use strict\";var n=t(\"../src/plotly\"),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 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-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;\",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 a in i){var o=a.replace(/^,/,\" ,\").replace(/X/g,\".js-plotly-plot .plotly\").replace(/Y/g,\".plotly-notifier\");n.Lib.addStyleRule(o,i[a])}},{\"../src/plotly\":330}],2:[function(t,e,r){\"use strict\";e.exports={ascent:850,descent:-150,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\"},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\"},\"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\"},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\"},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\"},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\"},zoom_minus:{width:1e3,path:\"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z\"},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\"},tooltip_basic:{width:1500,path:\"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z\"},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\"},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\"},\"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\"},\"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\"},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\"},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\"},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\"}}},{}],3:[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<this.dimension;++n)this.bounds[0][n]=-(1/0),this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}function a(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if(\"number\"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if(\"number\"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error(\"state and velocity lengths must match\");return new i(t,e,r)}}e.exports=o;var s=t(\"cubic-hermite\"),l=t(\"binary-search-bounds\"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;0>=e||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(0>i)for(var f=c-1,d=0;c>d;++d,--f)a[d]=o[f];else if(i>=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;c>d;++d,--f)a[d]=o[f]+p*u[f];else{for(var f=c*(i+1)-1,g=e[i],v=e[i+1],m=v-g||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;c>d;++d,--f)y[d]=o[f],x[d]=u[f]*m,b[d]=o[f+c],_[d]=u[f+c]*m,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;c>d;++d)a[d]=y[d];else s(y,x,b,_,(t-g)/m,a)}for(var k=h[0],A=h[1],d=0;c>d;++d)a[d]=n(k[d],A[d],a[d]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,h=(t-e[r-1],0);u>h;++h,--c)i[h]=o[c];else{for(var c=u*(n+1)-1,f=e[n],d=e[n+1],p=d-f||1,g=this._scratch[1],v=this._scratch[2],m=this._scratch[3],y=this._scratch[4],b=!0,h=0;u>h;++h,--c)g[h]=a[c],m[h]=o[c]*p,v[h]=a[c+u],y[h]=o[c+u]*p,b=b&&g[h]===v[h]&&m[h]===y[h]&&0===m[h];if(b)for(var h=0;u>h;++h)i[h]=0;else{s.derivative(g,m,v,y,(t-f)/p,i);for(var h=0;u>h;++h)i[h]/=p}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||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];this._time.push(e,t);for(var c=0;2>c;++c)for(var h=0;r>h;++h)i.push(i[o++]),a.push(0);this._time.push(t);for(var h=r;h>0;--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(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-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(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,i=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(t);for(var l=e;l>0;--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(!(e>=t||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(!(e>t)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{\"binary-search-bounds\":4,\"cubic-hermite\":5}],4:[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){var a=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(\"\"));return a()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],5:[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},{}],6:[function(t,e,r){function n(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}e.exports=n},{}],7:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],8:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],9:[function(t,e,r){function n(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}e.exports=n},{}],10:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],11:[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){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}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 g=n.prototype;g.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(0>r)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;16>u;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;16>u;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;16>u;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(1e-6>c||f)for(var u=0;16>u;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[6],d(g,g);var v=this.computedInverse;s(v,n);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;3>u;++u)b[u]=m[u]-n[2+4*u]*x}},g.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;16>n;++n)e.push(e[r++]);this._time.push(t)}},g.flush=function(t){var e=a.gt(this._time,t)-2;0>e||(this._time.slice(0,e),this._components.slice(0,16*e))},g.lastT=function(){return this._time[this._time.length-1]},g.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,h(this.computedMatrix,e,r,n));for(var i=0,a=0;3>a;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},g.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];g.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;f(i,i,v),this.setMatrix(t,s(i,i))},g.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;f(i,i,v),this.setMatrix(t,i)},g.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;16>r;++r)this._components.push(e[r])}},g.setDistance=function(t,e){this.computedRadius[0]=e},g.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},g.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{\"binary-search-bounds\":12,\"gl-mat4/invert\":78,\"gl-mat4/lookAt\":79,\"gl-mat4/rotateX\":83,\"gl-mat4/rotateY\":84,\"gl-mat4/rotateZ\":85,\"gl-mat4/scale\":86,\"gl-mat4/translate\":87,\"gl-vec3/normalize\":10,\"mat4-interpolate\":13}],12:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],13:[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):!1}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\":74,\"gl-vec3/lerp\":9,\"mat4-decompose\":14,\"mat4-recompose\":16,\"quat-slerp\":17}],14:[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}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t(\"./normalize\"),s=t(\"gl-mat4/create\"),l=t(\"gl-mat4/clone\"),u=t(\"gl-mat4/determinant\"),c=t(\"gl-mat4/invert\"),h=t(\"gl-mat4/transpose\"),f={length:t(\"gl-vec3/length\"),normalize:t(\"gl-vec3/normalize\"),dot:t(\"gl-vec3/dot\"),cross:t(\"gl-vec3/cross\")},d=s(),p=s(),g=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],k=d[12],A=d[13],M=d[14],L=d[15];if(0!==x||0!==_||0!==w){g[0]=x,g[1]=_,g[2]=w,g[3]=L;var T=c(p,p);if(!T)return!1;h(p,p),n(y,g,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=k,e[1]=A,e[2]=M,i(v,d),r[0]=f.length(v[0]),f.normalize(v[0],v[0]),s[0]=f.dot(v[0],v[1]),a(v[1],v[1],v[0],1,-s[0]),r[1]=f.length(v[1]),f.normalize(v[1],v[1]),s[0]/=r[1],s[1]=f.dot(v[0],v[2]),a(v[2],v[2],v[0],1,-s[1]),s[2]=f.dot(v[1],v[2]),a(v[2],v[2],v[1],1,-s[2]),r[2]=f.length(v[2]),f.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],f.cross(m,v[1],v[2]),f.dot(v[0],m)<0)for(var E=0;3>E;E++)r[E]*=-1,v[E][0]*=-1,v[E][1]*=-1,v[E][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[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\":15,\"gl-mat4/clone\":72,\"gl-mat4/create\":73,\"gl-mat4/determinant\":74,\"gl-mat4/invert\":78,\"gl-mat4/transpose\":88,\"gl-vec3/cross\":6,\"gl-vec3/dot\":7,\"gl-vec3/length\":8,\"gl-vec3/normalize\":10}],15:[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;16>i;i++)t[i]=e[i]*n;return!0}},{}],16:[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\":73,\"gl-mat4/fromRotationTranslation\":76,\"gl-mat4/identity\":77,\"gl-mat4/multiply\":80,\"gl-mat4/scale\":86,\"gl-mat4/translate\":87}],17:[function(t,e,r){e.exports=t(\"gl-quat/slerp\")},{\"gl-quat/slerp\":18}],18:[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],g=r[2],v=r[3];return a=u*d+c*p+h*g+f*v,0>a&&(a=-a,d=-d,p=-p,g=-g,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*g,t[3]=s*f+l*v,t}e.exports=n},{}],19:[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},{}],20:[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;3>l;++l){for(var u=0,h=0;3>h;++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;16>n;++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 g=a[2],v=a[6],m=a[10],y=g*o+v*s+m*l,b=g*c+v*h+m*f;g-=y*o+b*c,v-=y*s+b*h,m-=y*l+b*f;var x=n(g,v,m);g/=x,v/=x,m/=x;var _=c*e+o*r,w=h*e+s*r,k=f*e+l*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(t,Math.log(A))},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],g=o[10],v=e*s+r*c,m=e*l+r*h,y=e*u+r*f,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),k=i(b,x,_,w);k>1e-6?(b/=k,x/=k,_/=k,w/=k):(b=x=_=0,w=1);var A=this.computedRotation,M=A[0],L=A[1],T=A[2],E=A[3],C=M*w+E*b+L*_-T*x,S=L*w+E*x+T*b-M*_,z=T*w+E*_+M*x-L*b,P=E*w-M*b-L*x-T*_;if(a){b=d,x=p,_=g;var j=Math.sin(a)/n(b,x,_);b*=j,x*=j,_*=j,w=Math.cos(e),C=C*w+P*b+S*_-z*x,S=S*w+P*x+z*b-C*_,z=z*w+P*_+C*x-S*b,P=P*w-C*b-S*x-z*_}var O=i(C,S,z,P);O>1e-6?(C/=O,S/=O,z/=O,P/=O):(C=S=z=0,P=1),this.rotation.set(t,C,S,z,P)},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;3>l;++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\":19,\"filtered-vector\":3,\"gl-mat4/fromQuat\":75,\"gl-mat4/invert\":78,\"gl-mat4/lookAt\":79}],21:[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){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.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;3>s;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;3>s;++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;16>u;++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 g=d(r,p)/s,v=d(i,p)/s;u=Math.acos(g),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;3>o;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;3>o;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;3>o;++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],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,k=b,A=-v*b,M=-m*b,L=y,T=this.computedEye,E=this.computedMatrix,o=0;3>o;++o){var C=_*r[o]+w*c[o]+k*e[o];E[4*o+1]=A*r[o]+M*c[o]+L*e[o],E[4*o+2]=C,E[4*o+3]=0}var S=E[1],z=E[5],P=E[9],j=E[2],O=E[6],I=E[10],D=z*I-P*O,R=P*j-S*I,F=S*O-z*j,N=n(D,R,F);D/=N,R/=N,F/=N,E[0]=D,E[4]=R,E[8]=F;for(var o=0;3>o;++o)T[o]=x[o]+E[2+4*o]*d;for(var o=0;3>o;++o){for(var l=0,B=0;3>B;++B)l+=E[o+4*B]*T[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;16>n;++n)e[n]=r[n];return e}return r};var g=[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;g[0]=i[2],g[1]=i[6],g[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;3>l;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,g);for(var l=0;3>l;++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,\n",
"f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var g=c*e+o*r,v=h*e+s*r,m=f*e+l*r;this.center.move(t,g,v,m);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),(0>o||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),g=Math.max(f,d,p);f===g?(l=0>l?-1:1,c=h=0):p===g?(h=0>h?-1:1,l=c=0):(c=0>c?-1:1,l=h=0)}else{var v=n(l,c,h);l/=v,c/=v,h/=v}var m=e[s],y=e[s+4],b=e[s+8],x=m*l+y*c+b*h;m-=l*x,y-=c*x,b-=h*x;var _=n(m,y,b);m/=_,y/=_,b/=_;var w=c*b-h*y,k=h*m-l*b,A=l*y-c*m,M=n(w,k,A);w/=M,k/=M,A/=M,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,l,c,h),this.right.jump(t,m,y,b);var L,T;if(2===o){var E=e[1],C=e[5],S=e[9],z=E*m+C*y+S*b,P=E*w+C*k+S*A;L=0>D?-Math.PI/2:Math.PI/2,T=Math.atan2(P,z)}else{var j=e[2],O=e[6],I=e[10],D=j*l+O*c+I*h,R=j*m+O*y+I*b,F=j*w+O*k+I*A;L=Math.asin(i(D)),T=Math.atan2(F,R)}this.angle.jump(t,T,L),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*W,G-B*W,Y-U*W)},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(!(1e-6>u)){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(!(1e-6>d)){c/=d,h/=d,f/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=o*g+s*v+l*m;g-=y*o,v-=y*s,m-=y*l;var b=n(g,v,m);if(!(.01>b&&(g=s*f-l*h,v=l*c-o*f,m=o*h-s*c,b=n(g,v,m),1e-6>b))){g/=b,v/=b,m/=b,this.up.set(t,o,s,l),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*m-l*v,_=l*g-o*m,w=o*v-s*g,k=n(x,_,w);x/=k,_/=k,w/=k;var A=o*c+s*h+l*f,M=g*c+v*h+m*f,L=x*c+_*h+w*f,T=Math.asin(i(A)),E=Math.atan2(L,M),C=this.angle._state,S=C[C.length-1],z=C[C.length-2];S%=2*Math.PI;var P=Math.abs(S+2*Math.PI-E),j=Math.abs(S-E),O=Math.abs(S-2*Math.PI-E);j>P&&(S+=2*Math.PI),j>O&&(S-=2*Math.PI),this.angle.jump(this.angle.lastT(),S,z),this.angle.set(t,E,T)}}}}},{\"filtered-vector\":3,\"gl-mat4/invert\":78,\"gl-mat4/rotate\":82,\"gl-vec3/cross\":6,\"gl-vec3/dot\":7,\"gl-vec3/normalize\":10}],22:[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,u=[[\"flush\",1],[\"idle\",1],[\"lookAt\",4],[\"rotate\",4],[\"pan\",4],[\"translate\",4],[\"setMatrix\",2],[\"setDistanceLimits\",2],[\"setDistance\",2]];u.forEach(function(t){for(var e=t[0],r=[],n=0;n<t[1];++n)r.push(\"a\"+n);var i=\"var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i].\"+t[0]+\"(\"+r.join()+\")}\";l[e]=Function.apply(null,r.concat(i))}),l.recalcMatrix=function(t){this._active.recalcMatrix(t)},l.getDistance=function(t){return this._active.getDistance(t)},l.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},l.lastT=function(){return this._active.lastT()},l.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(0>e)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,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}}},l.getMode=function(){return this._mode}},{\"matrix-camera-controller\":11,\"orbit-camera-controller\":20,\"turntable-camera-controller\":21}],23:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t(\"alpha-complex\"),a=t(\"simplicial-complex-boundary\")},{\"alpha-complex\":24,\"simplicial-complex-boundary\":27}],24:[function(t,e,r){\"use strict\";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;i<r.length;++i)n[i]=e[r[i]];return a(n)*t<1})}e.exports=n;var i=t(\"delaunay-triangulate\"),a=t(\"circumradius\")},{circumradius:25,\"delaunay-triangulate\":54}],25:[function(t,e,r){function n(t){for(var e=i(t),r=0,n=0;n<t.length;++n)for(var a=t[n],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)}e.exports=n;var i=t(\"circumcenter\")},{circumcenter:26}],26:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0,n=t.length,i=0;n>i;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,o([t.length+1,t.length+1],1)),i=o([t.length+1],1);r[e][e]=0;for(var a=0;e>a;++a){for(var l=0;a>=l;++l)r[l][a]=r[a][l]=2*n(t[a],t[l]);i[a]=n(t[a],t[a])}for(var u=s(r,i),c=0,h=u[e+1],a=0;a<h.length;++a)c+=h[a];for(var f=new Array(e),a=0;e>a;++a){for(var h=u[a],d=0,l=0;l<h.length;++l)d+=h[l];f[a]=d/c}return f}function a(t){if(0===t.length)return[];for(var e=t[0].length,r=o([e]),n=i(t),a=0;a<t.length;++a)for(var s=0;e>s;++s)r[s]+=t[a][s]*n[a];return r}var o=t(\"dup\"),s=t(\"robust-linear-solve\");a.barycenetric=i,e.exports=a},{dup:55,\"robust-linear-solve\":192}],27:[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\":28,\"reduce-simplicial-complex\":31}],28:[function(t,e,r){\"use strict\";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r+=t[n].length;for(var i=new Array(r),a=0,n=0;e>n;++n)for(var o=t[n],s=o.length,l=0;s>l;++l)for(var u=i[a++]=new Array(s-1),c=1;s>c;++c)u[c-1]=o[(l+c)%s];return i}e.exports=n},{}],29:[function(t,e,r){\"use strict\";function n(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;r>n;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}e.exports=n},{}],30:[function(t,e,r){\"use strict\";function n(t,e){return i(t,e)||a(t)-a(e)}var i=t(\"compare-cell\"),a=t(\"cell-orientation\");e.exports=n},{\"cell-orientation\":29,\"compare-cell\":41}],31:[function(t,e,r){\"use strict\";function n(t){t.sort(a);for(var e=t.length,r=0,n=0;e>n;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){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\":29,\"compare-cell\":41,\"compare-oriented-cell\":30}],32:[function(t,e,r){\"use strict\";var n=function(){function t(t){return!Array.isArray(t)&&null!==t&&\"object\"==typeof t}function e(t,e,r){for(var n=(e-t)/(r-1),i=[],a=0;r>a;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;r>i;i++){n[i]=[];for(var a=0;a<t.length;++a)n[i][a]=t[a][i]}return n}function n(t,e,r){for(var n=Math.min.apply(null,[t.length,e.length,r.length]),i=[],a=0;n>a;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n<t.length;n++)Array.isArray(t[n])?e(t[n],r):r+=t[n]}var r=0;return e(t,r),r}function a(t){for(var e=[],r=0;r<t.length;++r){e[r]=[];for(var n=0;n<t[r].length;++n)e[r][n]=t[r][n]}return e}function o(t){for(var e=[],r=0;r<t.length;++r)e[r]=t[r];return e}function s(t,e){if(t.length!==e.length)return!1;for(var r=t.length;r--;)if(t[r]!==e[r])return!1;return!0}function l(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])),!e)for(var i=0;3>i;++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;3>i;++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};e.exports=n()},{}],33:[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}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<<i-1,r.sign=function(t){return(t>0)-(0>t)},r.abs=function(t){var e=t>>i-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(e>t)},r.max=function(t,e){return t^(t^e)&-(e>t)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<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,e|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,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(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,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var a=new Array(256);!function(t){for(var e=0;256>e;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(a),r.reverse=function(t){return a[255&t]<<24|a[t>>>8&255]<<16|a[t>>>16&255]<<8|a[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),t<<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),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],34:[function(t,e,r){(function(e){function n(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&\"function\"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(r){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t){return this instanceof a?(this.length=0,this.parent=void 0,\"number\"==typeof t?o(this,t):\"string\"==typeof t?s(this,t,arguments.length>1?arguments[1]:\"utf8\"):l(this,t)):arguments.length>1?new a(t,arguments[1]):new a(t)}function o(t,e){if(t=g(t,0>e?0:0|v(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;r++)t[r]=0;return t}function s(t,e,r){(\"string\"!=typeof r||\"\"===r)&&(r=\"utf8\");var n=0|y(e,r);return t=g(t,n),t.write(e,r),t}function l(t,e){if(a.isBuffer(e))return u(t,e);if(Q(e))return c(t,e);if(null==e)throw new TypeError(\"must start with number, buffer, array or string\");if(\"undefined\"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return h(t,e);if(e instanceof ArrayBuffer)return f(t,e)}return e.length?d(t,e):p(t,e)}function u(t,e){var r=0|v(e.length);return t=g(t,r),e.copy(t,0,0,r),t}function c(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function h(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function f(t,e){return a.TYPED_ARRAY_SUPPORT?(e.byteLength,t=a._augment(new Uint8Array(e))):t=h(t,new Uint8Array(e)),t}function d(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function p(t,e){var r,n=0;\"Buffer\"===e.type&&Q(e.data)&&(r=e.data,n=0|v(r.length)),t=g(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function g(t,e){a.TYPED_ARRAY_SUPPORT?(t=a._augment(new Uint8Array(e)),t.__proto__=a.prototype):(t.length=e,t._isBuffer=!0);var r=0!==e&&e<=a.poolSize>>>1;return r&&(t.parent=$),t}function v(t){if(t>=i())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+i().toString(16)+\" bytes\");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var r=new a(t,e);return delete r.parent,r}function y(t,e){\"string\"!=typeof t&&(t=\"\"+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case\"ascii\":case\"binary\":case\"raw\":case\"raws\":return r;case\"utf8\":case\"utf-8\":return q(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return Y(t).length;default:if(n)return q(t).length;e=(\"\"+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t=\"utf8\"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return\"\";for(;;)switch(t){case\"hex\":return z(this,e,r);case\"utf8\":case\"utf-8\":return T(this,e,r);case\"ascii\":return C(this,e,r);case\"binary\":return S(this,e,r);case\"base64\":return L(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return P(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new Error(\"Invalid hex string\");n>a/2&&(n=a/2);for(var o=0;n>o;o++){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))throw new Error(\"Invalid hex string\");t[r+o]=s}return o}function _(t,e,r,n){return W(q(e,t.length-r),t,r,n)}function w(t,e,r,n){return W(H(e),t,r,n)}function k(t,e,r,n){return w(t,e,r,n)}function A(t,e,r,n){return W(Y(e),t,r,n)}function M(t,e,r,n){return W(G(e,t.length-r),t,r,n)}function L(t,e,r){return 0===e&&r===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;r>i;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(r>=i+s){var l,u,c,h;switch(s){case 1:128>a&&(o=a);break;case 2:l=t[i+1],128===(192&l)&&(h=(31&a)<<6|63&l,h>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,h>2047&&(55296>h||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,h>65535&&1114112>h&&(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(K>=e)return String.fromCharCode.apply(String,t);for(var r=\"\",n=0;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=K));return r}function C(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function S(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function z(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i=\"\",a=e;r>a;a++)i+=V(t[a]);return i}function P(t,e,r){for(var n=t.slice(e,r),i=\"\",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function j(t,e,r){if(t%1!==0||0>t)throw new RangeError(\"offset is not uint\");if(t+e>r)throw new RangeError(\"Trying to access beyond buffer length\")}function O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError(\"buffer must be a Buffer instance\");if(e>i||o>e)throw new RangeError(\"value is out of bounds\");if(r+n>t.length)throw new RangeError(\"index out of range\")}function I(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);a>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);a>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function R(t,e,r,n,i,a){if(e>i||a>e)throw new RangeError(\"value is out of bounds\");if(r+n>t.length)throw new RangeError(\"index out of range\");if(0>r)throw new RangeError(\"index out of range\")}function F(t,e,r,n,i){return i||R(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,i){return i||R(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function B(t){if(t=U(t).replace(tt,\"\"),t.length<2)return\"\";for(;t.length%4!==0;)t+=\"=\";return t}function U(t){return t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,\"\")}function V(t){return 16>t?\"0\"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;n>o;o++){if(r=t.charCodeAt(o),r>55295&&57344>r){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(56320>r){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=i-55296<<10|r-56320|65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,128>r){if((e-=1)<0)break;a.push(r)}else if(2048>r){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))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 H(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e}function G(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);o++)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function Y(t){return X.toByteArray(B(t))}function W(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}var X=t(\"base64-js\"),Z=t(\"ieee754\"),Q=t(\"is-array\");r.Buffer=a,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50,a.poolSize=8192;var $={};a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array),a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError(\"Arguments must be Buffers\");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);o>i&&t[i]===e[i];)++i;return i!==o&&(r=t[i],n=e[i]),n>r?-1:r>n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"raw\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},a.concat=function(t,e){if(!Q(t))throw new TypeError(\"list argument must be an Array of Buffers.\");if(0===t.length)return new a(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;r++)e+=t[r].length;var n=new a(e),i=0;for(r=0;r<t.length;r++){var o=t[r];o.copy(n,i),i+=o.length}return n},a.byteLength=y,a.prototype.length=void 0,a.prototype.parent=void 0,a.prototype.toString=function(){var t=0|this.length;return 0===t?\"\":0===arguments.length?T(this,0,t):b.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");return this===t?!0:0===a.compare(this,t)},a.prototype.inspect=function(){var t=\"\",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString(\"hex\",0,e).match(/.{2}/g).join(\" \"),this.length>e&&(t+=\" ... \")),\"<Buffer \"+t+\">\"},a.prototype.compare=function(t){if(!a.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");return this===t?0:a.compare(this,t)},a.prototype.indexOf=function(t,e){function r(t,e,r){for(var n=-1,i=0;r+i<t.length;i++)if(t[r+i]===e[-1===n?0:i-n]){if(-1===n&&(n=i),i-n+1===e.length)return r+n}else n=-1;return-1}if(e>2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),\"string\"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(a.isBuffer(t))return r(this,t,e);if(\"number\"==typeof t)return a.TYPED_ARRAY_SUPPORT&&\"function\"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError(\"val must be string, number or Buffer\")},a.prototype.get=function(t){return console.log(\".get() is deprecated. Access using array indexes instead.\"),this.readUInt8(t)},a.prototype.set=function(t,e){return console.log(\".set() is deprecated. Access using array indexes instead.\"),this.writeUInt8(t,e)},a.prototype.write=function(t,e,r,n){if(void 0===e)n=\"utf8\",r=this.length,e=0;else if(void 0===r&&\"string\"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n=\"utf8\")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError(\"attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!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\"binary\":return k(this,t,e,r);case\"base64\":return A(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return M(this,t,e,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=a._augment(this.subarray(t,e));else{var i=e-t;n=new a(i,void 0);for(var o=0;i>o;o++)n[o]=this[o+t]}return n.length&&(n.parent=this.parent||this),n},a.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},a.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||j(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},a.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||j(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||j(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||j(t,4,this.length),Z.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),Z.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),Z.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||j(t,8,this.length),Z.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||O(this,t,e,r,Math.pow(2,8*r),0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||O(this,t,e,r,Math.pow(2,8*r),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},a.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=0,o=1,s=0>t?1:0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0>t?1:0;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},a.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&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError(\"targetStart out of bounds\");if(0>r||r>=this.length)throw new RangeError(\"sourceStart out of bounds\");if(0>n)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&e>r&&n>e)for(i=o-1;i>=0;i--)t[i+e]=this[i+r];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)t[i+e]=this[i+r];else t._set(this.subarray(r,r+o),e);return o},a.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError(\"end < start\");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError(\"start out of bounds\");if(0>r||r>this.length)throw new RangeError(\"end out of bounds\");var n;if(\"number\"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=q(t.toString()),a=i.length;for(n=e;r>n;n++)this[n]=i[n%a]}return this}},a.prototype.toArrayBuffer=function(){if(\"undefined\"!=typeof Uint8Array){if(a.TYPED_ARRAY_SUPPORT)return new a(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;r>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError(\"Buffer.toArrayBuffer not supported in this browser\")};var J=a.prototype;a._augment=function(t){return t.constructor=a,t._isBuffer=!0,t._set=t.set,t.get=J.get,t.set=J.set,t.write=J.write,t.toString=J.toString,t.toLocaleString=J.toString,t.toJSON=J.toJSON,t.equals=J.equals,t.compare=J.compare,t.indexOf=J.indexOf,t.copy=J.copy,t.slice=J.slice,t.readUIntLE=J.readUIntLE,t.readUIntBE=J.readUIntBE,t.readUInt8=J.readUInt8,t.readUInt16LE=J.readUInt16LE,t.readUInt16BE=J.readUInt16BE,t.readUInt32LE=J.readUInt32LE,t.readUInt32BE=J.readUInt32BE,t.readIntLE=J.readIntLE,t.readIntBE=J.readIntBE,t.readInt8=J.readInt8,t.readInt16LE=J.readInt16LE,t.readInt16BE=J.readInt16BE,t.readInt32LE=J.readInt32LE,t.readInt32BE=J.readInt32BE,t.readFloatLE=J.readFloatLE,t.readFloatBE=J.readFloatBE,t.readDoubleLE=J.readDoubleLE,t.readDoubleBE=J.readDoubleBE,t.writeUInt8=J.writeUInt8,t.writeUIntLE=J.writeUIntLE,t.writeUIntBE=J.writeUIntBE,t.writeUInt16LE=J.writeUInt16LE,t.writeUInt16BE=J.writeUInt16BE,t.writeUInt32LE=J.writeUInt32LE,t.writeUInt32BE=J.writeUInt32BE,t.writeIntLE=J.writeIntLE,t.writeIntBE=J.writeIntBE,t.writeInt8=J.writeInt8,t.writeInt16LE=J.writeInt16LE,t.writeInt16BE=J.writeInt16BE,t.writeInt32LE=J.writeInt32LE,t.writeInt32BE=J.writeInt32BE,t.writeFloatLE=J.writeFloatLE,t.writeFloatBE=J.writeFloatBE,t.writeDoubleLE=J.writeDoubleLE,t.writeDoubleBE=J.writeDoubleBE,t.fill=J.fill,t.inspect=J.inspect,t.toArrayBuffer=J.toArrayBuffer,t};var tt=/[^+\\/0-9A-Za-z-_]/g}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"base64-js\":35,ieee754:36,\"is-array\":37}],35:[function(t,e,r){var n=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";!function(t){\"use strict\";function e(t){var e=t.charCodeAt(0);return e===o||e===h?62:e===s||e===f?63:l>e?-1:l+10>e?e-l+26+26:c+26>e?e-c:u+26>e?e-u+26:void 0}function r(t){function r(t){u[h++]=t}var n,i,o,s,l,u;if(t.length%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var c=t.length;l=\"=\"===t.charAt(c-2)?2:\"=\"===t.charAt(c-1)?1:0,u=new a(3*t.length/4-l),o=l>0?t.length-4:t.length;var h=0;for(n=0,i=0;o>n;n+=4,i+=3)s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===l?(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&s)):1===l&&(s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(s>>8&255),r(255&s)),u}function i(t){function e(t){return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,a,o,s=t.length%3,l=\"\";for(i=0,o=t.length-s;o>i;i+=3)a=(t[i]<<16)+(t[i+1]<<8)+t[i+2],l+=r(a);switch(s){case 1:a=t[t.length-1],l+=e(a>>2),l+=e(a<<4&63),l+=\"==\";break;case 2:a=(t[t.length-2]<<8)+t[t.length-1],l+=e(a>>10),l+=e(a>>4&63),l+=e(a<<2&63),l+=\"=\"}return l}var a=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,o=\"+\".charCodeAt(0),s=\"/\".charCodeAt(0),l=\"0\".charCodeAt(0),u=\"a\".charCodeAt(0),c=\"A\".charCodeAt(0),h=\"-\".charCodeAt(0),f=\"_\".charCodeAt(0);t.toByteArray=r,t.fromByteArray=i}(\"undefined\"==typeof r?this.base64js={}:r)},{}],36:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>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,\n",
"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:(d?-1:1)*(1/0);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<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=0>e||0===e&&0>1/e?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<<i|s,u+=i;u>0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],37:[function(t,e,r){var n=Array.isArray,i=Object.prototype.toString;e.exports=n||function(t){return!!t&&\"[object Array]\"==i.call(t)}},{}],38:[function(t,e,r){function n(){c=!1,s.length?u=s.concat(u):h=-1,u.length&&i()}function i(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(s=u,u=[];++h<e;)s&&s[h].run();h=-1,e=u.length}s=null,c=!1,clearTimeout(t)}}function a(t,e){this.fun=t,this.array=e}function o(){}var s,l=e.exports={},u=[],c=!1,h=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new a(t,e)),1!==u.length||c||setTimeout(i,0)},a.prototype.run=function(){this.fun.apply(null,this.array)},l.title=\"browser\",l.browser=!0,l.env={},l.argv=[],l.version=\"\",l.versions={},l.on=o,l.addListener=o,l.once=o,l.off=o,l.removeListener=o,l.removeAllListeners=o,l.emit=o,l.binding=function(t){throw new Error(\"process.binding is not supported\")},l.cwd=function(){return\"/\"},l.chdir=function(t){throw new Error(\"process.chdir is not supported\")},l.umask=function(){return 0}},{}],39:[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]}]}},{}],40:[function(t,e,r){\"use strict\";function n(t){for(var e,r=\"#\",n=0;3>n;++n)e=t[n],e=e.toString(16),r+=(\"00\"+e).substr(e.length);return r}function i(t){return\"rgba(\"+t.join(\",\")+\")\"}var a=t(\"arraytools\"),o=t(\"./colorScales.json\");e.exports=function(t){var e,r,s,l,u,c,h,f,d,p,g,v,m,y=[],b=[],x=[],_=[];if(a.isPlainObject(t)||(t={}),t.colormap||(h=\"jet\"),Array.isArray(t.alpha)?2!==t.alpha.length&&(t.alpha=[1,1]):\"number\"==typeof t.alpha?t.alpha=[t.alpha,t.alpha]:t.alpha=[1,1],\"string\"==typeof t.colormap){if(h=t.colormap.toLowerCase(),!(h in o))throw Error(h+\" not a supported colorscale\");c=o[h]}else Array.isArray(t.colormap)&&(c=t.colormap);if(d=t.nshades||72,f=t.format||\"hex\",g=t.alpha,c.length>d)throw new Error(h+\" map requires nshades to be at least size \"+c.length);for(e=c.map(function(t){return Math.round(t.index*d)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),m=0;m<e.length;++m)v=c[m].index,r=c[m].rgb,4===r.length&&r[3]>=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(m=0;m<e.length-1;++m)u=e[m+1]-e[m],s=c[m].rgb,l=c[m+1].rgb,y=y.concat(a.linspace(s[0],l[0],u)),b=b.concat(a.linspace(s[1],l[1],u)),x=x.concat(a.linspace(s[2],l[2],u)),_=_.concat(a.linspace(s[3],l[3],u));return y=y.map(Math.round),b=b.map(Math.round),x=x.map(Math.round),p=a.zip(y,b,x,_),\"hex\"===f&&(p=p.map(n)),\"rgbaString\"===f&&(p=p.map(i)),p}},{\"./colorScales.json\":39,arraytools:32}],41:[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],g=e[1],v=e[2],m=e[3];return c+h+f+d-(p+g+v+m)||a(c,h,f,d)-a(p,g,v,m,p)||a(c+h,c+f,c+d,h+f,h+d,f+d)-a(p+g,p+v,p+m,g+v,g+m,v+m)||a(c+h+f,c+h+d,c+f+d,h+f+d)-a(p+g+v,p+g+m,p+v+m,g+v+m);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;r>x;++x)if(i=y[x]-b[x])return i;return 0}}e.exports=i;var a=Math.min},{}],42:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?i(t):2===r?a(t):o(t,r)}var i=t(\"./lib/ch1d\"),a=t(\"./lib/ch2d\"),o=t(\"./lib/chnd\");e.exports=n},{\"./lib/ch1d\":43,\"./lib/ch2d\":44,\"./lib/chnd\":45}],43:[function(t,e,r){\"use strict\";function n(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return r>e?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],44:[function(t,e,r){\"use strict\";function n(t){var e=i(t),r=e.length;if(2>=r)return[];for(var n=new Array(r),a=e[r-1],o=0;r>o;++o){var s=e[o];n[o]=[a,s],a=s}return n}e.exports=n;var i=t(\"monotone-convex-hull-2d\")},{\"monotone-convex-hull-2d\":47}],45:[function(t,e,r){\"use strict\";function n(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];for(var a=e.length,i=0;r>i;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;r>i;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(n>s)a[o]=e[s];else{s-=n;for(var l=0;n>l;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(r){var a=s(t);if(a.length<=e)return[];var l=n(t,a),u=o(l,!0);return i(u,a)}}e.exports=a;var o=t(\"incremental-convex-hull\"),s=t(\"affine-hull\")},{\"affine-hull\":46,\"incremental-convex-hull\":168}],46:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(e+1),n=0;n<t.length;++n)r[n]=t[n];for(var n=0;n<=t.length;++n){for(var i=t.length;e>=i;++i){for(var o=new Array(e),s=0;e>s;++s)o[s]=Math.pow(i+1-n,s);r[i]=o}var l=a.apply(void 0,r);if(l)return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],a=[0],o=1;e>o;++o)if(i.push(t[o]),n(i,r)){if(a.push(o),a.length===r+1)return a}else i.pop();return a}e.exports=i;var a=t(\"robust-orientation\")},{\"robust-orientation\":195}],47:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(3>e){for(var r=new Array(e),n=0;e>n;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;e>n;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n?n:t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;e>n;++n){for(var l=a[n],u=t[l],c=o.length;c>1&&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;f>n;++n)r[h++]=o[n];for(var d=s.length-2;d>0;--d)r[h++]=s[d];return r}e.exports=n;var i=t(\"robust-orientation\")[3]},{\"robust-orientation\":195}],48:[function(t,e,r){e.exports=t(\"cwise-compiler\")},{\"cwise-compiler\":49}],49:[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;i<r.length;++i){var o=r[i];if(\"array\"===o||\"object\"==typeof o&&o.blockIndices){if(e.argTypes[i]=\"array\",e.arrayArgs.push(i),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push(\"array\"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array args\");if(i<e.post.args.length&&e.post.args[i].count>0)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),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array index\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array index\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array index\")}else if(\"shape\"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error(\"cwise: pre() block may not write to array shape\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array shape\");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error(\"cwise: post() block may not write to array shape\")}else{if(\"object\"!=typeof o||!o.offset)throw new Error(\"cwise: Unknown argument type \"+r[i]);e.argTypes[i]=\"offset\",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error(\"cwise: No array arguments specified\");if(e.pre.args.length>r.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\":51}],50:[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;a>n;++n)u.push([\"i\",n,\"=0\"].join(\"\"));for(i=0;o>i;++i)for(n=0;a>n;++n)h=c,c=t[n],0===n?u.push([\"d\",i,\"s\",n,\"=t\",i,\"p\",c].join(\"\")):u.push([\"d\",i,\"s\",n,\"=(t\",i,\"p\",c,\"-s\",h,\"*t\",i,\"p\",h,\")\"].join(\"\"));for(l.push(\"var \"+u.join(\",\")),n=a-1;n>=0;--n)c=t[n],l.push([\"for(i\",n,\"=0;i\",n,\"<s\",c,\";++i\",n,\"){\"].join(\"\"));for(l.push(r),n=0;a>n;++n){for(h=c,c=t[n],i=0;o>i;++i)l.push([\"p\",i,\"+=d\",i,\"s\",n].join(\"\"));s&&(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;o>c;++c)u.push([\"var offset\",c,\"=p\",c].join(\"\"));for(var c=t;a>c;++c)u.push([\"for(var j\"+c+\"=SS[\",e[c],\"]|0;j\",c,\">0;){\"].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;o>c;++c){for(var h=[\"offset\"+c],f=t;a>f;++f)h.push([\"j\",f,\"*t\",c,\"p\",e[f]].join(\"\"));u.push([\"p\",c,\"=(\",h.join(\"+\"),\")\"].join(\"\"))}u.push(n(e,r,i));for(var c=t;a>c;++c)u.push(\"}\");return u.join(\"\\n\")}function a(t){for(var e=0,r=t[0].length;r>e;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}function o(t,e,r){for(var n=t.body,i=[],a=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,\"g\"),u=\"\",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case\"offset\":var h=e.offsetArgIndex.indexOf(o),f=e.offsetArgs[h];c=f.array,u=\"+q\"+h;case\"array\":u=\"p\"+c+u;var d=\"l\"+o,p=\"a\"+c;if(0===e.arrayBlockIndices[c])1===s.count?\"generic\"===r[c]?s.lvalue?(i.push([\"var \",d,\"=\",p,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,d),a.push([p,\".set(\",u,\",\",d,\")\"].join(\"\"))):n=n.replace(l,[p,\".get(\",u,\")\"].join(\"\")):n=n.replace(l,[p,\"[\",u,\"]\"].join(\"\")):\"generic\"===r[c]?(i.push([\"var \",d,\"=\",p,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,d),s.lvalue&&a.push([p,\".set(\",u,\",\",d,\")\"].join(\"\"))):(i.push([\"var \",d,\"=\",p,\"[\",u,\"]\"].join(\"\")),n=n.replace(l,d),s.lvalue&&a.push([p,\"[\",u,\"]=\",d].join(\"\")));else{for(var g=[s.name],v=[u],m=0;m<Math.abs(e.arrayBlockIndices[c]);m++)g.push(\"\\\\s*\\\\[([^\\\\]]+)\\\\]\"),v.push(\"$\"+(m+1)+\"*t\"+c+\"b\"+m);if(l=new RegExp(g.join(\"\"),\"g\"),u=v.join(\"+\"),\"generic\"===r[c])throw new Error(\"cwise: Generic arrays not supported in combination with blocks!\");n=n.replace(l,[p,\"[\",u,\"]\"].join(\"\"))}break;case\"scalar\":n=n.replace(l,\"Y\"+e.scalarArgs.indexOf(o));break;case\"index\":n=n.replace(l,\"index\");break;case\"shape\":n=n.replace(l,\"shape\")}}}return[i.join(\"\\n\"),n,a.join(\"\\n\")].join(\"\\n\").trim()}function s(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],a=i.match(/\\d+/);a=a?a[0]:\"\",0===i.charAt(0)?e[n]=\"u\"+i.charAt(1)+a:e[n]=i.charAt(0)+a,n>0&&(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;h<t.arrayArgs.length;++h)c[h]=e[2*h],l[h]=e[2*h+1];for(var f=[],d=[],p=[],g=[],v=[],h=0;h<t.arrayArgs.length;++h){t.arrayBlockIndices[h]<0?(p.push(0),g.push(r),f.push(r),d.push(r+t.arrayBlockIndices[h])):(p.push(t.arrayBlockIndices[h]),g.push(t.arrayBlockIndices[h]+r),f.push(0),d.push(t.arrayBlockIndices[h]));for(var m=[],y=0;y<l[h].length;y++)p[h]<=l[h][y]&&l[h][y]<g[h]&&m.push(l[h][y]-p[h]);v.push(m)}for(var b=[\"SS\"],x=[\"'use strict'\"],_=[],y=0;r>y;++y)_.push([\"s\",y,\"=SS[\",y,\"]\"].join(\"\"));for(var h=0;h<t.arrayArgs.length;++h){b.push(\"a\"+h),b.push(\"t\"+h),b.push(\"p\"+h);for(var y=0;r>y;++y)_.push([\"t\",h,\"p\",y,\"=t\",h,\"[\",p[h]+y,\"]\"].join(\"\"));for(var y=0;y<Math.abs(t.arrayBlockIndices[h]);++y)_.push([\"t\",h,\"b\",y,\"=t\",h,\"[\",f[h]+y,\"]\"].join(\"\"))}for(var h=0;h<t.scalarArgs.length;++h)b.push(\"Y\"+h);if(t.shapeArgs.length>0&&_.push(\"shape=SS.slice(0)\"),t.indexArgs.length>0){for(var w=new Array(r),h=0;r>h;++h)w[h]=\"0\";_.push([\"index=[\",w.join(\",\"),\"]\"].join(\"\"))}for(var h=0;h<t.offsetArgs.length;++h){for(var k=t.offsetArgs[h],A=[],y=0;y<k.offset.length;++y)0!==k.offset[y]&&(1===k.offset[y]?A.push([\"t\",k.array,\"p\",y].join(\"\")):A.push([k.offset[y],\"*t\",k.array,\"p\",y].join(\"\")));0===A.length?_.push(\"q\"+h+\"=0\"):_.push([\"q\",h,\"=\",A.join(\"+\")].join(\"\"))}var M=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));_=_.concat(M),x.push(\"var \"+_.join(\",\"));for(var h=0;h<t.arrayArgs.length;++h)x.push(\"p\"+h+\"|=0\");t.pre.body.length>3&&x.push(o(t.pre,t,c));var L=o(t.body,t,c),T=a(v);r>T?x.push(i(T,v[0],t,L)):x.push(n(v[0],t,L)),t.post.body.length>3&&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\",T,s(c)].join(\"\"),C=new Function([\"function \",E,\"(\",b.join(\",\"),\"){\",x.join(\"\\n\"),\"} return \",E].join(\"\"));return C()}var u=t(\"uniq\");e.exports=l},{uniq:52}],51:[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;c<t.arrayArgs.length;++c){var h=t.arrayArgs[c];r.push([\"t\",h,\"=array\",h,\".dtype,\",\"r\",h,\"=array\",h,\".order\"].join(\"\")),a.push(\"t\"+h),a.push(\"r\"+h),o.push(\"t\"+h),o.push(\"r\"+h+\".join()\"),s.push(\"array\"+h+\".data\"),s.push(\"array\"+h+\".stride\"),s.push(\"array\"+h+\".offset|0\"),c>0&&(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-->0;) {\"),e.push(\"if (!(\"+u.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same shape!')\"),e.push(\"}\"));for(var c=0;c<t.scalarArgs.length;++c)s.push(\"scalar\"+t.scalarArgs[c]);r.push([\"type=[\",o.join(\",\"),\"].join()\"].join(\"\")),r.push(\"proc=CACHED[type]\"),e.push(\"var \"+r.join(\",\")),e.push([\"if(!proc){\",\"CACHED[type]=proc=compile([\",a.join(\",\"),\"])}\",\"return proc(\",s.join(\",\"),\")}\"].join(\"\")),t.debug&&console.log(\"-----Generated thunk:\\n\"+e.join(\"\\n\")+\"\\n----------\");var f=new Function(\"compile\",e.join(\"\\n\"));return f(i.bind(void 0,t))}var i=t(\"./compile.js\");e.exports=n},{\"./compile.js\":50}],52:[function(t,e,r){\"use strict\";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;n>o;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;r>a;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],53:[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 e>t?-1:t>e?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);i>n;){var a=n+i>>>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);i>n;){var a=n+i>>>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+=\"\")===mo||t[0]===yo?yo+t:t}function d(t){return(t+=\"\")[0]===yo?t.slice(1):t}function p(t){return f(t)in this._}function g(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 m(){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=bo.length;n>r;++r){var i=bo[r]+e;if(i in t)return i}}function k(){}function A(){}function M(t){function e(){for(var e,n=r,i=-1,a=n.length;++i<a;)(e=n[i].on)&&e.apply(this,arguments);return t}var r=[],n=new h;return e.on=function(e,i){var a,o=n.get(e);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,a=r.indexOf(o)).concat(r.slice(a+1)),n.remove(e)),i&&r.push(n.set(e,{on:i})),t)},e}function L(){no.event.preventDefault()}function T(){for(var t,e=no.event;t=e.sourceEvent;)e=t;return e}function E(t){for(var e=new A,r=0,n=arguments.length;++r<n;)e[arguments[r]]=M(e);return e.of=function(r,n){return function(i){try{var a=i.sourceEvent=no.event;i.target=t,no.event=i,e[i.type].apply(r,n)}finally{no.event=a}}},e}function C(t){return _o(t,Mo),t}function S(t){return\"function\"==typeof t?t:function(){return wo(t,this)}}function z(t){return\"function\"==typeof t?t:function(){return ko(t,this)}}function P(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function a(){this.setAttributeNS(t.space,t.local,e)}function o(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function s(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=no.ns.qualify(t),null==e?t.local?n:r:\"function\"==typeof e?t.local?s:o:t.local?a:i}function j(t){return t.trim().replace(/\\s+/g,\" \")}function O(t){return new RegExp(\"(?:^|\\\\s+)\"+no.requote(t)+\"(?:\\\\s+|$)\",\"g\")}function I(t){return(t+\"\").trim().split(/^|\\s+/)}function D(t,e){function r(){for(var r=-1;++r<i;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<i;)t[r](this,n)}t=I(t).map(R);var i=t.length;return\"function\"==typeof e?n:r}function R(t){var e=O(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute(\"class\")||\"\";n?(e.lastIndex=0,e.test(i)||r.setAttribute(\"class\",j(i+\" \"+t))):r.setAttribute(\"class\",j(i.replace(e,\" \")))}}function F(t,e,r){function n(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,r)}function a(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:\"function\"==typeof e?a:i}function N(t,e){function r(){delete this[t]}function n(){this[t]=e}function i(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:\"function\"==typeof e?i:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r?e.createElementNS(r,t):e.createElement(t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return\"function\"==typeof t?t:(t=no.ns.qualify(t)).local?r:e}function U(){var t=this.parentNode;t&&t.removeChild(this)}function V(t){return{__data__:t}}function q(t){return function(){return Ao(this,t)}}function H(t){return arguments.length||(t=i),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function G(t,e){for(var r=0,n=t.length;n>r;r++)for(var i,a=t[r],o=0,s=a.length;s>o;o++)(i=a[o])&&e(i,o,r);return t}function Y(t){return _o(t,To),t}function W(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}function X(t,e,r){function n(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function i(){var i=l(e,ao(arguments));n.call(this),this.addEventListener(t,this[o]=i,i.$=r),i._=e}function a(){var e,r=new RegExp(\"^__on([^.]+)\"+no.requote(t)+\"$\");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}var o=\"__on\"+t,s=t.indexOf(\".\"),l=Z;s>0&&(t=t.slice(0,s));var u=Eo.get(t);return u&&(t=u,l=Q),s?e?i:n:e?k:a}function Z(t,e){return function(r){var n=no.event;no.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{no.event=n}}}function Q(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 $(t){var r=\".dragsuppress-\"+ ++So,i=\"click\"+r,a=no.select(n(t)).on(\"touchmove\"+r,L).on(\"dragstart\"+r,L).on(\"selectstart\"+r,L);if(null==Co&&(Co=\"onselectstart\"in t?!1:w(t.style,\"userSelect\")),Co){var o=e(t).style,s=o[Co];o[Co]=\"none\"}return function(t){if(a.on(r,null),Co&&(o[Co]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){L(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>zo){var a=n(t);if(a.scrollX||a.scrollY){r=no.select(\"body\").append(\"svg\").style({position:\"absolute\",top:0,left:0,margin:0,padding:0,border:\"none\"},\"important\");var o=r[0][0].getScreenCTM();zo=!(o.f||o.e),r.remove()}}return zo?(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 J(){return no.event.changedTouches[0].identifier}function tt(t){return t>0?1:0>t?-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:-1>t?Oo:Math.acos(t)}function nt(t){return t>1?Ro:-1>t?-Ro: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):kt(\"\"+t,At,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(o-a)*t/60:180>t?o:240>t?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:0>e?0:e>1?1:e,r=0>r?0:r>1?1:r,o=.5>=r?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?gt(t.l,t.a,t.b):gt((t=Mt((t=no.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*=Fo)*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):Mt((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)*Zo,n=vt(n)*Qo,a=vt(a)*$o,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 gt(t,e,r){return t>0?new ht(Math.atan2(r,e)*No,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 mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?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):kt(\"\"+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 16>t?\"0\"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function kt(t,e,r){t=t.toLowerCase();var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\\((.*)\\)/.exec(t))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(Tt(i[0]),Tt(i[1]),Tt(i[2]))}return(a=ts.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|o,s=240&a,s=s>>4|s,l=15&a,l=l<<4|l):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function At(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=.5>l?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(r>e?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&1>l?0:n),new ut(n,i,l)}function Mt(t,e,r){t=Lt(t),e=Lt(e),r=Lt(r);var n=mt((.4124564*t+.3575761*e+.1804375*r)/Zo),i=mt((.2126729*t+.7151522*e+.072175*r)/Qo),a=mt((.0193339*t+.119192*e+.9503041*r)/$o);return dt(116*i-16,500*(n-i),200*(i-a))}function Lt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tt(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 Ct(t){return function(e,r,n){return 2===arguments.length&&\"function\"==typeof r&&(n=r,r=null),St(e,r,t,n)}}function St(t,e,r,n){function i(){var t,e=l.status;if(!e&&Pt(l)||e>=200&&300>e||304===e){try{t=r.call(a,l)}catch(n){return void o.error.call(a,n)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=no.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=no.event;no.event=t;try{o.progress.call(a,l)}finally{no.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(ao(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},no.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 Pt(t){var e=t.responseType;return e&&\"text\"!==e?t.response:t.responseText}function jt(){var t=Ot(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(is),is=setTimeout(jt,e)),ns=0):(ns=1,os(jt))}function Ot(){var t=Date.now();for(as=es;as;)t>=as.t&&(as.f=as.c(t-as.t)),as=as.n;return t}function It(){for(var t,e=es,r=1/0;e;)e.f?e=t?t.n=e.n:es=e.n:(e.t<r&&(r=e.t),e=(t=e).n);return rs=t,r}function Dt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Rt(t,e){var r=Math.pow(10,3*vo(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Ft(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);\n",
"}:x;return function(t){var r=ls.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,g=\"\",v=\"\",m=!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&&(g=\"0\"+d.toLowerCase());case\"c\":y=!1;case\"d\":m=!0,f=0;break;case\"s\":p=-1,d=\"r\"}\"$\"===l&&(g=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=us.get(d)||Nt;var b=u&&h;return function(t){var r=v;if(m&&t%1)return\"\";var i=0>t||0===t&&0>1/t?(t=-t,\"-\"):\"-\"===s?\"\":s;if(0>p){var l=no.formatPrefix(t,f);t=l.scale(t),r=l.symbol+v}else t*=p;t=d(t,f);var x,_,w=t.lastIndexOf(\".\");if(0>w){var k=y?t.lastIndexOf(\"e\"):-1;0>k?(x=t,_=\"\"):(x=t.substring(0,k),_=t.substring(k))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(x=a(x,1/0));var A=g.length+x.length+_.length+(b?0:i.length),M=c>A?new Array(A=c-A+1).join(n):\"\";return b&&(x=a(M+x,M.length?c-_.length:1/0)),i+=g,t=x+_,(\"<\"===o?i+t+M:\">\"===o?M+i+t:\"^\"===o?M.substring(0,A>>=1)+i+t+M.substring(A):i+(b?t:M+t))+r}}}function Nt(t){return t+\"\"}function Bt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ut(t,e,r){function n(e){var r=t(e),n=a(r,1);return n-e>e-r?r:n}function i(r){return e(r=t(new hs(r-1)),1),r}function a(t,r){return e(t=new hs(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;n>o;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;n>o;)s.push(new Date(+o)),e(o,1);return s}function s(t,e,r){try{hs=Bt;var n=new Bt;return n._=t,o(n,e,r)}finally{hs=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var l=t.utc=Vt(t);return l.floor=l,l.round=Vt(n),l.ceil=Vt(i),l.offset=Vt(a),l.range=s,t}function Vt(t){return function(e,r){try{hs=Bt;var n=new Bt;return n._=e,t(n,r)._}finally{hs=Date}}}function qt(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s<n;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=ds[r=t.charAt(++s)])&&(r=t.charAt(++s)),(a=E[r])&&(r=a(e,null==i?\"e\"===r?\" \":\"0\":i)),o.push(r),l=s+1);return o.push(t.slice(l,s)),o.join(\"\")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=r(n,t,e,0);if(i!=e.length)return null;\"p\"in n&&(n.H=n.H%12+12*n.p);var a=null!=n.Z&&hs!==Bt,o=new(a?Bt:hs);return\"j\"in n?o.setFullYear(n.y,0,n.j):\"w\"in n&&(\"W\"in n||\"U\"in n)?(o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,\"W\"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),a?o._:o},e.toString=function(){return t},e}function r(t,e,r,n){for(var i,a,o,s=0,l=e.length,u=r.length;l>s;){if(n>=u)return-1;if(i=e.charCodeAt(s++),37===i){if(o=e.charAt(s++),a=C[o in ds?e.charAt(s++):o],!a||(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=k.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){L.lastIndex=0;var n=L.exec(e.slice(r));return n?(t.m=T.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){A.lastIndex=0;var n=A.exec(e.slice(r));return n?(t.m=M.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,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{hs=Bt;var e=new hs;return e._=t,n(e)}finally{hs=Date}}var n=e(t);return r.parse=function(t){try{hs=Bt;var e=n.parse(t);return e&&e._}finally{hs=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var b=no.map(),x=Gt(g),_=Yt(g),w=Gt(v),k=Yt(v),A=Gt(m),M=Yt(m),L=Gt(y),T=Yt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var E={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(h),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+cs.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 p[+(t.getHours()>=12)]},S:function(t,e){return Ht(t.getSeconds(),e,2)},U:function(t,e){return Ht(cs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ht(cs.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Ht(t.getFullYear()%100,e,2)},Y:function(t,e){return Ht(t.getFullYear()%1e4,e,4)},Z:se,\"%\":function(){return\"%\"}},C={a:n,A:i,b:a,B:o,c:s,d:ee,e:ee,H:ne,I:ne,j:re,L:oe,m:te,M:ie,p:c,S:ae,U:Xt,w:Wt,W:Zt,x:l,X:u,y:$t,Y:Qt,Z:Kt,\"%\":le};return e}function Ht(t,e,r){var n=0>t?\"-\":\"\",i=(n?-t:t)+\"\",a=i.length;return n+(r>a?new Array(r-a+1).join(e)+i:i)}function Gt(t){return new RegExp(\"^(?:\"+t.map(no.requote).join(\"|\")+\")\",\"i\")}function Yt(t){for(var e=new h,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Wt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Xt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Zt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Qt(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function $t(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.y=Jt(+n[0]),r+n[0].length):-1}function Kt(t,e,r){return/^[+-]\\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Jt(t){return t+(t>68?1900:2e3)}function te(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function ee(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function re(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ne(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ie(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ae(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function oe(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?\"-\":\"+\",n=vo(e)/60|0,i=vo(e)%60;return r+Ht(n,\"0\",2)+Ht(i,\"0\",2)}function le(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function ce(){}function he(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fe(t,e){t&&bs.hasOwnProperty(t.type)&&bs[t.type](t,e)}function de(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function pe(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)de(t[r],e,1);e.polygonEnd()}function ge(){function t(t,e){t*=Fo,e=e*Fo/2+Oo/4;var r=t-n,o=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);_s.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;ws.point=function(o,s){ws.point=t,n=(e=o)*Fo,i=Math.cos(s=(r=s)*Fo/2+Oo/4),a=Math.sin(s)},ws.lineEnd=function(){t(e,r)}}function ve(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 me(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(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 xe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _e(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 we(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function ke(t,e){return vo(t[0]-e[0])<Po&&vo(t[1]-e[1])<Po}function Ae(t,e){t*=Fo;var r=Math.cos(e*=Fo);Me(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Me(t,e,r){++ks,Ms+=(t-Ms)/ks,Ls+=(e-Ls)/ks,Ts+=(r-Ts)/ks}function Le(){function t(t,i){t*=Fo;var a=Math.cos(i*=Fo),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=r*l-n*s)*u+(u=n*o-e*l)*u+(u=e*s-r*o)*u),e*o+r*s+n*l);As+=u,Es+=u*(e+(e=o)),Cs+=u*(r+(r=s)),Ss+=u*(n+(n=l)),Me(e,r,n)}var e,r,n;Os.point=function(i,a){i*=Fo;var o=Math.cos(a*=Fo);e=o*Math.cos(i),r=o*Math.sin(i),n=Math.sin(a),Os.point=t,Me(e,r,n)}}function Te(){Os.point=Ae}function Ee(){function t(t,e){t*=Fo;var r=Math.cos(e*=Fo),o=r*Math.cos(t),s=r*Math.sin(t),l=Math.sin(e),u=i*l-a*s,c=a*o-n*l,h=n*s-i*o,f=Math.sqrt(u*u+c*c+h*h),d=n*o+i*s+a*l,p=f&&-rt(d)/f,g=Math.atan2(f,d);zs+=p*u,Ps+=p*c,js+=p*h,As+=g,Es+=g*(n+(n=o)),Cs+=g*(i+(i=s)),Ss+=g*(a+(a=l)),Me(n,i,a)}var e,r,n,i,a;Os.point=function(o,s){e=o,r=s,Os.point=t,o*=Fo;var l=Math.cos(s*=Fo);n=l*Math.cos(o),i=l*Math.sin(o),a=Math.sin(s),Me(n,i,a)},Os.lineEnd=function(){t(e,r),Os.lineEnd=Te,Os.point=Ae}}function Ce(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return r=e.invert(r,n),r&&t.invert(r[0],r[1])}),r}function Se(){return!0}function ze(t,e,r,n,i){var a=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(ke(r,n)){i.lineStart();for(var s=0;e>s;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new je(r,t,null,!0),u=new je(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new je(n,t,null,!1),u=new je(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}),o.sort(e),Pe(a),Pe(o),a.length){for(var s=0,l=r,u=o.length;u>s;++s)o[s].e=l=!l;for(var c,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var s=0,u=c.length;u>s;++s)i.point((h=c[s])[0],h[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=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 Pe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function je(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Oe(t,e,r,n){return function(i,a){function o(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&a.point(e,r)}function s(t,e){var r=i(t,e);v.point(r[0],r[1])}function l(){y.point=s,v.lineStart()}function u(){y.point=o,v.lineEnd()}function c(t,e){g.push([t,e]);var r=i(t,e);x.point(r[0],r[1])}function h(){x.lineStart(),g=[]}function f(){c(g[0][0],g[0][1]),x.lineEnd();var t,e=x.clean(),r=b.buffer(),n=r.length;if(g.pop(),p.push(g),g=null,n)if(1&e){t=r[0];var i,n=t.length-1,o=-1;if(n>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<n;)a.point((i=t[o])[0],i[1]);a.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Ie))}var d,p,g,v=e(a),m=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=no.merge(d);var t=Ue(m,p);d.length?(_||(a.polygonStart(),_=!0),ze(d,Re,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=De(),x=e(b),_=!1;return y}}function Ie(t){return t.length>1}function De(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:k,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Re(t,e){return((t=t.x)[0]<0?t[1]-Ro-Po:Ro-t[1])-((e=e.x)[0]<0?e[1]-Ro-Po:Ro-e[1])}function Fe(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Oo:-Oo,l=vo(a-r);vo(l-Oo)<Po?(t.point(r,n=(n+o)/2>0?Ro:-Ro),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Oo&&(vo(r-i)<Po&&(r-=i*Po),vo(a-s)<Po&&(a-=s*Po),n=Ne(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}function Ne(t,e,r,n){var i,a,o=Math.sin(t-r);return vo(o)>Po?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 Be(t,e,r,n){var i;if(null==t)i=r*Ro,n.point(-Oo,i),n.point(0,i),n.point(Oo,i),n.point(Oo,0),n.point(Oo,-i),n.point(0,-i),n.point(-Oo,-i),n.point(-Oo,0),n.point(-Oo,i);else if(vo(t[0]-e[0])>Po){var a=t[0]<e[0]?Oo:-Oo;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}function Ue(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;_s.reset();for(var s=0,l=e.length;l>s;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],f=h[0],d=h[1]/2+Oo/4,p=Math.sin(d),g=Math.cos(d),v=1;;){v===c&&(v=0),t=u[v];var m=t[0],y=t[1]/2+Oo/4,b=Math.sin(y),x=Math.cos(y),_=m-f,w=_>=0?1:-1,k=w*_,A=k>Oo,M=p*b;if(_s.add(Math.atan2(M*w*Math.sin(k),g*x+M*Math.cos(k))),a+=A?_+w*Io:_,A^f>=r^m>=r){var L=ye(ve(h),ve(t));_e(L);var T=ye(i,L);_e(T);var E=(A^_>=0?-1:1)*nt(T[2]);(n>E||n===E&&(L[0]||L[1]))&&(o+=A^_>=0?1:-1)}if(!v++)break;f=m,p=b,g=x,h=t}}return(-Po>a||Po>a&&0>_s)^1&o}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}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],g=e(h,f),v=o?g?0:i(h,f):g?i(h+(0>h?Oo:-Oo),f):0;if(!r&&(u=l=g)&&t.lineStart(),g!==l&&(d=n(r,p),(ke(r,d)||ke(p,d))&&(p[0]+=Po,p[1]+=Po,g=e(p[0],p[1]))),g!==l)c=0,g?(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^g){var m;v&a||!(m=n(p,r,!0))||(c=0,o?(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||r&&ke(r,p)||t.point(p[0],p[1]),r=p,l=g,a=v},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=ve(t),i=ve(e),o=[1,0,0],s=ye(n,i),l=me(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var h=a*l/c,f=-a*u/c,d=ye(o,s),p=xe(o,h),g=xe(s,f);be(p,g);var v=d,m=me(p,v),y=me(v,v),b=m*m-y*(me(p,p)-1);if(!(0>b)){var x=Math.sqrt(b),_=xe(v,(-m-x)/y);if(be(_,p),_=we(_),!r)return _;var w,k=t[0],A=e[0],M=t[1],L=e[1];k>A&&(w=k,k=A,A=w);var T=A-k,E=vo(T-Oo)<Po,C=E||Po>T;if(!E&&M>L&&(w=M,M=L,L=w),C?E?M+L>0^_[1]<(vo(_[0]-k)<Po?M:L):M<=_[1]&&_[1]<=L:T>Oo^(k<=_[0]&&_[0]<=A)){var S=xe(v,(-m+x)/y);return be(S,p),[_,we(S)]}}}function i(e,r){var n=o?t:Oo-t,i=0;return-n>e?i|=1:e>n&&(i|=2),-n>r?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=vo(a)>Po,l=gr(t,6*Fo);return Oe(e,r,l,o?[0,-t]:[-Oo,t-Oo])}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,g=h-u;if(a=t-l,p||!(a>0)){if(a/=p,0>p){if(f>a)return;d>a&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=r-l,p||!(0>a)){if(a/=p,0>p){if(a>d)return;a>f&&(f=a)}else if(p>0){if(f>a)return;d>a&&(d=a)}if(a=e-u,g||!(a>0)){if(a/=g,0>g){if(f>a)return;d>a&&(d=a)}else if(g>0){if(a>d)return;a>f&&(f=a)}if(a=n-u,g||!(0>a)){if(a/=g,0>g){if(a>d)return;a>f&&(f=a)}else if(g>0){if(f>a)return;d>a&&(d=a)}return f>0&&(i.a={x:l+f*p,y:u+f*g}),1>d&&(i.b={x:l+d*p,y:u+d*g}),i}}}}}}function He(t,e,r,n){function i(n,i){return vo(n[0]-t)<Po?i>0?0:3:vo(n[0]-r)<Po?i>0?2:1:vo(n[1]-e)<Po?i>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;r>i;++i)for(var a,o=1,s=v[i],l=s.length,u=s[0];l>o;++o)a=s[o],u[1]<=n?a[1]>n&&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 i>=t&&r>=i&&a>=e&&n>=a}function h(t,e){c(t,e)&&s.point(t,e)}function f(){C.point=p,v&&v.push(m=[]),A=!0,k=!1,_=w=NaN}function d(){g&&(p(y,b),x&&k&&T.rejoin(),g.push(T.buffer())),C.point=h,k&&s.lineEnd()}function p(t,e){t=Math.max(-Ds,Math.min(Ds,t)),e=Math.max(-Ds,Math.min(Ds,e));var r=c(t,e);if(v&&m.push([t,e]),A)y=t,b=e,x=r,A=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&k)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};E(n)?(k||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),M=!1):r&&(s.lineStart(),s.point(t,e),M=!1)}_=t,w=e,k=r}var g,v,m,y,b,x,_,w,k,A,M,L=s,T=De(),E=qe(t,e,r,n),C={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=T,g=[],v=[],M=!0},polygonEnd:function(){s=L,g=no.merge(g);var e=l([t,n]),r=M&&e,i=g.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&ze(g,a,e,u,s),s.polygonEnd()),g=v=m=null}};return C}}function Ge(t){var e=0,r=Oo/3,n=sr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Oo/180,r=t[1]*Oo/180):[e/Oo*180,r/Oo*180]},i}function Ye(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){Fs+=i*t-n*e,n=t,i=e}var e,r,n,i;qs.point=function(a,o){qs.point=t,e=n=a,r=i=o},qs.lineEnd=function(){t(e,r)}}function Xe(t,e){Ns>t&&(Ns=t),t>Us&&(Us=t),Bs>e&&(Bs=e),e>Vs&&(Vs=e)}function Ze(){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=Qe(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=Qe(t),s},result:function(){if(o.length){var t=o.join(\"\");return o=[],t}}};return s}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 $e(t,e){Ms+=t,Ls+=e,++Ts}function Ke(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Es+=o*(e+t)/2,Cs+=o*(r+n)/2,Ss+=o,$e(e=t,r=n)}var e,r;Gs.point=function(n,i){Gs.point=t,$e(e=n,r=i)}}function Je(){Gs.point=$e}function tr(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Es+=o*(n+t)/2,Cs+=o*(i+e)/2,Ss+=o,o=i*t-n*e,zs+=o*(n+t),Ps+=o*(i+e),js+=3*o,$e(n=t,i=e)}var e,r,n,i;Gs.point=function(a,o){Gs.point=t,$e(e=n=a,r=i=o)},Gs.lineEnd=function(){t(e,r)}}function er(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Io)}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:k};return s}function rr(t){function e(t){return(s?n:r)(t)}function r(e){return ar(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,A.point=a,e.lineStart()}function a(r,n){var a=ve([r,n]),o=t(r,n);i(b,x,y,_,w,k,b=o[0],x=o[1],y=r,_=a[0],w=a[1],k=a[2],s,e),e.point(b,x)}function o(){A.point=r,e.lineEnd()}function l(){n(),A.point=u,A.lineEnd=c}function u(t,e){a(h=t,f=e),d=b,p=x,g=_,v=w,m=k,A.point=a}function c(){i(b,x,y,_,w,k,d,p,h,g,v,m,s,e),A.lineEnd=o,o()}var h,f,d,p,g,v,m,y,b,x,_,w,k,A={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),A.lineStart=l},polygonEnd:function(){e.polygonEnd(),A.lineStart=n}};return A}function i(e,r,n,s,l,u,c,h,f,d,p,g,v,m){var y=c-e,b=h-r,x=y*y+b*b;if(x>4*a&&v--){var _=s+d,w=l+p,k=u+g,A=Math.sqrt(_*_+w*w+k*k),M=Math.asin(k/=A),L=vo(vo(k)-1)<Po||vo(n-f)<Po?(n+f)/2:Math.atan2(w,_),T=t(L,M),E=T[0],C=T[1],S=E-e,z=C-r,P=b*S-y*z;(P*P/x>a||vo((y*S+b*z)/x-.5)>.3||o>s*d+l*p+u*g)&&(i(e,r,n,s,l,u,E,C,L,_/=A,w/=A,k,v,m),m.point(E,C),i(E,C,L,_,w,k,c,h,f,d,p,g,v,m))}}var a=.5,o=Math.cos(30*Fo),s=16;return e.precision=function(t){return arguments.length?(s=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nr(t){var e=rr(function(e,r){return t([e*No,r*No])});return function(t){return lr(e(t))}}function ir(t){this.stream=t}function ar(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 or(t){return sr(function(){return t})()}function sr(t){function e(t){return t=s(t[0]*Fo,t[1]*Fo),[t[0]*f+l,u-t[1]*f]}function r(t){return t=s.invert((t[0]-l)/f,(u-t[1])/f),t&&[t[0]*No,t[1]*No]}function n(){s=Ce(o=hr(m,y,b),a);var t=a(g,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=rr(function(t,e){return t=a(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,g=0,v=0,m=0,y=0,b=0,_=Is,w=x,k=null,A=null;return e.stream=function(t){return c&&(c.valid=!1),c=lr(_(o,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(k=t,Is):Ve((k=+t)*Fo),i()):k},e.clipExtent=function(t){return arguments.length?(A=t,w=t?He(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):A},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?(g=t[0]%360*Fo,v=t[1]%360*Fo,n()):[g*No,v*No]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Fo,y=t[1]%360*Fo,b=t.length>2?t[2]%360*Fo:0,n()):[m*No,y*No,b*No]},no.rebind(e,h,\"precision\"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function lr(t){return ar(t,function(e,r){t.point(e*Fo,r*Fo)})}function ur(t,e){return[t,e]}function cr(t,e){return[t>Oo?t-Io:-Oo>t?t+Io:t,e]}function hr(t,e,r){return t?e||r?Ce(dr(t),pr(e,r)):dr(t):e||r?pr(e,r):cr}function fr(t){return function(e,r){return e+=t,[e>Oo?e-Io:-Oo>e?e+Io:e,r]}}function dr(t){var e=fr(t);return e.invert=fr(-t),e}function pr(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 gr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=vr(r,i),a=vr(r,a),(o>0?a>i:i>a)&&(i+=o*Io)):(i=t+o*Io,a=t-.5*l);for(var u,c=i;o>0?c>a:a>c;c-=l)s.point((u=we([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function vr(t,e){var r=ve(e);r[0]-=t,_e(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Po)%(2*Math.PI)}function mr(t,e,r){var n=no.range(t,e-Po,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function yr(t,e,r){var n=no.range(t,e-Po,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function _r(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(st(n-e)+i*o*st(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*c,i=r*u+e*h,o=r*a+e*s;return[Math.atan2(i,n)*No,Math.atan2(o,Math.sqrt(n*n+i*i))*No]}:function(){return[t*No,e*No]};return p.distance=f,p}function wr(){function t(t,i){var a=Math.sin(i*=Fo),o=Math.cos(i),s=vo((t*=Fo)-e),l=Math.cos(s);Ys+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Ws.point=function(i,a){e=i*Fo,r=Math.sin(a*=Fo),n=Math.cos(a),Ws.point=t},Ws.lineEnd=function(){Ws.point=Ws.lineEnd=k}}function kr(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}function Ar(t,e){function r(t,e){o>0?-Ro+Po>e&&(e=-Ro+Po):e>Ro-Po&&(e=Ro-Po);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(Oo/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))-Ro]},r):Lr}function Mr(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 vo(i)<Po?ur:(r.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/i,a-tt(i)*Math.sqrt(t*t+r*r)]},r)}function Lr(t,e){return[t,Math.log(Math.tan(Oo/4+e/2))]}function Tr(t){var e,r=or(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=Oo*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}function Er(t,e){return[Math.log(Math.tan(Oo/4+e/2)),-t]}function Cr(t){return t[0]}function Sr(t){return t[1]}function zr(t){for(var e=t.length,r=[0,1],n=2,i=2;e>i;i++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Pr(t,e){return t[0]-e[0]||t[1]-e[1]}function jr(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 Ir(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Dr(){nn(this),this.edge=this.site=this.circle=null}function Rr(t){var e=al.pop()||new Dr;return e.site=t,e}function Fr(t){Xr(t),rl.remove(t),al.push(t),nn(t)}function Nr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Fr(t);for(var l=a;l.circle&&vo(r-l.circle.x)<Po&&vo(n-l.circle.cy)<Po;)a=l.P,s.unshift(l),Fr(l),l=a;s.unshift(l),Xr(l);for(var u=o;u.circle&&vo(r-u.circle.x)<Po&&vo(n-u.circle.cy)<Po;)o=u.N,s.push(u),Fr(u),u=o;s.push(u),Xr(u);var c,h=s.length;for(c=1;h>c;++c)u=s[c],l=s[c-1],tn(u.edge,l.site,u.site,i);l=s[0],u=s[h-1],u.edge=Kr(l.site,u.site,null,i),Wr(l),Wr(u)}function Br(t){for(var e,r,n,i,a=t.x,o=t.y,s=rl._;s;)if(n=Ur(s,o)-a,n>Po)s=s.L;else{if(i=a-Vr(s,o),!(i>Po)){n>-Po?(e=s.P,r=s):i>-Po?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Rr(t);if(rl.insert(e,l),e||r){if(e===r)return Xr(e),r=Rr(e.site),rl.insert(l,r),l.edge=r.edge=Kr(e.site,l.site),Wr(e),void Wr(r);if(!r)return void(l.edge=Kr(e.site,l.site));Xr(e),Xr(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=r.site,g=p.x-c,v=p.y-h,m=2*(f*v-d*g),y=f*f+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(f*b-g*y)/m+h};tn(r.edge,u,p,x),l.edge=Kr(u,t,null,x),r.edge=Kr(t,p,null,x),Wr(e),Wr(r)}}function Ur(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 Vr(t,e){var r=t.N;if(r)return Ur(r,e);var n=t.site;return n.y===e?n.x:1/0}function qr(t){this.site=t,this.edges=[]}function Hr(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],g=el,v=g.length;v--;)if(a=g[v],a&&a.prepare())for(s=a.edges,l=s.length,o=0;l>o;)c=s[o].end(),n=c.x,i=c.y,u=s[++o%l].start(),e=u.x,r=u.y,(vo(n-e)>Po||vo(i-r)>Po)&&(s.splice(o,0,new en(Jr(a.site,c,vo(n-h)<Po&&p-i>Po?{x:h,y:vo(e-h)<Po?r:p}:vo(i-p)<Po&&f-n>Po?{x:vo(r-p)<Po?e:f,y:p}:vo(n-f)<Po&&i-d>Po?{x:f,y:vo(e-f)<Po?r:d}:vo(i-d)<Po&&n-h>Po?{x:vo(r-d)<Po?e:h,y:d}:null),a.site,null)),++l)}function Gr(t,e){return e.angle-t.angle}function Yr(){nn(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,h=a.y-s,f=2*(l*h-u*c);if(!(f>=-jo)){var d=l*l+u*u,p=c*c+h*h,g=(h*d-u*p)/f,v=(l*p-c*d)/f,h=v+s,m=ol.pop()||new Yr;m.arc=t,m.site=i,m.x=g+o,m.y=h+Math.sqrt(g*g+v*v),m.cy=h,t.circle=m;for(var y=null,b=il._;b;)if(m.y<b.y||m.y===b.y&&m.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}il.insert(y,m),y||(nl=m)}}}}function Xr(t){var e=t.circle;e&&(e.P||(nl=e.N),il.remove(e),ol.push(e),nn(e),t.circle=null)}function Zr(t){for(var e,r=tl,n=qe(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)e=r[i],(!Qr(e,t)||!n(e)||vo(e.a.x-e.b.x)<Po&&vo(e.a.y-e.b.y)<Po)&&(e.a=e.b=null,r.splice(i,1))}function Qr(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,f=c.x,d=c.y,p=h.x,g=h.y,v=(f+p)/2,m=(d+g)/2;if(g===d){if(o>v||v>=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.y<l)return}else a={x:v,y:u};r={x:v,y:l}}}else if(n=(f-p)/(g-d),i=m-n*v,-1>n||n>1)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<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(g>d){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function $r(t,e){this.l=t,this.r=e,this.a=this.b=null}function Kr(t,e,r,n){var i=new $r(t,e);return tl.push(i),r&&tn(i,t,e,r),n&&tn(i,e,t,n),el[t.i].edges.push(new en(i,t,e)),el[e.i].edges.push(new en(i,e,t)),i}function Jr(t,e,r){var n=new $r(t,null);return n.a=e,n.b=r,tl.push(n),n}function tn(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function en(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function rn(){this._=null}function nn(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function an(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function on(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function sn(t){for(;t.L;)t=t.L;return t}function ln(t,e){var r,n,i,a=t.sort(un).pop();for(tl=[],el=new Array(t.length),rl=new rn,il=new rn;;)if(i=nl,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))(a.x!==r||a.y!==n)&&(el[a.i]=new qr(a),Br(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Nr(i.arc)}e&&(Zr(e),Hr(e));var o={cells:el,edges:tl};return rl=il=tl=el=null,o}function un(t,e){return e.y-t.y||e.x-t.x}function cn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function hn(t){return t.x}function fn(t){return t.y}function dn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pn(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&pn(t,l[0],r,n,o,s),l[1]&&pn(t,l[1],o,n,i,s),l[2]&&pn(t,l[2],r,s,o,a),l[3]&&pn(t,l[3],o,s,i,a)}}function gn(t,e,r,n,i,a,o){var s,l=1/0;return function u(t,c,h,f,d){if(!(c>a||h>o||n>f||i>d)){if(p=t.point){var p,g=e-t.x,v=r-t.y,m=g*g+v*v;if(l>m){var y=Math.sqrt(l=m);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=t.nodes,x=.5*(c+f),_=.5*(h+d),w=e>=x,k=r>=_,A=k<<1|w,M=A+4;M>A;++A)if(t=b[3&A])switch(3&A){case 0:u(t,c,h,x,_);break;case 1:u(t,x,h,f,_);break;case 2:u(t,c,_,x,d);break;case 3:u(t,x,_,f,d)}}}(t,n,i,a,o),s}function vn(t,e){t=no.rgb(t),e=no.rgb(e);var r=t.r,n=t.g,i=t.b,a=e.r-r,o=e.g-n,s=e.b-i;return function(t){return\"#\"+wt(Math.round(r+a*t))+wt(Math.round(n+o*t))+wt(Math.round(i+s*t))}}function mn(t,e){var r,n={},i={};for(r in t)r in e?n[r]=xn(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function yn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function bn(t,e){var r,n,i,a=ll.lastIndex=ul.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=ll.exec(t))&&(n=ul.exec(e));)(i=n.index)>a&&(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,\n",
"l.push({i:o,x:yn(r,n)})),a=ul.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+\"\"}):function(){return e}:(e=l.length,function(t){for(var r,n=0;e>n;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})}function xn(t,e){for(var r,n=no.interpolators.length;--n>=0&&!(r=no.interpolators[n](t,e)););return r}function _n(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;s>r;++r)n.push(xn(t[r],e[r]));for(;a>r;++r)i[r]=t[r];for(;o>r;++r)i[r]=e[r];return function(t){for(r=0;s>r;++r)i[r]=n[r](t);return i}}function wn(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function kn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function Mn(t){return t*t}function Ln(t){return t*t*t}function Tn(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(.5>t?r:3*(t-e)+r-.75)}function En(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Ro)}function Sn(t){return Math.pow(2,10*(t-1))}function zn(t){return 1-Math.sqrt(1-t*t)}function Pn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Io*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Io/e)}}function jn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function On(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function In(t,e){t=no.hcl(t),e=no.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:-180>a&&(a+=360),function(t){return ft(r+a*t,n+o*t,i+s*t)+\"\"}}function Dn(t,e){t=no.hsl(t),e=no.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:-180>a&&(a+=360),function(t){return ct(r+a*t,n+o*t,i+s*t)+\"\"}}function Rn(t,e){t=no.lab(t),e=no.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 Fn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Nn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Un(e),i=Bn(e,r),a=Un(Vn(r,e,-i))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*No,this.translate=[t.e,t.f],this.scale=[n,a],this.skew=a?Math.atan2(i,a)*No:0}function Bn(t,e){return t[0]*e[0]+t[1]*e[1]}function Un(t){var e=Math.sqrt(Bn(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Vn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function qn(t,e){var r,n=[],i=[],a=no.transform(t),o=no.transform(e),s=a.translate,l=o.translate,u=a.rotate,c=o.rotate,h=a.skew,f=o.skew,d=a.scale,p=o.scale;return s[0]!=l[0]||s[1]!=l[1]?(n.push(\"translate(\",null,\",\",null,\")\"),i.push({i:1,x:yn(s[0],l[0])},{i:3,x:yn(s[1],l[1])})):l[0]||l[1]?n.push(\"translate(\"+l+\")\"):n.push(\"\"),u!=c?(u-c>180?c+=360:c-u>180&&(u+=360),i.push({i:n.push(n.pop()+\"rotate(\",null,\")\")-2,x:yn(u,c)})):c&&n.push(n.pop()+\"rotate(\"+c+\")\"),h!=f?i.push({i:n.push(n.pop()+\"skewX(\",null,\")\")-2,x:yn(h,f)}):f&&n.push(n.pop()+\"skewX(\"+f+\")\"),d[0]!=p[0]||d[1]!=p[1]?(r=n.push(n.pop()+\"scale(\",null,\",\",null,\")\"),i.push({i:r-4,x:yn(d[0],p[0])},{i:r-2,x:yn(d[1],p[1])})):(1!=p[0]||1!=p[1])&&n.push(n.pop()+\"scale(\"+p+\")\"),r=i.length,function(t){for(var e,a=-1;++a<r;)n[(e=i[a]).i]=e.x(t);return n.join(\"\")}}function Hn(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Gn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Yn(t){for(var e=t.source,r=t.target,n=Xn(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function Wn(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Xn(t,e){if(t===e)return t;for(var r=Wn(t),n=Wn(e),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}function Zn(t){t.fixed|=2}function Qn(t){t.fixed&=-7}function $n(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Kn(t){t.fixed&=-5}function Jn(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var a,o=t.nodes,s=o.length,l=-1;++l<s;)a=o[l],null!=a&&(Jn(a,e,r),t.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*r[t.point.index];t.charge+=t.pointCharge=u,n+=u*t.point.x,i+=u*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}function ti(t,e){return no.rebind(t,e,\"sort\",\"children\",\"value\"),t.nodes=t,t.links=oi,t}function ei(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function ri(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;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function ni(t){return t.children}function ii(t){return t.value}function ai(t,e){return e.value-t.value}function oi(t){return no.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function si(t){return t.x}function li(t){return t.y}function ui(t,e,r){t.y0=e,t.y=r}function ci(t){return no.range(t.length)}function hi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function fi(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;a>r;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function di(t){return t.reduce(pi,0)}function pi(t,e){return t+e[1]}function gi(t,e){return vi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vi(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[no.min(t),no.max(t)]}function yi(t,e){return t.value-e.value}function bi(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function xi(t,e){t._pack_next=e,e._pack_prev=t}function _i(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 wi(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(ki),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],Li(n,i,a),e(a),bi(n,a),n._pack_prev=a,bi(a,i),i=n._pack_next,o=3;u>o;o++){Li(n,i,a=r[o]);var p=0,g=1,v=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(_i(s,a)){p=1;break}if(1==p)for(l=n._pack_prev;l!==s._pack_prev&&!_i(l,a);l=l._pack_prev,v++);p?(v>g||g==v&&i.r<n.r?xi(n,i=s):xi(n=l,i),o--):(bi(n,a),i=a,e(a))}var m=(c+h)/2,y=(f+d)/2,b=0;for(o=0;u>o;o++)a=r[o],a.x-=m,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=b,r.forEach(Ai)}}function ki(t){t._pack_next=t._pack_prev=t}function Ai(t){delete t._pack_next,delete t._pack_prev}function Mi(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a<o;)Mi(i[a],e,r,n)}function Li(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a;o*=o,n*=n;var l=.5+(n-o)/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function Ti(t,e){return t.parent==e.parent?1:2}function Ei(t){var e=t.children;return e.length?e[0]:t.t}function Ci(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Si(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function zi(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)e=i[a],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function Pi(t,e,r){return t.a.parent===e.parent?t.a:r}function ji(t){return 1+no.max(t,function(t){return t.y})}function Oi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ii(t){var e=t.children;return e&&e.length?Ii(e[0]):t}function Di(t){var e,r=t.children;return r&&(e=r.length)?Di(r[e-1]):t}function Ri(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Fi(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 0>i&&(r+=i/2,i=0),0>a&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Ni(t){var e=t[0],r=t[t.length-1];return r>e?[e,r]:[r,e]}function Bi(t){return t.rangeExtent?t.rangeExtent():Ni(t.range())}function Ui(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function Vi(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return a>o&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function qi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xl}function Hi(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<=s;)i.push(r(t[o-1],t[o])),a.push(n(e[o-1],e[o]));return function(e){var r=no.bisect(t,e,1,s)-1;return a[r](i[r](e))}}function Gi(t,e,r,n){function i(){var i=Math.min(t.length,e.length)>2?Hi:Ui,l=n?Gn:Hn;return o=i(t,e,l,r),s=i(e,t,l,xn),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(Fn)},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 Zi(t,e)},a.tickFormat=function(e,r){return Qi(t,e,r)},a.nice=function(e){return Wi(t,e),i()},a.copy=function(){return Gi(t,e,r,n)},i()}function Yi(t,e){return no.rebind(t,e,\"range\",\"rangeRound\",\"interpolate\",\"clamp\")}function Wi(t,e){return Vi(t,qi(Xi(t,e)[2]))}function Xi(t,e){null==e&&(e=10);var r=Ni(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return.15>=a?i*=10:.35>=a?i*=5:.75>=a&&(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 Zi(t,e){return no.range.apply(no,Xi(t,e))}function Qi(t,e,r){var n=Xi(t,e);if(r){var i=ls.exec(r);if(i.shift(),\"s\"===i[8]){var a=no.formatPrefix(Math.max(vo(n[0]),vo(n[1])));return i[7]||(i[7]=\".\"+$i(a.scale(n[2]))),i[8]=\"f\",r=no.format(i.join(\"\")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]=\".\"+Ki(i[8],n)),r=i.join(\"\")}else r=\",.\"+$i(n[2])+\"f\";return no.format(r)}function $i(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Ki(t,e){var r=$i(e[2]);return t in _l?Math.abs(r-$i(Math.max(vo(e[0]),vo(e[1]))))+ +(\"e\"!==t):r-2*(\"%\"===t)}function Ji(t,e,r,n){function i(t){return(r?Math.log(0>t?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=Vi(n.map(i),r?Math:kl);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Ni(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(;c>u;u++)for(var f=1;h>f;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(var f=h-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,e){if(!arguments.length)return wl;arguments.length<2?e=wl:\"function\"!=typeof e&&(e=no.format(e));var n,s=Math.max(.1,t/o.ticks().length),l=r?(n=1e-12,Math.ceil):(n=-1e-12,Math.floor);return function(t){return t/a(l(i(t)+n))<=s?e(t):\"\"}},o.copy=function(){return Ji(t.copy(),e,r,n)},Yi(o,t)}function ta(t,e,r){function n(e){return t(i(e))}var i=ea(e),a=ea(1/e);return n.invert=function(e){return a(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),n):r},n.ticks=function(t){return Zi(r,t)},n.tickFormat=function(t,e){return Qi(r,t,e)},n.nice=function(t){return n.domain(Wi(r,t))},n.exponent=function(o){return arguments.length?(i=ea(e=o),a=ea(1/e),t.domain(r.map(i)),n):e},n.copy=function(){return ta(t.copy(),e,r)},Yi(n,t)}function ea(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ra(t,e){function r(r){return a[((i.get(r)||(\"range\"===e.t?i.set(r,t.push(r)):NaN))-1)%a.length]}function n(e,r){return no.range(t.length).map(function(t){return e+r*t})}var i,a,o;return r.domain=function(n){if(!arguments.length)return t;t=[],i=new h;for(var a,o=-1,s=n.length;++o<s;)i.has(a=n[o])||i.set(a,t.push(a));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(a=t,o=0,e={t:\"range\",a:arguments},r):a},r.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);return a=n(l+c*s/2,c),o=0,e={t:\"rangePoints\",a:arguments},r},r.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;return a=n(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c),o=0,e={t:\"rangeRoundPoints\",a:arguments},r},r.rangeBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=(h-c)/(t.length-s+2*l);return a=n(c+f*l,f),u&&a.reverse(),o=f*(1-s),e={t:\"rangeBands\",a:arguments},r},r.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=Math.floor((h-c)/(t.length-s+2*l));return a=n(c+Math.round((h-c-(t.length-s)*f)/2),f),u&&a.reverse(),o=Math.round(f*(1-s)),e={t:\"rangeRoundBands\",a:arguments},r},r.rangeBand=function(){return o},r.rangeExtent=function(){return Ni(e.a[0])},r.copy=function(){return ra(t,e)},r.domain(t)}function na(t,e){function r(){var r=0,i=e.length;for(s=[];++r<i;)s[r-1]=no.quantile(t,r/i);return n}function n(t){return isNaN(t=+t)?void 0:e[no.bisect(s,t)]}var s;return n.domain=function(e){return arguments.length?(t=e.map(a).filter(o).sort(i),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return s},n.invertExtent=function(r){return r=e.indexOf(r),0>r?[NaN,NaN]:[r>0?s[r-1]:t[0],r<s.length?s[r]:t[t.length-1]]},n.copy=function(){return na(t,e)},r()}function ia(t,e,r){function n(e){return r[Math.max(0,Math.min(o,Math.floor(a*(e-t))))]}function i(){return a=r.length/(e-t),o=r.length-1,n}var a,o;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],i()):[t,e]},n.range=function(t){return arguments.length?(r=t,i()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=0>e?NaN:e/a+t,[e,e+1/a]},n.copy=function(){return ia(t,e,r)},i()}function aa(t,e){function r(r){return r>=r?e[no.bisect(t,r)]:void 0}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return aa(t,e)},r}function oa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return Zi(t,e)},e.tickFormat=function(e,r){return Qi(t,e,r)},e.copy=function(){return oa(t)},e}function sa(){return 0}function la(t){return t.innerRadius}function ua(t){return t.outerRadius}function ca(t){return t.startAngle}function ha(t){return t.endAngle}function fa(t){return t&&t.padAngle}function da(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function pa(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,g=(h+d)/2,v=f-c,m=d-h,y=v*v+m*m,b=r-n,x=c*d-f*h,_=(0>m?-1:1)*Math.sqrt(b*b*y-x*x),w=(x*m-v*_)/y,k=(-x*v-m*_)/y,A=(x*m+v*_)/y,M=(-x*v+m*_)/y,L=w-p,T=k-g,E=A-p,C=M-g;return L*L+T*T>E*E+C*C&&(w=A,k=M),[[w-l,k-u],[w*r/b,k*r/b]]}function ga(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);++h<f;)i.call(this,l=e[h],h)?c.push([+d.call(this,l,h),+p.call(this,l,h)]):c.length&&(o(),c=[]);return c.length&&o(),u.length?u.join(\"\"):null}var r=Cr,n=Sr,i=Se,a=va,o=a.key,s=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(o=\"function\"==typeof t?a=t:(a=Cl.get(t)||va).key,e):o},e.tension=function(t){return arguments.length?(s=t,e):s},e}function va(t){return t.join(\"L\")}function ma(t){return va(t)+\"Z\"}function ya(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"H\",(n[0]+(n=t[e])[0])/2,\"V\",n[1]);return r>1&&i.push(\"H\",n[0]),i.join(\"\")}function ba(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"V\",(n=t[e])[1],\"H\",n[0]);return i.join(\"\")}function xa(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"H\",(n=t[e])[0],\"V\",n[1]);return i.join(\"\")}function _a(t,e){return t.length<4?va(t):t[1]+Aa(t.slice(1,-1),Ma(t,e))}function wa(t,e){return t.length<3?va(t):t[0]+Aa((t.push(t[0]),t),Ma([t[t.length-2]].concat(t,[t[1]]),e))}function ka(t,e){return t.length<3?va(t):t[0]+Aa(t,Ma(t,e))}function Aa(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return va(t);var r=t.length!=e.length,n=\"\",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+=\"Q\"+(a[0]-2*o[0]/3)+\",\"+(a[1]-2*o[1]/3)+\",\"+a[0]+\",\"+a[1],i=t[1],l=2),e.length>1){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;u<e.length;u++,l++)a=t[l],s=e[u],n+=\"S\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1]}if(r){var c=t[l];n+=\"Q\"+(a[0]+2*s[0]/3)+\",\"+(a[1]+2*s[1]/3)+\",\"+c[0]+\",\"+c[1]}return n}function Ma(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function La(t){if(t.length<3)return va(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,\",\",a,\"L\",Sa(Pl,o),\",\",Sa(Pl,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),za(l,o,s);return t.pop(),l.push(\"L\",n),l.join(\"\")}function Ta(t){if(t.length<4)return va(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Sa(Pl,a)+\",\"+Sa(Pl,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),za(r,a,o);return r.join(\"\")}function Ea(t){for(var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);for(e=[Sa(Pl,o),\",\",Sa(Pl,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),za(e,o,s);return e.join(\"\")}function Ca(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return La(t)}function Sa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function za(t,e,r){t.push(\"C\",Sa(Sl,e),\",\",Sa(Sl,r),\",\",Sa(zl,e),\",\",Sa(zl,r),\",\",Sa(Pl,e),\",\",Sa(Pl,r))}function Pa(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ja(t){for(var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=Pa(i,a);++e<r;)n[e]=(o+(o=Pa(i=a,a=t[e+1])))/2;return n[e]=o,n}function Oa(t){for(var e,r,n,i,a=[],o=ja(t),s=-1,l=t.length-1;++s<l;)e=Pa(t[s],t[s+1]),vo(e)<Po?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,i=r*r+n*n,i>9&&(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 Ia(t){return t.length<3?va(t):t[0]+Aa(t,Oa(t))}function Da(t){for(var e,r,n,i=-1,a=t.length;++i<a;)e=t[i],r=e[0],n=e[1]-Ro,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Ra(t){function e(e){function l(){g.push(\"M\",s(t(m),h),c,u(t(v.reverse()),h),\"Z\")}for(var f,d,p,g=[],v=[],m=[],y=-1,b=e.length,x=Et(r),_=Et(i),w=r===n?function(){return d}:Et(n),k=i===a?function(){return p}:Et(a);++y<b;)o.call(this,f=e[y],y)?(v.push([d=+x.call(this,f,y),p=+_.call(this,f,y)]),m.push([+w.call(this,f,y),+k.call(this,f,y)])):v.length&&(l(),v=[],m=[]);return v.length&&l(),g.length?g.join(\"\"):null}var r=Cr,n=Cr,i=0,a=Sr,o=Se,s=va,l=s.key,u=s,c=\"L\",h=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=a=t,e):a},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(a=t,e):a},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(l=\"function\"==typeof t?s=t:(s=Cl.get(t)||va).key,u=s.reverse||s,c=s.closed?\"M\":\"L\",e):l},e.tension=function(t){return arguments.length?(h=t,e):h},e}function Fa(t){return t.radius}function Na(t){return[t.x,t.y]}function Ba(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Ro;return[r*Math.cos(n),r*Math.sin(n)]}}function Ua(){return 64}function Va(){return\"circle\"}function qa(t){var e=Math.sqrt(t/Oo);return\"M0,\"+e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+-e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+e+\"Z\"}function Ha(t){return function(){var e,r;(e=this[t])&&(r=e[e.active])&&(--e.count?delete e[e.active]:delete this[t],e.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Ga(t,e,r){return _o(t,Nl),t.namespace=e,t.id=r,t}function Ya(t,e,r,n){var i=t.id,a=t.namespace;return G(t,\"function\"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function Wa(t){return null==t&&(t=\"\"),function(){this.textContent=t}}function Xa(t){return null==t?\"__transition__\":\"__transition_\"+t+\"__\"}function Za(t,e,r,n,i){var a=t[r]||(t[r]={active:0,count:0}),o=a[n];if(!o){var s=i.time;o=a[n]={tween:new h,time:s,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++a.count,no.timer(function(i){function l(r){if(a.active>n)return c();var i=a[a.active];i&&(--a.count,delete a[a.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),a.active=n,o.event&&o.event.start.call(t,t.__data__,e),o.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&g.push(n)}),f=o.ease,h=o.duration,no.timer(function(){return p.c=u(r||1)?Se:u,1},0,s)}function u(r){if(a.active!==n)return 1;for(var i=r/h,s=f(i),l=g.length;l>0;)g[--l].call(t,s);return i>=1?(o.event&&o.event.end.call(t,t.__data__,e),c()):void 0}function c(){return--a.count?delete a[n]:delete t[r],1}var h,f,d=o.delay,p=as,g=[];return p.t=d+s,i>=d?l(i-d):void(p.c=l)},0,s)}}function Qa(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(\"+(isFinite(n)?n:r(t))+\",0)\"})}function $a(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(0,\"+(isFinite(n)?n:r(t))+\")\"})}function Ka(t){return t.toISOString()}function Ja(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,a=no.bisect(Xl,i);return a==Xl.length?[e.year,Xi(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Xl[a-1]<Xl[a]/i?a-1:a]:[$l,Xi(t,r)[2]]}return n.invert=function(e){return to(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(to)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,to(+r+1),e).length}var a=n.domain(),o=Ni(a),s=null==t?i(o,10):\"number\"==typeof t&&i(o,t);return s&&(t=s[0],e=s[1]),n.domain(Vi(a,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=to(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=to(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Ni(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],to(+r[1]+1),1>e?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Ja(t.copy(),e,r)},Yi(n,t)}function to(t){return new Date(t)}function eo(t){return JSON.parse(t.responseText)}function ro(t){var e=oo.createRange();return e.selectNode(oo.body),e.createContextualFragment(t.responseText)}var no={version:\"3.5.6\"},io=[].slice,ao=function(t){return io.call(t)},oo=this.document;if(oo)try{ao(oo.documentElement.childNodes)[0].nodeType}catch(so){ao=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}),oo)try{oo.createElement(\"DIV\").style.setProperty(\"opacity\",0,\"\")}catch(lo){var uo=this.Element.prototype,co=uo.setAttribute,ho=uo.setAttributeNS,fo=this.CSSStyleDeclaration.prototype,po=fo.setProperty;uo.setAttribute=function(t,e){co.call(this,t,e+\"\")},uo.setAttributeNS=function(t,e,r){ho.call(this,t,e,r+\"\")},fo.setProperty=function(t,e,r){po.call(this,t,e+\"\",r)}}no.ascending=i,no.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:NaN},no.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},no.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},no.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),n>i&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),n>i&&(i=n))}return[r,i]},no.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)o(r=+t[a])&&(n+=r);else for(;++a<i;)o(r=+e.call(t,t[a],a))&&(n+=r);return n},no.mean=function(t,e){var r,n=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)o(r=a(t[s]))?n+=r:--l;else for(;++s<i;)o(r=a(e.call(t,t[s],s)))?n+=r:--l;return l?n/l:void 0},no.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},no.median=function(t,e){var r,n=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)o(r=a(t[l]))&&n.push(r);else for(;++l<s;)o(r=a(e.call(t,t[l],l)))&&n.push(r);return n.length?no.quantile(n.sort(i),.5):void 0},no.variance=function(t,e){var r,n,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length)for(;++u<i;)o(r=a(t[u]))&&(n=r-s,s+=n/++c,l+=n*(r-s));else for(;++u<i;)o(r=a(e.call(t,t[u],u)))&&(n=r-s,s+=n/++c,l+=n*(r-s));return c>1?l/(c-1):void 0},no.deviation=function(){var t=no.variance.apply(this,arguments);return t?Math.sqrt(t):t};var go=s(i);no.bisectLeft=go.left,no.bisect=no.bisectRight=go.right,no.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},no.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,2>a&&(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},no.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},no.pairs=function(t){for(var e,r=0,n=t.length-1,i=t[0],a=new Array(0>n?0:n);n>r;)a[r]=[e=i,i=t[++r]];return a},no.zip=function(){if(!(n=arguments.length))return[];for(var t=-1,e=no.min(arguments,l),r=new Array(e);++t<e;)for(var n,i=-1,a=r[t]=new Array(n);++i<n;)a[i]=arguments[i][t];return r},no.transpose=function(t){return no.zip.apply(no,t)},no.keys=function(t){var e=[];for(var r in t)e.push(r);return e},no.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},no.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},no.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var vo=Math.abs;no.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(vo(r)),o=-1;if(t*=a,e*=a,r*=a,0>r)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},no.map=function(t,e){var r=new h;if(t instanceof h)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};var mo=\"__proto__\",yo=\"\\x00\";c(h,{has:p,get:function(t){return this._[f(t)]},set:function(t,e){return this._[f(t)]=e},remove:g,keys:v,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:d(e),value:this._[e]});return t},size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}}),no.nest=function(){function t(e,o,s){if(s>=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,c,f,d=-1,p=o.length,g=a[s++],v=new h;++d<p;)(f=v.get(l=g(u=o[d])))?f.push(u):v.set(l,[u]);return e?(u=e(),c=function(r,n){u.set(r,t(e,n,s))}):(u={},c=function(r,n){u[r]=t(e,n,s)}),v.forEach(c),u}function e(t,r){if(r>=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(no.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},no.set=function(t){var e=new b;if(t)for(var r=0,n=t.length;n>r;++r)e.add(t[r]);return e},c(b,{has:p,add:function(t){return this._[f(t+=\"\")]=!0,t},remove:g,values:v,size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}}),no.behavior={},no.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=_(t,e,e[r]);return t};var bo=[\"webkit\",\"ms\",\"moz\",\"Moz\",\"o\",\"O\"];no.dispatch=function(){for(var t=new A,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=M(t);return t},A.prototype.on=function(t,e){var r=t.indexOf(\".\"),n=\"\";if(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}},no.event=null,no.requote=function(t){return t.replace(xo,\"\\\\$&\")};var xo=/[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g,_o={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},wo=function(t,e){return e.querySelector(t)},ko=function(t,e){return e.querySelectorAll(t)},Ao=function(t,e){var r=t.matches||t[w(t,\"matchesSelector\")];return(Ao=function(t,e){return r.call(t,e)})(t,e)};\"function\"==typeof Sizzle&&(wo=function(t,e){return Sizzle(t,e)[0]||null},ko=Sizzle,Ao=Sizzle.matchesSelector),no.selection=function(){return no.select(oo.documentElement)};var Mo=no.selection.prototype=[];Mo.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&\"__data__\"in i&&(r.__data__=i.__data__)):e.push(null)}return C(a)},Mo.selectAll=function(t){var e,r,n=[];t=z(t);for(var i=-1,a=this.length;++i<a;)for(var o=this[i],s=-1,l=o.length;++s<l;)(r=o[s])&&(n.push(e=ao(t.call(r,r.__data__,s,i))),e.parentNode=r);return C(n)};var Lo={svg:\"http://www.w3.org/2000/svg\",xhtml:\"http://www.w3.org/1999/xhtml\",xlink:\"http://www.w3.org/1999/xlink\",xml:\"http://www.w3.org/XML/1998/namespace\",xmlns:\"http://www.w3.org/2000/xmlns/\"};no.ns={prefix:Lo,qualify:function(t){var e=t.indexOf(\":\"),r=t;return e>=0&&(r=t.slice(0,e),t=t.slice(e+1)),Lo.hasOwnProperty(r)?{space:Lo[r],local:t}:t}},Mo.attr=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node();return t=no.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(P(e,t[e]));return this}return this.each(P(t,e))},Mo.classed=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node(),n=(t=I(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute(\"class\");++i<n;)if(!O(t[i]).test(e))return!1;return!0}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Mo.style=function(t,e,r){var i=arguments.length;if(3>i){if(\"string\"!=typeof t){2>i&&(e=\"\");for(r in t)this.each(F(r,t[r],e));return this}if(2>i){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=\"\"}return this.each(F(t,e,r))},Mo.property=function(t,e){if(arguments.length<2){if(\"string\"==typeof t)return this.node()[t];for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},Mo.text=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){\n",
"var e=t.apply(this,arguments);this.textContent=null==e?\"\":e}:null==t?function(){this.textContent=\"\"}:function(){this.textContent=t}):this.node().textContent},Mo.html=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?\"\":e}:null==t?function(){this.innerHTML=\"\"}:function(){this.innerHTML=t}):this.node().innerHTML},Mo.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Mo.insert=function(t,e){return t=B(t),e=S(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Mo.remove=function(){return this.each(U)},Mo.data=function(t,e){function r(t,r){var n,i,a,o=t.length,c=r.length,f=Math.min(o,c),d=new Array(c),p=new Array(c),g=new Array(o);if(e){var v,m=new h,y=new Array(o);for(n=-1;++n<o;)m.has(v=e.call(i=t[n],i.__data__,n))?g[n]=i:m.set(v,i),y[n]=v;for(n=-1;++n<c;)(i=m.get(v=e.call(r,a=r[n],n)))?i!==!0&&(d[n]=i,i.__data__=a):p[n]=V(a),m.set(v,!0);for(n=-1;++n<o;)m.get(y[n])!==!0&&(g[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,d[n]=i):p[n]=V(a);for(;c>n;++n)p[n]=V(r[n]);for(;o>n;++n)g[n]=t[n]}p.update=d,p.parentNode=d.parentNode=g.parentNode=t.parentNode,s.push(p),l.push(d),u.push(g)}var n,i,a=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++a<o;)(i=n[a])&&(t[a]=i.__data__);return t}var s=Y([]),l=C([]),u=C([]);if(\"function\"==typeof t)for(;++a<o;)r(n=this[a],t.call(n,n.parentNode.__data__,a));else for(;++a<o;)r(n=this[a],t);return l.enter=function(){return s},l.exit=function(){return u},l},Mo.datum=function(t){return arguments.length?this.property(\"__data__\",t):this.property(\"__data__\")},Mo.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=q(t));for(var a=0,o=this.length;o>a;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;l>s;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return C(i)},Mo.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Mo.sort=function(t){t=H.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Mo.each=function(t){return G(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Mo.call=function(t){var e=ao(arguments);return t.apply(e[0]=this,e),this},Mo.empty=function(){return!this.node()},Mo.node=function(){for(var t=0,e=this.length;e>t;t++)for(var r=this[t],n=0,i=r.length;i>n;n++){var a=r[n];if(a)return a}return null},Mo.size=function(){var t=0;return G(this,function(){++t}),t};var To=[];no.selection.enter=Y,no.selection.enter.prototype=To,To.append=Mo.append,To.empty=Mo.empty,To.node=Mo.node,To.call=Mo.call,To.size=Mo.size,To.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return C(o)},To.insert=function(t,e){return arguments.length<2&&(e=W(this)),Mo.insert.call(this,t,e)},no.select=function(t){var r;return\"string\"==typeof t?(r=[wo(t,oo)],r.parentNode=oo.documentElement):(r=[t],r.parentNode=e(t)),C([r])},no.selectAll=function(t){var e;return\"string\"==typeof t?(e=ao(ko(t,oo)),e.parentNode=oo.documentElement):(e=t,e.parentNode=null),C([e])},Mo.on=function(t,e,r){var n=arguments.length;if(3>n){if(\"string\"!=typeof t){2>n&&(e=!1);for(r in t)this.each(X(r,t[r],e));return this}if(2>n)return(n=this.node()[\"__on\"+t])&&n._;r=!1}return this.each(X(t,e,r))};var Eo=no.map({mouseenter:\"mouseover\",mouseleave:\"mouseout\"});oo&&Eo.forEach(function(t){\"on\"+t in oo&&Eo.remove(t)});var Co,So=0;no.mouse=function(t){return K(t,T())};var zo=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;no.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=T().changedTouches),e)for(var n,i=0,a=e.length;a>i;++i)if((n=e[i]).identifier===r)return K(t,n)},no.behavior.drag=function(){function t(){this.on(\"mousedown.drag\",a).on(\"touchstart.drag\",o)}function e(t,e,n,a,o){return function(){function s(){var t,r,n=e(f,g);n&&(t=n[0]-b[0],r=n[1]-b[1],p|=t|r,b=n,d({type:\"drag\",x:n[0]+u[0],y:n[1]+u[1],dx:t,dy:r}))}function l(){e(f,g)&&(m.on(a+v,null).on(o+v,null),y(p&&no.event.target===h),d({type:\"dragend\"}))}var u,c=this,h=no.event.target,f=c.parentNode,d=r.of(c,arguments),p=0,g=t(),v=\".drag\"+(null==g?\"\":\"-\"+g),m=no.select(n(h)).on(a+v,s).on(o+v,l),y=$(h),b=e(f,g);i?(u=i.apply(c,arguments),u=[u.x-b[0],u.y-b[1]]):u=[0,0],d({type:\"dragstart\"})}}var r=E(t,\"drag\",\"dragstart\",\"dragend\"),i=null,a=e(k,no.mouse,n,\"mousemove\",\"mouseup\"),o=e(J,no.touch,x,\"touchmove\",\"touchend\");return t.origin=function(e){return arguments.length?(i=e,t):i},no.rebind(t,r,\"on\")},no.touches=function(t,e){return arguments.length<2&&(e=T().touches),e?ao(e).map(function(e){var r=K(t,e);return r.identifier=e.identifier,r}):[]};var Po=1e-6,jo=Po*Po,Oo=Math.PI,Io=2*Oo,Do=Io-Po,Ro=Oo/2,Fo=Oo/180,No=180/Oo,Bo=Math.SQRT2,Uo=2,Vo=4;no.interpolateZoom=function(t,e){function r(t){var e=t*y;if(m){var r=at(g),o=a/(Uo*f)*(r*ot(Bo*e+g)-it(g));return[n+o*u,i+o*c,a*r/at(Bo*e+g)]}return[n+t*u,i+t*c,a*Math.exp(Bo*e)]}var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2],u=o-n,c=s-i,h=u*u+c*c,f=Math.sqrt(h),d=(l*l-a*a+Vo*h)/(2*a*Uo*f),p=(l*l-a*a-Vo*h)/(2*l*Uo*f),g=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(p*p+1)-p),m=v-g,y=(m||Math.log(l/a))/Bo;return r.duration=1e3*y,r},no.behavior.zoom=function(){function t(t){t.on(z,h).on(Ho+\".zoom\",d).on(\"dblclick.zoom\",p).on(O,f)}function e(t){return[(t[0]-A.x)/A.k,(t[1]-A.y)/A.k]}function r(t){return[t[0]*A.k+A.x,t[1]*A.k+A.y]}function i(t){A.k=Math.max(T[0],Math.min(T[1],t))}function a(t,e){e=r(e),A.x+=t[0]-e[0],A.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:A.x,y:A.y,k:A.k},i(Math.pow(2,o)),a(v=r,n),e=no.select(e),C>0&&(e=e.transition().duration(C)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-A.x)/A.k}).map(x.invert)),k&&k.domain(w.range().map(function(t){return(t-A.y)/A.k}).map(w.invert))}function l(t){S++||t({type:\"zoomstart\"})}function u(t){s(),t({type:\"zoom\",scale:A.k,translate:[A.x,A.y]})}function c(t){--S||(t({type:\"zoomend\"}),v=null)}function h(){function t(){h=1,a(no.mouse(i),d),u(s)}function r(){f.on(P,null).on(j,null),p(h&&no.event.target===o),c(s)}var i=this,o=no.event.target,s=I.of(i,arguments),h=0,f=no.select(n(i)).on(P,t).on(j,r),d=e(no.mouse(i)),p=$(i);Fl.call(i),l(s)}function f(){function t(){var t=no.touches(p);return d=A.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=no.event.target;no.select(e).on(x,n).on(_,s),w.push(e);for(var r=no.event.changedTouches,i=0,a=r.length;a>i;++i)v[r[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(500>u-b){var c=l[0];o(p,c,v[c.identifier],Math.floor(Math.log(A.k)/Math.LN2)+1),L()}b=u}else if(l.length>1){var c=l[0],h=l[1],f=c[0]-h[0],d=c[1]-h[1];m=f*f+d*d}}function n(){var t,e,r,n,o=no.touches(p);Fl.call(p);for(var s=0,l=o.length;l>s;++s,n=null)if(r=o[s],n=v[r.identifier]){if(e)break;t=r,e=n}if(n){var c=(c=r[0]-t[0])*c+(c=r[1]-t[1])*c,h=m&&Math.sqrt(c/m);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(h*d)}b=null,a(t,e),u(g)}function s(){if(no.event.touches.length){for(var e=no.event.changedTouches,r=0,n=e.length;n>r;++r)delete v[e[r].identifier];for(var i in v)return void t()}no.selectAll(w).on(y,null),k.on(z,h).on(O,f),M(),c(g)}var d,p=this,g=I.of(p,arguments),v={},m=0,y=\".zoom-\"+no.event.changedTouches[0].identifier,x=\"touchmove\"+y,_=\"touchend\"+y,w=[],k=no.select(p),M=$(p);r(),l(g),k.on(z,null).on(O,r)}function d(){var t=I.of(this,arguments);y?clearTimeout(y):(Fl.call(this),g=e(v=m||no.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),L(),i(Math.pow(2,.002*qo())*A.k),a(v,g),u(t)}function p(){var t=no.mouse(this),r=Math.log(A.k)/Math.LN2;o(this,t,e(t),no.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var g,v,m,y,b,x,_,w,k,A={x:0,y:0,k:1},M=[960,500],T=Go,C=250,S=0,z=\"mousedown.zoom\",P=\"mousemove.zoom\",j=\"mouseup.zoom\",O=\"touchstart.zoom\",I=E(t,\"zoomstart\",\"zoom\",\"zoomend\");return Ho||(Ho=\"onwheel\"in oo?(qo=function(){return-no.event.deltaY*(no.event.deltaMode?120:1)},\"wheel\"):\"onmousewheel\"in oo?(qo=function(){return no.event.wheelDelta},\"mousewheel\"):(qo=function(){return-no.event.detail},\"MozMousePixelScroll\")),t.event=function(t){t.each(function(){var t=I.of(this,arguments),e=A;Dl?no.select(this).transition().each(\"start.zoom\",function(){A=this.__chart__||{x:0,y:0,k:1},l(t)}).tween(\"zoom:zoom\",function(){var r=M[0],n=M[1],i=v?v[0]:r/2,a=v?v[1]:n/2,o=no.interpolateZoom([(i-A.x)/A.k,(a-A.y)/A.k,r/A.k],[(i-e.x)/e.k,(a-e.y)/e.k,r/e.k]);return function(e){var n=o(e),s=r/n[2];this.__chart__=A={x:i-n[0]*s,y:a-n[1]*s,k:s},u(t)}}).each(\"interrupt.zoom\",function(){c(t)}).each(\"end.zoom\",function(){c(t)}):(this.__chart__=A,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(A={x:+e[0],y:+e[1],k:A.k},s(),t):[A.x,A.y]},t.scale=function(e){return arguments.length?(A={x:A.x,y:A.y,k:+e},s(),t):A.k},t.scaleExtent=function(e){return arguments.length?(T=null==e?Go:[+e[0],+e[1]],t):T},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(M=e&&[+e[0],+e[1]],t):M},t.duration=function(e){return arguments.length?(C=+e,t):C},t.x=function(e){return arguments.length?(_=e,x=e.copy(),A={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(k=e,w=e.copy(),A={x:0,y:0,k:1},t):k},no.rebind(t,I,\"on\")};var qo,Ho,Go=[0,1/0];no.color=lt,lt.prototype.toString=function(){return this.rgb()+\"\"},no.hsl=ut;var Yo=ut.prototype=new lt;Yo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Yo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Yo.rgb=function(){return ct(this.h,this.s,this.l)},no.hcl=ht;var Wo=ht.prototype=new lt;Wo.brighter=function(t){return new ht(this.h,this.c,Math.min(100,this.l+Xo*(arguments.length?t:1)))},Wo.darker=function(t){return new ht(this.h,this.c,Math.max(0,this.l-Xo*(arguments.length?t:1)))},Wo.rgb=function(){return ft(this.h,this.c,this.l).rgb()},no.lab=dt;var Xo=18,Zo=.95047,Qo=1,$o=1.08883,Ko=dt.prototype=new lt;Ko.brighter=function(t){return new dt(Math.min(100,this.l+Xo*(arguments.length?t:1)),this.a,this.b)},Ko.darker=function(t){return new dt(Math.max(0,this.l-Xo*(arguments.length?t:1)),this.a,this.b)},Ko.rgb=function(){return pt(this.l,this.a,this.b)},no.rgb=bt;var Jo=bt.prototype=new lt;Jo.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&i>e&&(e=i),r&&i>r&&(r=i),n&&i>n&&(n=i),new bt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new bt(i,i,i)},Jo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new bt(t*this.r,t*this.g,t*this.b)},Jo.hsl=function(){return At(this.r,this.g,this.b)},Jo.toString=function(){return\"#\"+wt(this.r)+wt(this.g)+wt(this.b)};var ts=no.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ts.forEach(function(t,e){ts.set(t,xt(e))}),no.functor=Et,no.xhr=Ct(x),no.dsv=function(t,e){function r(t,r,a){arguments.length<3&&(a=r,r=null);var o=St(t,e,null==r?n:i(r),a);return o.row=function(t){return arguments.length?o.response(null==(r=t)?n:i(t)):r},o}function n(t){return r.parse(t.responseText)}function i(t){return function(e){return r.parse(e.responseText,t)}}function a(e){return e.map(o).join(t)}function o(t){return s.test(t)?'\"'+t.replace(/\\\"/g,'\"\"')+'\"':t}var s=new RegExp('[\"'+t+\"\\n]\"),l=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function(\"d\",\"return {\"+t.map(function(t,e){return JSON.stringify(t)+\": d[\"+e+\"]\"}).join(\",\")+\"}\");n=e?function(t,r){return e(i(t),r)}:i})},r.parseRows=function(t,e){function r(){if(c>=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<u;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}c=r+2;var n=t.charCodeAt(r+1);return 13===n?(i=!0,10===t.charCodeAt(r+2)&&++c):10===n&&(i=!0),t.slice(e+1,r).replace(/\"\"/g,'\"')}for(;u>c;){var n=t.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++s);else if(n!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var n,i,a={},o={},s=[],u=t.length,c=0,h=0;(n=r())!==o;){for(var f=[];n!==a&&n!==o;)f.push(n),n=r();e&&null==(f=e(f,h++))||s.push(f)}return s},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new b,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(o).join(t)].concat(e.map(function(e){return i.map(function(t){return o(e[t])}).join(t)})).join(\"\\n\")},r.formatRows=function(t){return t.map(a).join(\"\\n\")},r},no.csv=no.dsv(\",\",\"text/csv\"),no.tsv=no.dsv(\"\t\",\"text/tab-separated-values\");var es,rs,ns,is,as,os=this[w(this,\"requestAnimationFrame\")]||function(t){setTimeout(t,17)};no.timer=function(t,e,r){var n=arguments.length;2>n&&(e=0),3>n&&(r=Date.now());var i=r+e,a={c:t,t:i,f:!1,n:null};rs?rs.n=a:es=a,rs=a,ns||(is=clearTimeout(is),ns=1,os(jt))},no.timer.flush=function(){Ot(),It()},no.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ss=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\\xb5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"].map(Rt);no.formatPrefix=function(t,e){var r=0;return t&&(0>t&&(t*=-1),e&&(t=no.round(t,Dt(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),ss[8+r/3]};var ls=/(?:([^{])?([<>=^]))?([+\\- ])?([$#])?(0)?(\\d+)?(,)?(\\.-?\\d+)?([a-z%])?/i,us=no.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=no.round(t,Dt(t,e))).toFixed(Math.max(0,Math.min(20,Dt(t*(1+1e-15),e))))}}),cs=no.time={},hs=Date;Bt.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(){fs.setUTCDate.apply(this._,arguments)},setDay:function(){fs.setUTCDay.apply(this._,arguments)},setFullYear:function(){fs.setUTCFullYear.apply(this._,arguments)},setHours:function(){fs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){fs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){fs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){fs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){fs.setUTCSeconds.apply(this._,arguments)},setTime:function(){fs.setTime.apply(this._,arguments)}};var fs=Date.prototype;cs.year=Ut(function(t){return t=cs.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),cs.years=cs.year.range,cs.years.utc=cs.year.utc.range,cs.day=Ut(function(t){var e=new hs(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}),cs.days=cs.day.range,cs.days.utc=cs.day.utc.range,cs.dayOfYear=function(t){var e=cs.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=cs[t]=Ut(function(t){return(t=cs.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=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});cs[t+\"s\"]=r.range,cs[t+\"s\"].utc=r.utc.range,cs[t+\"OfYear\"]=function(t){var r=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(r+e)%7)/7)}}),cs.week=cs.sunday,cs.weeks=cs.sunday.range,cs.weeks.utc=cs.sunday.utc.range,cs.weekOfYear=cs.sundayOfYear;var ds={\"-\":\"\",_:\" \",0:\"0\"},ps=/^\\s*\\d+/,gs=/^%/;no.locale=function(t){return{numberFormat:Ft(t),timeFormat:qt(t)}};var vs=no.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\"]});no.format=vs.numberFormat,no.geo={},ce.prototype={s:0,t:0,add:function(t){he(t,this.t,ms),he(ms.s,this.s,this),this.s?this.t+=ms.t:this.s=ms.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ms=new ce;no.geo.stream=function(t,e){t&&ys.hasOwnProperty(t.type)?ys[t.type](t,e):fe(t,e)};var ys={Feature:function(t,e){fe(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)fe(r[n].geometry,e)}},bs={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){de(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)de(r[n],e,0)},Polygon:function(t,e){pe(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pe(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)fe(r[n],e)}};no.geo.area=function(t){return xs=0,no.geo.stream(t,ws),xs};var xs,_s=new ce,ws={sphere:function(){xs+=4*Oo},point:k,lineStart:k,lineEnd:k,polygonStart:function(){_s.reset(),ws.lineStart=ge},polygonEnd:function(){var t=2*_s;xs+=0>t?4*Oo+t:t,ws.lineStart=ws.lineEnd=ws.point=k}};no.geo.bounds=function(){function t(t,e){b.push(x=[c=t,f=t]),h>e&&(h=e),e>d&&(d=e)}function e(e,r){var n=ve([e*Fo,r*Fo]);if(m){var i=ye(m,n),a=[i[1],-i[0],0],o=ye(a,i);_e(o),o=we(o);var l=e-p,u=l>0?1:-1,g=o[0]*No*u,v=vo(l)>180;if(v^(g>u*p&&u*e>g)){var y=o[1]*No;y>d&&(d=y)}else if(g=(g+360)%360-180,v^(g>u*p&&u*e>g)){var y=-o[1]*No;h>y&&(h=y)}else h>r&&(h=r),r>d&&(d=r);v?p>e?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e):f>=c?(c>e&&(c=e),e>f&&(f=e)):e>p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e)}else t(e,r);m=n,p=e}function r(){_.point=e}function n(){x[0]=c,x[1]=f,_.point=t,m=null}function i(t,r){if(m){var n=t-p;y+=vo(n)>180?n+(n>0?360:-360):n}else g=t,v=r;ws.point(t,r),e(t,r)}function a(){ws.lineStart()}function o(){i(g,v),ws.lineEnd(),vo(y)>Po&&(c=-(f=180)),x[0]=c,x[1]=f,m=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]:t<e[0]||e[1]<t}var c,h,f,d,p,g,v,m,y,b,x,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=i,_.lineStart=a,_.lineEnd=o,y=0,ws.polygonStart()},polygonEnd:function(){ws.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,0>_s?(c=-(f=180),h=-(d=90)):y>Po?d=90:-Po>y&&(h=-90),x[0]=c,x[1]=f}};return function(t){d=f=-(c=h=1/0),b=[],no.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r,n=1,i=b[0],a=[i];e>n;++n)r=b[n],u(r[0],i)||u(r[1],i)?(s(i[0],r[1])>s(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];e>=n;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]]}}(),no.geo.centroid=function(t){ks=As=Ms=Ls=Ts=Es=Cs=Ss=zs=Ps=js=0,no.geo.stream(t,Os);var e=zs,r=Ps,n=js,i=e*e+r*r+n*n;return jo>i&&(e=Es,r=Cs,n=Ss,Po>As&&(e=Ms,r=Ls,n=Ts),i=e*e+r*r+n*n,jo>i)?[NaN,NaN]:[Math.atan2(r,e)*No,nt(n/Math.sqrt(i))*No]};var ks,As,Ms,Ls,Ts,Es,Cs,Ss,zs,Ps,js,Os={sphere:k,point:Ae,lineStart:Le,lineEnd:Te,polygonStart:function(){Os.lineStart=Ee},polygonEnd:function(){Os.lineStart=Le}},Is=Oe(Se,Fe,Be,[-Oo,-Oo/2]),Ds=1e9;no.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(s){return arguments.length?(a=He(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(no.geo.conicEqualArea=function(){return Ge(Ye)}).raw=Ye,no.geo.albers=function(){return no.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},no.geo.albersUsa=function(){function t(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}var e,r,n,i,a=no.geo.albers(),o=no.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=no.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&.234>i&&n>=-.425&&-.214>n?o:i>=.166&&.234>i&&n>=-.214&&-.115>n?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+Po,h+.12*u+Po],[c-.214*u-Po,h+.234*u-Po]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+Po,h+.166*u+Po],[c-.115*u-Po,h+.234*u-Po]]).stream(l).point,t},t.scale(1070)};var Rs,Fs,Ns,Bs,Us,Vs,qs={point:k,lineStart:k,lineEnd:k,polygonStart:function(){Fs=0,qs.lineStart=We},polygonEnd:function(){qs.lineStart=qs.lineEnd=qs.point=k,Rs+=vo(Fs/2)}},Hs={point:Xe,lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k},Gs={point:$e,lineStart:Ke,lineEnd:Je,polygonStart:function(){Gs.lineStart=tr},polygonEnd:function(){Gs.point=$e,Gs.lineStart=Ke,Gs.lineEnd=Je}};no.geo.path=function(){function t(t){return t&&(\"function\"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),no.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 Rs=0,no.geo.stream(t,i(qs)),Rs},t.centroid=function(t){return Ms=Ls=Ts=Es=Cs=Ss=zs=Ps=js=0,no.geo.stream(t,i(Gs)),js?[zs/js,Ps/js]:Ss?[Es/Ss,Cs/Ss]:Ts?[Ms/Ts,Ls/Ts]:[NaN,NaN]},t.bounds=function(t){return Us=Vs=-(Ns=Bs=1/0),no.geo.stream(t,i(Hs)),[[Ns,Bs],[Us,Vs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||nr(t):x,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Ze:new er(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(no.geo.albersUsa()).context(null)},no.geo.transform=function(t){return{stream:function(e){var r=new ir(e);for(var n in t)r[n]=t[n];return r}}},ir.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()}},no.geo.projection=or,no.geo.projectionMutator=sr,(no.geo.equirectangular=function(){return or(ur)}).raw=ur.invert=ur,no.geo.rotation=function(t){function e(e){return e=t(e[0]*Fo,e[1]*Fo),e[0]*=No,e[1]*=No,e}return t=hr(t[0]%360*Fo,t[1]*Fo,t.length>2?t[2]*Fo:0),e.invert=function(e){return e=t.invert(e[0]*Fo,e[1]*Fo),e[0]*=No,e[1]*=No,e},e},cr.invert=ur,no.geo.circle=function(){function t(){var t=\"function\"==typeof n?n.apply(this,arguments):n,e=hr(-t[0]*Fo,-t[1]*Fo,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=No,t[1]*=No}}),{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=gr((e=+n)*Fo,i*Fo),t):e},t.precision=function(n){return arguments.length?(r=gr(e*Fo,(i=+n)*Fo),t):i},t.angle(90)},no.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Fo,i=t[1]*Fo,a=e[1]*Fo,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)},no.geo.graticule=function(){function t(){return{type:\"MultiLineString\",coordinates:e()}}function e(){return no.range(Math.ceil(a/v)*v,i,v).map(f).concat(no.range(Math.ceil(u/m)*m,l,m).map(d)).concat(no.range(Math.ceil(n/p)*p,r,p).filter(function(t){return vo(t%v)>Po}).map(c)).concat(no.range(Math.ceil(s/g)*g,o,g).filter(function(t){return vo(t%m)>Po}).map(h))}var r,n,i,a,o,s,l,u,c,h,f,d,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:[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],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,c=mr(s,o,90),h=yr(n,r,y),f=mr(u,l,90),d=yr(a,i,y),t):y},t.majorExtent([[-180,-90+Po],[180,90-Po]]).minorExtent([[-180,-80-Po],[180,80+Po]])},no.geo.greatArc=function(){function t(){return{type:\"LineString\",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=br,i=xr;return t.distance=function(){return no.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},no.geo.interpolate=function(t,e){return _r(t[0]*Fo,t[1]*Fo,e[0]*Fo,e[1]*Fo)},no.geo.length=function(t){return Ys=0,no.geo.stream(t,Ws),Ys};var Ys,Ws={sphere:k,point:k,lineStart:wr,lineEnd:k,polygonStart:k,polygonEnd:k},Xs=kr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(no.geo.azimuthalEqualArea=function(){return or(Xs)}).raw=Xs;var Zs=kr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(no.geo.azimuthalEquidistant=function(){return or(Zs)}).raw=Zs,(no.geo.conicConformal=function(){return Ge(Ar)}).raw=Ar,(no.geo.conicEquidistant=function(){return Ge(Mr)}).raw=Mr;var Qs=kr(function(t){return 1/t},Math.atan);(no.geo.gnomonic=function(){return or(Qs)}).raw=Qs,Lr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ro]},(no.geo.mercator=function(){return Tr(Lr)}).raw=Lr;var $s=kr(function(){return 1},Math.asin);(no.geo.orthographic=function(){return or($s)}).raw=$s;var Ks=kr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(no.geo.stereographic=function(){return or(Ks)}).raw=Ks,Er.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ro]},(no.geo.transverseMercator=function(){var t=Tr(Er),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=Er,no.geom={},no.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;o>e;e++)s.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(s.sort(Pr),e=0;o>e;e++)l.push([s[e][0],-s[e][1]]);var u=zr(s),c=zr(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e<c.length-f;++e)d.push(t[s[c[e]][2]]);return d}var r=Cr,n=Sr;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},no.geom.polygon=function(t){return _o(t,Js),t};var Js=no.geom.polygon.prototype=[];Js.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},Js.centroid=function(t){\n",
"var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},Js.clip=function(t){for(var e,r,n,i,a,o,s=Ir(t),l=-1,u=this.length-Ir(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)o=e[r],jr(o,c,i)?(jr(a,c,i)||t.push(Or(a,o,c,i)),t.push(o)):jr(a,c,i)&&t.push(Or(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var tl,el,rl,nl,il,al=[],ol=[];qr.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Gr),e.length},en.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},rn.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=sn(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(an(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,an(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?sn(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(e=i.R,e.C&&(e.C=!1,i.C=!0,an(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,on(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,an(this,i),t=this._;break}}else if(e=i.L,e.C&&(e.C=!1,i.C=!0,on(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,an(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,on(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},no.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=s[0][0],i=s[0][1],a=s[1][0],o=s[1][1];return ln(r(t),s).cells.forEach(function(r,s){var l=r.edges,u=r.site,c=e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=n&&u.x<=a&&u.y>=i&&u.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[];c.point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Po)*Po,y:Math.round(o(t,e)/Po)*Po,i:e}})}var n=Cr,i=Sr,a=n,o=i,s=sl;return t?e(t):(e.links=function(t){return ln(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 ln(r(t)).cells.forEach(function(r,n){for(var i,a,o=r.site,s=r.edges.sort(Gr),l=-1,u=s.length,c=s[u-1].edge,h=c.l===o?c.r:c.l;++l<u;)i=c,a=h,c=s[l].edge,h=c.l===o?c.r:c.l,n<a.i&&n<h.i&&cn(o,a,h)<0&&e.push([t[n],t[a.i],t[h.i]])}),e},e.x=function(t){return arguments.length?(a=Et(n=t),e):n},e.y=function(t){return arguments.length?(o=Et(i=t),e):i},e.clipExtent=function(t){return arguments.length?(s=null==t?sl:t,e):s===sl?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===sl?null:s&&s[1]},e)};var sl=[[-1e6,-1e6],[1e6,1e6]];no.geom.delaunay=function(t){return no.geom.voronoi().triangles(t)},no.geom.quadtree=function(t,e,r,n,i){function a(t){function a(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(vo(l-r)+vo(c-n)<.01)u(t,e,r,n,i,a,o,s);else{var h=t.point;t.x=t.y=t.point=null,u(t,h,l,c,i,a,o,s),u(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else u(t,e,r,n,i,a,o,s)}function u(t,e,r,n,i,o,s,l){var u=.5*(i+s),c=.5*(o+l),h=r>=u,f=n>=c,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=dn()),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,g,v,m,y,b=Et(s),x=Et(l);if(null!=e)g=e,v=r,m=n,y=i;else if(m=y=-(g=v=1/0),h=[],f=[],p=t.length,o)for(d=0;p>d;++d)c=t[d],c.x<g&&(g=c.x),c.y<v&&(v=c.y),c.x>m&&(m=c.x),c.y>y&&(y=c.y),h.push(c.x),f.push(c.y);else for(d=0;p>d;++d){var _=+b(c=t[d],d),w=+x(c,d);g>_&&(g=_),v>w&&(v=w),_>m&&(m=_),w>y&&(y=w),h.push(_),f.push(w)}var k=m-g,A=y-v;k>A?y=v+k:m=g+A;var M=dn();if(M.add=function(t){a(M,t,+b(t,++d),+x(t,d),g,v,m,y)},M.visit=function(t){pn(t,M,g,v,m,y)},M.find=function(t){return gn(M,t[0],t[1],g,v,m,y)},d=-1,null==e){for(;++d<p;)a(M,t[d],h[d],f[d],g,v,m,y);--d}else t.forEach(M.add);return h=f=t=c=null,M}var o,s=Cr,l=Sr;return(o=arguments.length)?(s=hn,l=fn,3===o&&(i=r,n=e,r=e=0),a(t)):(a.x=function(t){return arguments.length?(s=t,a):s},a.y=function(t){return arguments.length?(l=t,a):l},a.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),a):null==e?null:[[e,r],[n,i]]},a.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),a):null==e?null:[n-e,i-r]},a)},no.interpolateRgb=vn,no.interpolateObject=mn,no.interpolateNumber=yn,no.interpolateString=bn;var ll=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,ul=new RegExp(ll.source,\"g\");no.interpolate=xn,no.interpolators=[function(t,e){var r=typeof e;return(\"string\"===r?ts.has(e.toLowerCase())||/^(#|rgb\\(|hsl\\()/i.test(e)?vn:bn:e instanceof lt?vn:Array.isArray(e)?_n:\"object\"===r&&isNaN(e)?mn:yn)(t,e)}],no.interpolateArray=_n;var cl=function(){return x},hl=no.map({linear:cl,poly:En,quad:function(){return Mn},cubic:function(){return Ln},sin:function(){return Cn},exp:function(){return Sn},circle:function(){return zn},elastic:Pn,back:jn,bounce:function(){return On}}),fl=no.map({\"in\":x,out:kn,\"in-out\":An,\"out-in\":function(t){return An(kn(t))}});no.ease=function(t){var e=t.indexOf(\"-\"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):\"in\";return r=hl.get(r)||cl,n=fl.get(n)||x,wn(n(r.apply(null,io.call(arguments,1))))},no.interpolateHcl=In,no.interpolateHsl=Dn,no.interpolateLab=Rn,no.interpolateRound=Fn,no.transform=function(t){var e=oo.createElementNS(no.ns.prefix.svg,\"g\");return(no.transform=function(t){if(null!=t){e.setAttribute(\"transform\",t);var r=e.transform.baseVal.consolidate()}return new Nn(r?r.matrix:dl)})(t)},Nn.prototype.toString=function(){return\"translate(\"+this.translate+\")rotate(\"+this.rotate+\")skewX(\"+this.skew+\")scale(\"+this.scale+\")\"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};no.interpolateTransform=qn,no.layout={},no.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Yn(t[r]));return e}},no.layout.chord=function(){function t(){var t,u,h,f,d,p={},g=[],v=no.range(a),m=[];for(r=[],n=[],t=0,f=-1;++f<a;){for(u=0,d=-1;++d<a;)u+=i[f][d];g.push(u),m.push(no.range(a)),t+=u}for(o&&v.sort(function(t,e){return o(g[t],g[e])}),s&&m.forEach(function(t,e){t.sort(function(t,r){return s(i[e][t],i[e][r])})}),t=(Io-c*a)/t,u=0,f=-1;++f<a;){for(h=u,d=-1;++d<a;){var y=v[f],b=m[y][d],x=i[y][b],_=u,w=u+=x*t;p[y+\"-\"+b]={index:y,subindex:b,startAngle:_,endAngle:w,value:x}}n[y]={index:y,startAngle:h,endAngle:u,value:(u-h)/t},u+=c}for(f=-1;++f<a;)for(d=f-1;++d<a;){var k=p[f+\"-\"+d],A=p[d+\"-\"+f];(k.value||A.value)&&r.push(k.value<A.value?{source:A,target:k}:{source:k,target:A})}l&&e()}function e(){r.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,i,a,o,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(a=(i=t)&&i.length,r=n=null,u):i},u.padding=function(t){return arguments.length?(c=t,r=n=null,u):c},u.sortGroups=function(t){return arguments.length?(o=t,r=n=null,u):o},u.sortSubgroups=function(t){return arguments.length?(s=t,r=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,r&&e(),u):l},u.chords=function(){return r||t(),r},u.groups=function(){return n||t(),n},u},no.layout.force=function(){function t(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(l>s*s/v){if(p>l){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&p>l){var u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function e(t){t.px=no.event.x,t.py=no.event.y,s.resume()}var r,n,i,a,o,s={},l=no.dispatch(\"start\",\"tick\",\"end\"),u=[1,1],c=.9,h=pl,f=gl,d=-30,p=vl,g=.1,v=.64,m=[],y=[];return s.tick=function(){if((n*=.99)<.005)return l.end({type:\"end\",alpha:n=0}),!0;var e,r,s,h,f,p,v,b,x,_=m.length,w=y.length;for(r=0;w>r;++r)s=y[r],h=s.source,f=s.target,b=f.x-h.x,x=f.y-h.y,(p=b*b+x*x)&&(p=n*a[r]*((p=Math.sqrt(p))-i[r])/p,b*=p,x*=p,f.x-=b*(v=h.weight/(f.weight+h.weight)),f.y-=x*v,h.x+=b*(v=1-v),h.y+=x*v);if((v=n*g)&&(b=u[0]/2,x=u[1]/2,r=-1,v))for(;++r<_;)s=m[r],s.x+=(b-s.x)*v,s.y+=(x-s.y)*v;if(d)for(Jn(e=no.geom.quadtree(m),n,o),r=-1;++r<_;)(s=m[r]).fixed||e.visit(t(s));for(r=-1;++r<_;)s=m[r],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*c,s.y-=(s.py-(s.py=s.y))*c);l.tick({type:\"tick\",alpha:n})},s.nodes=function(t){return arguments.length?(m=t,s):m},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(h=\"function\"==typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(f=\"function\"==typeof t?t:+t,s):f},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(d=\"function\"==typeof t?t:+t,s):d},s.chargeDistance=function(t){return arguments.length?(p=t*t,s):Math.sqrt(p)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(v=t*t,s):Math.sqrt(v)},s.alpha=function(t){return arguments.length?(t=+t,n?n=t>0?t:0:t>0&&(l.start({type:\"start\",alpha:n=t}),no.timer(s.tick)),s):n},s.start=function(){function t(t,n){if(!r){for(r=new Array(l),s=0;l>s;++s)r[s]=[];for(s=0;c>s;++s){var i=y[s];r[i.source.index].push(i.target),r[i.target.index].push(i.source)}}for(var a,o=r[e],s=-1,u=o.length;++s<u;)if(!isNaN(a=o[s][t]))return a;return Math.random()*n}var e,r,n,l=m.length,c=y.length,p=u[0],g=u[1];for(e=0;l>e;++e)(n=m[e]).index=e,n.weight=0;for(e=0;c>e;++e)n=y[e],\"number\"==typeof n.source&&(n.source=m[n.source]),\"number\"==typeof n.target&&(n.target=m[n.target]),++n.source.weight,++n.target.weight;for(e=0;l>e;++e)n=m[e],isNaN(n.x)&&(n.x=t(\"x\",p)),isNaN(n.y)&&(n.y=t(\"y\",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(i=[],\"function\"==typeof h)for(e=0;c>e;++e)i[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=h;if(a=[],\"function\"==typeof f)for(e=0;c>e;++e)a[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)a[e]=f;if(o=[],\"function\"==typeof d)for(e=0;l>e;++e)o[e]=+d.call(this,m[e],e);else for(e=0;l>e;++e)o[e]=d;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){return r||(r=no.behavior.drag().origin(x).on(\"dragstart.force\",Zn).on(\"drag.force\",e).on(\"dragend.force\",Qn)),arguments.length?void this.on(\"mouseover.force\",$n).on(\"mouseout.force\",Kn).call(r):r},no.rebind(s,l,\"on\")};var pl=20,gl=1,vl=1/0;no.layout.hierarchy=function(){function t(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=r.call(t,a,a.depth))&&(l=u.length)){for(var l,u,c;--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 ri(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=ai,r=ni,n=ii;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&&(ei(e,function(t){t.children&&(t.value=0)}),ri(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},no.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;++u<o;)t(s=a[u],r,l=s.value*n,i),r+=l}}function e(t){var r=t.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,e(r[a]));return 1+n}function r(r,a){var o=n.call(this,r,a);return t(o[0],0,i[0],i[1]/e(o[0])),o}var n=no.layout.hierarchy(),i=[1,1];return r.size=function(t){return arguments.length?(i=t,r):i},ti(r,n)},no.layout.pie=function(){function t(o){var s,l=o.length,u=o.map(function(r,n){return+e.call(t,r,n)}),c=+(\"function\"==typeof n?n.apply(this,arguments):n),h=(\"function\"==typeof i?i.apply(this,arguments):i)-c,f=Math.min(Math.abs(h)/l,+(\"function\"==typeof a?a.apply(this,arguments):a)),d=f*(0>h?-1:1),p=(h-l*d)/no.sum(u),g=no.range(l),v=[];return null!=r&&g.sort(r===ml?function(t,e){return u[e]-u[t]}:function(t,e){return r(o[t],o[e])}),g.forEach(function(t){v[t]={data:o[t],value:s=u[t],startAngle:c,endAngle:c+=s*p+d,padAngle:f}}),v}var e=Number,r=ml,n=0,i=Io,a=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var ml={};no.layout.stack=function(){function t(s,l){if(!(f=s.length))return s;var u=s.map(function(r,n){return e.call(t,r,n)}),c=u.map(function(e){return e.map(function(e,r){return[a.call(t,e,r),o.call(t,e,r)]})}),h=r.call(t,c,l);u=no.permute(u,h),c=no.permute(c,h);var f,d,p,g,v=n.call(t,c,l),m=u[0].length;for(p=0;m>p;++p)for(i.call(t,u[0][p],g=v[p],c[0][p][1]),d=1;f>d;++d)i.call(t,u[d][p],g+=c[d-1][p][1],c[d][p][1]);return s}var e=x,r=ci,n=hi,i=ui,a=si,o=li;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r=\"function\"==typeof e?e:yl.get(e)||ci,t):r},t.offset=function(e){return arguments.length?(n=\"function\"==typeof e?e:bl.get(e)||hi,t):n},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(i=e,t):i},t};var yl=no.map({\"inside-out\":function(t){var e,r,n=t.length,i=t.map(fi),a=t.map(di),o=no.range(n).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;n>e;++e)r=o[e],l>s?(s+=a[r],u.push(r)):(l+=a[r],c.push(r));return c.reverse().concat(u)},reverse:function(t){return no.range(t.length).reverse()},\"default\":ci}),bl=no.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;a>r;++r){for(e=0,n=0;i>e;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;a>r;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,h=t[0],f=h.length,d=[];for(d[0]=l=u=0,r=1;f>r;++r){for(e=0,i=0;c>e;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];c>e;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);e>n;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}d[r]=l-=i?a/i*s:0,u>l&&(u=l)}for(r=0;f>r;++r)d[r]-=u;return d},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;a>r;++r){for(e=0,n=0;i>e;e++)n+=t[e][r][1];if(n)for(e=0;i>e;e++)t[e][r][1]/=n;else for(e=0;i>e;e++)t[e][r][1]=o}for(r=0;a>r;++r)s[r]=0;return s},zero:hi});no.layout.histogram=function(){function t(t,a){for(var o,s,l=[],u=t.map(r,this),c=n.call(this,u,a),h=i.call(this,c,u,a),a=-1,f=u.length,d=h.length-1,p=e?1:1/f;++a<d;)o=l[a]=[],o.dx=h[a+1]-(o.x=h[a]),o.y=0;if(d>0)for(a=-1;++a<f;)s=u[a],s>=c[0]&&s<=c[1]&&(o=l[no.bisect(h,s,1,d)-1],o.y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=mi,i=gi;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 vi(t,e)}:Et(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},no.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,ri(s,function(t){t.r=+c(t.value)}),ri(s,wi),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;ri(s,function(t){t.r+=h}),ri(s,wi),ri(s,function(t){t.r-=h})}return Mi(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,r=no.layout.hierarchy().sort(yi),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},ti(t,r)},no.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),h=c[0],f=e(h);if(ri(f,r),f.parent.m=-f.z,ei(f,n),u)ei(h,a);else{var d=h,p=h,g=h;ei(h,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>g.depth&&(g=t)});var v=s(d,p)/2-d.x,m=l[0]/(p.x+s(p,d)/2+v),y=l[1]/(g.depth||1);ei(h,function(t){t.x=(t.x+v)*m,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;s>o;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){zi(t);var a=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-a):t.z=a}else n&&(t.z=n.z+s(t._,n._));t.parent.A=i(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,r){if(e){for(var n,i=t,a=t,o=e,l=i.parent.children[0],u=i.m,c=a.m,h=o.m,f=l.m;o=Ci(o),i=Ei(i),o&&i;)l=Ei(l),a=Ci(a),a.a=t,n=o.z+h-i.z-u+s(o._,i._),n>0&&(Si(Pi(o,t,r),t,n),u+=n,c+=n),h+=o.m,u+=i.m,f+=l.m,c+=a.m;o&&!Ci(a)&&(a.t=o,a.m+=h-c),i&&!Ei(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=no.layout.hierarchy().sort(null).value(null),s=Ti,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},ti(t,o)},no.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;ri(l,function(t){var e=t.children;e&&e.length?(t.x=Oi(e),t.y=ji(e)):(t.x=o?u+=r(t,o):0,t.y=0,o=t)});var c=Ii(l),h=Di(l),f=c.x-r(c,h)/2,d=h.x+r(h,c)/2;return ri(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=no.layout.hierarchy().sort(null).value(null),r=Ti,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},ti(t,e)},no.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(0>e?0:e),r.area=isNaN(n)||0>=n?0:n}function e(r){var a=r.children;if(a&&a.length){var o,s,l,u=h(r),c=[],f=a.slice(),p=1/0,g=\"slice\"===d?u.dx:\"dice\"===d?u.dy:\"slice-dice\"===d?1&r.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(t(f,u.dx*u.dy/r.value),c.area=0;(l=f.length)>0;)c.push(o=f[l-1]),c.area+=o.area,\"squarify\"!==d||(s=n(c,g))<=p?(f.pop(),p=s):(c.area-=c.pop().area,i(c,g,u,!1),g=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,g,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;++o<s;)(r=t[o].area)&&(a>r&&(a=r),r>i&&(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);++a<o;)i=t[a],i.x=s,i.y=u,i.dy=c,s+=i.dx=Math.min(r.x+r.dx-s,c?l(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=c,r.dy-=c}else{for((n||c>r.dx)&&(c=r.dx);++a<o;)i=t[a],i.x=s,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?l(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function a(n){var i=o||s(n),a=i[0];return a.x=0,a.y=0,a.dx=u[0],a.dy=u[1],o&&s.revalue(a),t([a],a.dx*a.dy/a.value),(o?r:e)(a),f&&(o=i),i}var o,s=no.layout.hierarchy(),l=Math.round,u=[1,1],c=null,h=Ri,f=!1,d=\"squarify\",p=.5*(1+Math.sqrt(5));return a.size=function(t){return arguments.length?(u=t,a):u},a.padding=function(t){function e(e){var r=t.call(a,e,e.depth);return null==r?Ri(e):Fi(e,\"number\"==typeof r?[r,r,r,r]:r)}function r(e){return Fi(e,t)}if(!arguments.length)return c;var n;return h=null==(c=t)?Ri:\"function\"==(n=typeof t)?e:\"number\"===n?(t=[t,t,t,t],r):r,a},a.round=function(t){return arguments.length?(l=t?Math.round:Number,a):l!=Number},a.sticky=function(t){return arguments.length?(f=t,o=null,a):f},a.ratio=function(t){return arguments.length?(p=t,a):p},a.mode=function(t){return arguments.length?(d=t+\"\",a):d},ti(a,s)},no.random={normal:function(t,e){var r=arguments.length;return 2>r&&(e=1),1>r&&(t=0),function(){var r,n,i;do r=2*Math.random()-1,n=2*Math.random()-1,i=r*r+n*n;while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=no.random.normal.apply(no,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=no.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;t>r;r++)e+=Math.random();return e}}},no.scale={};var xl={floor:x,ceil:x};no.scale.linear=function(){return Gi([0,1],[0,1],xn,!1)};var _l={s:1,g:1,p:1,r:1,e:1};no.scale.log=function(){return Ji(no.scale.linear().domain([0,1]),10,!0,[1,10])};var wl=no.format(\".0e\"),kl={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};no.scale.pow=function(){return ta(no.scale.linear(),1,[0,1])},no.scale.sqrt=function(){return no.scale.pow().exponent(.5)},no.scale.ordinal=function(){return ra([],{t:\"range\",a:[[]]})},no.scale.category10=function(){return no.scale.ordinal().range(Al)},no.scale.category20=function(){return no.scale.ordinal().range(Ml)},no.scale.category20b=function(){return no.scale.ordinal().range(Ll)},no.scale.category20c=function(){return no.scale.ordinal().range(Tl)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ml=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Ll=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Tl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);no.scale.quantile=function(){return na([],[])},no.scale.quantize=function(){return ia(0,1,[0,1])},no.scale.threshold=function(){return aa([.5],[0,1])},no.scale.identity=function(){return oa([0,1])},no.svg={},no.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),u=Math.max(0,+n.apply(this,arguments)),c=o.apply(this,arguments)-Ro,h=s.apply(this,arguments)-Ro,f=Math.abs(h-c),d=c>h?0:1;if(t>u&&(p=u,u=t,t=p),f>=Do)return e(u,d)+(t?e(t,1-d):\"\")+\"Z\";var p,g,v,m,y,b,x,_,w,k,A,M,L=0,T=0,E=[];if((m=(+l.apply(this,arguments)||0)/2)&&(v=a===El?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(T*=-1),u&&(T=nt(v/u*Math.sin(m))),t&&(L=nt(v/t*Math.sin(m)))),u){y=u*Math.cos(c+T),b=u*Math.sin(c+T),x=u*Math.cos(h-T),_=u*Math.sin(h-T);var C=Math.abs(h-c-2*T)<=Oo?0:1;if(T&&da(y,b,x,_)===d^C){var S=(c+h)/2;y=u*Math.cos(S),b=u*Math.sin(S),x=_=null}}else y=b=0;if(t){w=t*Math.cos(h-L),k=t*Math.sin(h-L),A=t*Math.cos(c+L),M=t*Math.sin(c+L);var z=Math.abs(c-h+2*L)<=Oo?0:1;if(L&&da(w,k,A,M)===1-d^z){var P=(c+h)/2;w=t*Math.cos(P),k=t*Math.sin(P),A=M=null}}else w=k=0;if((p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){g=u>t^d?0:1;var j=null==A?[w,k]:null==x?[y,b]:Or([y,b],[A,M],[x,_],[w,k]),O=y-j[0],I=b-j[1],D=x-j[0],R=_-j[1],F=1/Math.sin(Math.acos((O*D+I*R)/(Math.sqrt(O*O+I*I)*Math.sqrt(D*D+R*R)))/2),N=Math.sqrt(j[0]*j[0]+j[1]*j[1]);if(null!=x){var B=Math.min(p,(u-N)/(F+1)),U=pa(null==A?[w,k]:[A,M],[y,b],u,B,d),V=pa([x,_],[w,k],u,B,d);p===B?E.push(\"M\",U[0],\"A\",B,\",\",B,\" 0 0,\",g,\" \",U[1],\"A\",u,\",\",u,\" 0 \",1-d^da(U[1][0],U[1][1],V[1][0],V[1][1]),\",\",d,\" \",V[1],\"A\",B,\",\",B,\" 0 0,\",g,\" \",V[0]):E.push(\"M\",U[0],\"A\",B,\",\",B,\" 0 1,\",g,\" \",V[0])}else E.push(\"M\",y,\",\",b);if(null!=A){var q=Math.min(p,(t-N)/(F-1)),H=pa([y,b],[A,M],t,-q,d),G=pa([w,k],null==x?[y,b]:[x,_],t,-q,d);p===q?E.push(\"L\",G[0],\"A\",q,\",\",q,\" 0 0,\",g,\" \",G[1],\"A\",t,\",\",t,\" 0 \",d^da(G[1][0],G[1][1],H[1][0],H[1][1]),\",\",1-d,\" \",H[1],\"A\",q,\",\",q,\" 0 0,\",g,\" \",H[0]):E.push(\"L\",G[0],\"A\",q,\",\",q,\" 0 0,\",g,\" \",H[0])}else E.push(\"L\",w,\",\",k)}else E.push(\"M\",y,\",\",b),null!=x&&E.push(\"A\",u,\",\",u,\" 0 \",C,\",\",d,\" \",x,\",\",_),E.push(\"L\",w,\",\",k),null!=A&&E.push(\"A\",t,\",\",t,\" 0 \",z,\",\",1-d,\" \",A,\",\",M);return E.push(\"Z\"),E.join(\"\")}function e(t,e){return\"M0,\"+t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+-t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+t}var r=la,n=ua,i=sa,a=El,o=ca,s=ha,l=fa;return t.innerRadius=function(e){return arguments.length?(r=Et(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Et(e),t):n},t.cornerRadius=function(e){return arguments.length?(i=Et(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==El?El:Et(e),t):a},t.startAngle=function(e){return arguments.length?(o=Et(e),t):o},t.endAngle=function(e){return arguments.length?(s=Et(e),t):s},t.padAngle=function(e){return arguments.length?(l=Et(e),t):l},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Ro;return[Math.cos(e)*t,Math.sin(e)*t]},t};var El=\"auto\";no.svg.line=function(){return ga(x)};var Cl=no.map({linear:va,\"linear-closed\":ma,step:ya,\"step-before\":ba,\"step-after\":xa,basis:La,\"basis-open\":Ta,\"basis-closed\":Ea,bundle:Ca,cardinal:ka,\"cardinal-open\":_a,\"cardinal-closed\":wa,monotone:Ia});Cl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Sl=[0,2/3,1/3,0],zl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];no.svg.line.radial=function(){var t=ga(Da);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ba.reverse=xa,xa.reverse=ba,no.svg.area=function(){return Ra(x)},no.svg.area.radial=function(){var t=Ra(Da);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},no.svg.chord=function(){function t(t,s){var l=e(this,a,t,s),u=e(this,o,t,s);return\"M\"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+n(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+\"Z\"}function e(t,e,r,n){var i=e.call(t,r,n),a=s.call(t,i,n),o=l.call(t,i,n)-Ro,c=u.call(t,i,n)-Ro;return{r:a,a0:o,a1:c,p0:[a*Math.cos(o),a*Math.sin(o)],p1:[a*Math.cos(c),a*Math.sin(c)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return\"A\"+t+\",\"+t+\" 0 \"+ +(r>Oo)+\",1 \"+e}function i(t,e,r,n){return\"Q 0,0 \"+n}var a=br,o=xr,s=Fa,l=ca,u=ha;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},no.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=br,r=xr,n=Na;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},no.svg.diagonal.radial=function(){var t=no.svg.diagonal(),e=Na,r=t.projection;return t.projection=function(t){return arguments.length?r(Ba(e=t)):e},t},no.svg.symbol=function(){function t(t,n){return(jl.get(e.call(this,t,n))||qa)(r.call(this,t,n))}var e=Va,r=Ua;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 jl=no.map({circle:qa,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*Il)),r=e*Il;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/Ol),r=e*Ol/2;return\"M0,\"+r+\"L\"+e+\",\"+-r+\" \"+-e+\",\"+-r+\"Z\"},\"triangle-up\":function(t){var e=Math.sqrt(t/Ol),r=e*Ol/2;return\"M0,\"+-r+\"L\"+e+\",\"+r+\" \"+-e+\",\"+r+\"Z\"}});no.svg.symbolTypes=jl.keys();var Ol=Math.sqrt(3),Il=Math.tan(30*Fo);Mo.transition=function(t){for(var e,r,n=Dl||++Bl,i=Xa(t),a=[],o=Rl||{time:Date.now(),ease:Tn,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&Za(r,c,i,n,o),e.push(r)}return Ga(a,i,n)},Mo.interrupt=function(t){return this.each(null==t?Fl:Ha(Xa(t)))};var Dl,Rl,Fl=Ha(Xa()),Nl=[],Bl=0;Nl.call=Mo.call,Nl.empty=Mo.empty,Nl.node=Mo.node,Nl.size=Mo.size,no.transition=function(t,e){return t&&t.transition?Dl?t.transition(e):t:no.selection().transition(t)},no.transition.prototype=Nl,Nl.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=S(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?(\"__data__\"in n&&(r.__data__=n.__data__),Za(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return Ga(o,a,i)},Nl.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=z(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,d=h.length;++f<d;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var p=-1,g=r.length;++p<g;)(i=r[p])&&Za(i,p,s,o,a),e.push(i)}return Ga(l,s,o)},Nl.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=q(t));for(var a=0,o=this.length;o>a;a++){i.push(e=[]);for(var r=this[a],s=0,l=r.length;l>s;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return Ga(i,this.namespace,this.id)},Nl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):G(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Nl.attr=function(t,e){function r(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?r:(t+=\"\",function(){var e,r=this.getAttribute(s);return r!==t&&(e=o(r,t),function(t){this.setAttribute(s,e(t))})})}function a(t){return null==t?n:(t+=\"\",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o=\"transform\"==t?qn:xn,s=no.ns.qualify(t);return Ya(this,\"attr.\"+t,e,s.local?a:i)},Nl.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(i));return n&&function(t){this.setAttribute(i,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(i.space,i.local));return n&&function(t){this.setAttributeNS(i.space,i.local,n(t))}}var i=no.ns.qualify(t);return this.tween(\"attr.\"+t,i.local?n:r)},Nl.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+=\"\",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=xn(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var o=arguments.length;if(3>o){if(\"string\"!=typeof t){2>o&&(e=\"\");for(r in t)this.style(r,t[r],e);return this}r=\"\"}return Ya(this,\"style.\"+t,e,a)},Nl.styleTween=function(t,e,r){function i(i,a){var o=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),r)}}return arguments.length<3&&(r=\"\"),this.tween(\"style.\"+t,i)},Nl.text=function(t){return Ya(this,\"text\",t,Wa)},Nl.remove=function(){var t=this.namespace;return this.each(\"end.transition\",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Nl.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:(\"function\"!=typeof t&&(t=no.ease.apply(no,arguments)),G(this,function(n){\n",
"n[r][e].ease=t}))},Nl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:G(this,\"function\"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},Nl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:G(this,\"function\"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},Nl.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Rl,a=Dl;try{Dl=r,G(this,function(e,i,a){Rl=e[n][r],t.call(e,e.__data__,i,a)})}finally{Rl=i,Dl=a}}else G(this,function(i){var a=i[n][r];(a.event||(a.event=no.dispatch(\"start\",\"end\",\"interrupt\"))).on(t,e)});return this},Nl.transition=function(){for(var t,e,r,n,i=this.id,a=++Bl,o=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(t=[]);for(var e=this[l],c=0,h=e.length;h>c;c++)(r=e[c])&&(n=r[o][i],Za(r,c,o,a,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Ga(s,o,a)},no.svg.axis=function(){function t(t){t.each(function(){var t,u=no.select(this),c=this.__chart__||r,h=this.__chart__=r.copy(),f=null==l?h.ticks?h.ticks.apply(h,s):h.domain():l,d=null==e?h.tickFormat?h.tickFormat.apply(h,s):x:e,p=u.selectAll(\".tick\").data(f,h),g=p.enter().insert(\"g\",\".domain\").attr(\"class\",\"tick\").style(\"opacity\",Po),v=no.transition(p.exit()).style(\"opacity\",Po).remove(),m=no.transition(p.order()).style(\"opacity\",1),y=Math.max(i,0)+o,b=Bi(h),_=u.selectAll(\".domain\").data([0]),w=(_.enter().append(\"path\").attr(\"class\",\"domain\"),no.transition(_));g.append(\"line\"),g.append(\"text\");var k,A,M,L,T=g.select(\"line\"),E=m.select(\"line\"),C=p.select(\"text\").text(d),S=g.select(\"text\"),z=m.select(\"text\"),P=\"top\"===n||\"left\"===n?-1:1;if(\"bottom\"===n||\"top\"===n?(t=Qa,k=\"x\",M=\"y\",A=\"x2\",L=\"y2\",C.attr(\"dy\",0>P?\"0em\":\".71em\").style(\"text-anchor\",\"middle\"),w.attr(\"d\",\"M\"+b[0]+\",\"+P*a+\"V0H\"+b[1]+\"V\"+P*a)):(t=$a,k=\"y\",M=\"x\",A=\"y2\",L=\"x2\",C.attr(\"dy\",\".32em\").style(\"text-anchor\",0>P?\"end\":\"start\"),w.attr(\"d\",\"M\"+P*a+\",\"+b[0]+\"H0V\"+b[1]+\"H\"+P*a)),T.attr(L,P*i),S.attr(M,P*y),E.attr(A,0).attr(L,P*i),z.attr(k,0).attr(M,P*y),h.rangeBand){var j=h,O=j.rangeBand()/2;c=h=function(t){return j(t)+O}}else c.rangeBand?c=h:v.call(t,h,c);g.call(t,c,h),m.call(t,h,h)})}var e,r=no.scale.linear(),n=Ul,i=6,a=6,o=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Vl?e+\"\":Ul,t):n},t.ticks=function(){return arguments.length?(s=arguments,t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(i=+e,a=+arguments[r-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var Ul=\"bottom\",Vl={top:1,right:1,bottom:1,left:1};no.svg.brush=function(){function t(n){n.each(function(){var n=no.select(this).style(\"pointer-events\",\"all\").style(\"-webkit-tap-highlight-color\",\"rgba(0,0,0,0)\").on(\"mousedown.brush\",a).on(\"touchstart.brush\",a),o=n.selectAll(\".background\").data([0]);o.enter().append(\"rect\").attr(\"class\",\"background\").style(\"visibility\",\"hidden\").style(\"cursor\",\"crosshair\"),n.selectAll(\".extent\").data([0]).enter().append(\"rect\").attr(\"class\",\"extent\").style(\"cursor\",\"move\");var s=n.selectAll(\".resize\").data(g,x);s.exit().remove(),s.enter().append(\"g\").attr(\"class\",function(t){return\"resize \"+t}).style(\"cursor\",function(t){return ql[t]}).append(\"rect\").attr(\"x\",function(t){return/[ew]$/.test(t)?-3:null}).attr(\"y\",function(t){return/^[ns]/.test(t)?-3:null}).attr(\"width\",6).attr(\"height\",6).style(\"visibility\",\"hidden\"),s.style(\"display\",t.empty()?\"none\":null);var l,h=no.transition(n),f=no.transition(o);u&&(l=Bi(u),f.attr(\"x\",l[0]).attr(\"width\",l[1]-l[0]),r(h)),c&&(l=Bi(c),f.attr(\"y\",l[0]).attr(\"height\",l[1]-l[0]),i(h)),e(h)})}function e(t){t.selectAll(\".resize\").attr(\"transform\",function(t){return\"translate(\"+h[+/e$/.test(t)]+\",\"+f[+/^s/.test(t)]+\")\"})}function r(t){t.select(\".extent\").attr(\"x\",h[0]),t.selectAll(\".extent,.n>rect,.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==no.event.keyCode&&(C||(b=null,z[0]-=h[1],z[1]-=f[1],C=2),L())}function g(){32==no.event.keyCode&&2==C&&(z[0]+=h[1],z[1]+=f[1],C=0,L())}function v(){var t=no.mouse(_),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),C||(no.event.altKey?(b||(b=[(h[0]+h[1])/2,(f[0]+f[1])/2]),z[0]=h[+(t[0]<b[0])],z[1]=f[+(t[1]<b[1])]):b=null),T&&m(t,u,0)&&(r(A),n=!0),E&&m(t,c,1)&&(i(A),n=!0),n&&(e(A),k({type:\"brush\",mode:C?\"move\":\"resize\"}))}function m(t,e,r){var n,i,a=Bi(e),l=a[0],u=a[1],c=z[r],g=r?f:h,v=g[1]-g[0];return C&&(l-=c,u-=v+c),n=(r?p:d)?Math.max(l,Math.min(u,t[r])):t[r],C?i=(n+=c)+v:(b&&(c=Math.max(l,Math.min(u,2*b[r]-n))),n>c?(i=n,n=c):i=c),g[0]!=n||g[1]!=i?(r?s=null:o=null,g[0]=n,g[1]=i,!0):void 0}function y(){v(),A.style(\"pointer-events\",\"all\").selectAll(\".resize\").style(\"display\",t.empty()?\"none\":null),no.select(\"body\").style(\"cursor\",null),P.on(\"mousemove.brush\",null).on(\"mouseup.brush\",null).on(\"touchmove.brush\",null).on(\"touchend.brush\",null).on(\"keydown.brush\",null).on(\"keyup.brush\",null),S(),k({type:\"brushend\"})}var b,x,_=this,w=no.select(no.event.target),k=l.of(_,arguments),A=no.select(_),M=w.datum(),T=!/^(n|s)$/.test(M)&&u,E=!/^(e|w)$/.test(M)&&c,C=w.classed(\"extent\"),S=$(_),z=no.mouse(_),P=no.select(n(_)).on(\"keydown.brush\",a).on(\"keyup.brush\",g);if(no.event.changedTouches?P.on(\"touchmove.brush\",v).on(\"touchend.brush\",y):P.on(\"mousemove.brush\",v).on(\"mouseup.brush\",y),A.interrupt().selectAll(\"*\").interrupt(),C)z[0]=h[0]-z[0],z[1]=f[0]-z[1];else if(M){var j=+/w$/.test(M),O=+/^n/.test(M);x=[h[1-j]-z[0],f[1-O]-z[1]],z[0]=h[j],z[1]=f[O]}else no.event.altKey&&(b=z.slice());A.style(\"pointer-events\",\"none\").selectAll(\".resize\").style(\"display\",null),no.select(\"body\").style(\"cursor\",w.style(\"cursor\")),k({type:\"brushstart\"}),v()}var o,s,l=E(t,\"brushstart\",\"brush\",\"brushend\"),u=null,c=null,h=[0,0],f=[0,0],d=!0,p=!0,g=Hl[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:h,y:f,i:o,j:s},r=this.__chart__||e;this.__chart__=e,Dl?no.select(this).transition().each(\"start.brush\",function(){o=r.i,s=r.j,h=r.x,f=r.y,t({type:\"brushstart\"})}).tween(\"brush:brush\",function(){var r=_n(h,e.x),n=_n(f,e.y);return o=s=null,function(i){h=e.x=r(i),f=e.y=n(i),t({type:\"brush\",mode:\"resize\"})}}).each(\"end.brush\",function(){o=e.i,s=e.j,t({type:\"brush\",mode:\"resize\"}),t({type:\"brushend\"})}):(t({type:\"brushstart\"}),t({type:\"brush\",mode:\"resize\"}),t({type:\"brushend\"}))})},t.x=function(e){return arguments.length?(u=e,g=Hl[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,g=Hl[!u<<1|!c],t):c},t.clamp=function(e){return arguments.length?(u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e),t):u&&c?[d,p]:u?d:c?p:null},t.extent=function(e){var r,n,i,a,l;return arguments.length?(u&&(r=e[0],n=e[1],c&&(r=r[0],n=n[0]),o=[r,n],u.invert&&(r=u(r),n=u(n)),r>n&&(l=r,r=n,n=l),(r!=h[0]||n!=h[1])&&(h=[r,n])),c&&(i=e[0],a=e[1],u&&(i=i[1],a=a[1]),s=[i,a],c.invert&&(i=c(i),a=c(a)),i>a&&(l=i,i=a,a=l),(i!=f[0]||a!=f[1])&&(f=[i,a])),t):(u&&(o?(r=o[0],n=o[1]):(r=h[0],n=h[1],u.invert&&(r=u.invert(r),n=u.invert(n)),r>n&&(l=r,r=n,n=l))),c&&(s?(i=s[0],a=s[1]):(i=f[0],a=f[1],c.invert&&(i=c.invert(i),a=c.invert(a)),i>a&&(l=i,i=a,a=l))),u&&c?[[r,i],[n,a]]:u?[r,n]:c&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],o=s=null),t},t.empty=function(){return!!u&&h[0]==h[1]||!!c&&f[0]==f[1]},no.rebind(t,l,\"on\")};var ql={n:\"ns-resize\",e:\"ew-resize\",s:\"ns-resize\",w:\"ew-resize\",nw:\"nwse-resize\",ne:\"nesw-resize\",se:\"nwse-resize\",sw:\"nesw-resize\"},Hl=[[\"n\",\"e\",\"s\",\"w\",\"nw\",\"ne\",\"se\",\"sw\"],[\"e\",\"w\"],[\"n\",\"s\"],[]],Gl=cs.format=vs.timeFormat,Yl=Gl.utc,Wl=Yl(\"%Y-%m-%dT%H:%M:%S.%LZ\");Gl.iso=Date.prototype.toISOString&&+new Date(\"2000-01-01T00:00:00.000Z\")?Ka:Wl,Ka.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ka.toString=Wl.toString,cs.second=Ut(function(t){return new hs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),cs.seconds=cs.second.range,cs.seconds.utc=cs.second.utc.range,cs.minute=Ut(function(t){return new hs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),cs.minutes=cs.minute.range,cs.minutes.utc=cs.minute.utc.range,cs.hour=Ut(function(t){var e=t.getTimezoneOffset()/60;return new hs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),cs.hours=cs.hour.range,cs.hours.utc=cs.hour.utc.range,cs.month=Ut(function(t){return t=cs.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),cs.months=cs.month.range,cs.months.utc=cs.month.utc.range;var Xl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Zl=[[cs.second,1],[cs.second,5],[cs.second,15],[cs.second,30],[cs.minute,1],[cs.minute,5],[cs.minute,15],[cs.minute,30],[cs.hour,1],[cs.hour,3],[cs.hour,6],[cs.hour,12],[cs.day,1],[cs.day,2],[cs.week,1],[cs.month,1],[cs.month,3],[cs.year,1]],Ql=Gl.multi([[\".%L\",function(t){return t.getMilliseconds()}],[\":%S\",function(t){return t.getSeconds()}],[\"%I:%M\",function(t){return t.getMinutes()}],[\"%I %p\",function(t){return t.getHours()}],[\"%a %d\",function(t){return t.getDay()&&1!=t.getDate()}],[\"%b %d\",function(t){return 1!=t.getDate()}],[\"%B\",function(t){return t.getMonth()}],[\"%Y\",Se]]),$l={range:function(t,e,r){return no.range(Math.ceil(t/r)*r,+e,r).map(to)},floor:x,ceil:x};Zl.year=cs.year,cs.scale=function(){return Ja(no.scale.linear(),Zl,Ql)};var Kl=Zl.map(function(t){return[t[0].utc,t[1]]}),Jl=Yl.multi([[\".%L\",function(t){return t.getUTCMilliseconds()}],[\":%S\",function(t){return t.getUTCSeconds()}],[\"%I:%M\",function(t){return t.getUTCMinutes()}],[\"%I %p\",function(t){return t.getUTCHours()}],[\"%a %d\",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[\"%b %d\",function(t){return 1!=t.getUTCDate()}],[\"%B\",function(t){return t.getUTCMonth()}],[\"%Y\",Se]]);Kl.year=cs.year.utc,cs.scale.utc=function(){return Ja(no.scale.linear(),Kl,Jl)},no.text=Ct(function(t){return t.responseText}),no.json=function(t,e){return St(t,\"application/json\",eo,e)},no.html=function(t,e){return St(t,\"text/html\",ro,e)},no.xml=Ct(function(t){return t.responseXML}),\"function\"==typeof t&&t.amd?t(no):\"object\"==typeof r&&r.exports&&(r.exports=no),this.d3=no}()},{}],54:[function(t,e,r){\"use strict\";function n(t,e){this.point=t,this.index=e}function i(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;i>a;++a){var o=n[a]-r[a];if(o)return o}return 0}function a(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;t>a;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}function o(t,e){var r=t.length;if(0===r)return[];var o=t[0].length;if(1>o)return[];if(1===o)return a(r,t,e);for(var u=new Array(r),c=1,h=0;r>h;++h){for(var f=t[h],d=new Array(o+1),p=0,g=0;o>g;++g){var v=f[g];d[g]=v,p+=v*v}d[o]=p,u[h]=new n(d,h),c=Math.max(p,c)}l(u,i),r=u.length;for(var m=new Array(r+o+1),y=new Array(r+o+1),b=(o+1)*(o+1)*c,x=new Array(o+1),h=0;o>=h;++h)x[h]=0;x[o]=b,m[0]=x.slice(),y[0]=-1;for(var h=0;o>=h;++h){var d=x.slice();d[h]=1,m[h+1]=d,y[h+1]=-1}for(var h=0;r>h;++h){var _=u[h];m[h+o+1]=_.point,y[h+o+1]=_.index}var w=s(m,!1);if(w=e?w.filter(function(t){for(var e=0,r=0;o>=r;++r){var n=y[t[r]];if(0>n&&++e>=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;o>=e;++e){var r=y[t[e]];if(0>r)return!1;t[e]=r}return!0}),1&o)for(var h=0;h<w.length;++h){var _=w[h],d=_[0];_[0]=_[1],_[1]=d}return w}var s=t(\"incremental-convex-hull\"),l=t(\"uniq\");e.exports=o},{\"incremental-convex-hull\":168,uniq:218}],55:[function(t,e,r){\"use strict\";function n(t,e,r){var i=0|t[r];if(0>=i)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;i>a;++a)o[a]=e;else for(a=0;i>a;++a)o[a]=n(t,e,r+1);return o}function i(t,e){var r,n;for(r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function a(t,e){switch(\"undefined\"==typeof e&&(e=0),typeof t){case\"number\":if(t>0)return i(0|t,e);break;case\"object\":if(\"number\"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],56:[function(e,r,n){(function(n,i){(function(){\"use strict\";function a(t){return\"function\"==typeof t||\"object\"==typeof t&&null!==t}function o(t){return\"function\"==typeof t}function s(t){return\"object\"==typeof t&&null!==t}function l(t){Y=t}function u(t){Q=t}function c(){return function(){n.nextTick(g)}}function h(){return function(){G(g)}}function f(){var t=0,e=new J(g),r=document.createTextNode(\"\");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function d(){var t=new MessageChannel;return t.port1.onmessage=g,function(){t.port2.postMessage(0)}}function p(){return function(){setTimeout(g,1)}}function g(){for(var t=0;Z>t;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}Z=0}function v(){try{var t=e,r=t(\"vertx\");return G=r.runOnLoop||r.runOnContext,h()}catch(n){return p()}}function m(){}function y(){return new TypeError(\"You cannot resolve a promise with itself\")}function b(){return new TypeError(\"A promises callback cannot return that same promise.\")}function x(t){try{return t.then}catch(e){return ot.error=e,ot}}function _(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function w(t,e,r){Q(function(t){var n=!1,i=_(r,e,function(r){n||(n=!0,e!==r?M(t,r):T(t,r))},function(e){n||(n=!0,E(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!n&&i&&(n=!0,E(t,i))},t)}function k(t,e){e._state===it?T(t,e._result):e._state===at?E(t,e._result):C(e,void 0,function(e){M(t,e)},function(e){E(t,e)})}function A(t,e){if(e.constructor===t.constructor)k(t,e);else{var r=x(e);r===ot?E(t,ot.error):void 0===r?T(t,e):o(r)?w(t,e,r):T(t,e)}}function M(t,e){t===e?E(t,y()):a(e)?A(t,e):T(t,e)}function L(t){t._onerror&&t._onerror(t._result),S(t)}function T(t,e){t._state===nt&&(t._result=e,t._state=it,0!==t._subscribers.length&&Q(S,t))}function E(t,e){t._state===nt&&(t._state=at,t._result=e,Q(L,t))}function C(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+it]=r,i[a+at]=n,0===a&&t._state&&Q(S,t)}function S(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?j(r,n,i,a):i(a);t._subscribers.length=0}}function z(){this.error=null}function P(t,e){try{return t(e)}catch(r){return st.error=r,st}}function j(t,e,r,n){var i,a,s,l,u=o(r);if(u){if(i=P(r,n),i===st?(l=!0,a=i.error,i=null):s=!0,e===i)return void E(e,b())}else i=n,s=!0;e._state!==nt||(u&&s?M(e,i):l?E(e,a):t===it?T(e,i):t===at&&E(e,i))}function O(t,e){try{e(function(e){M(t,e)},function(e){E(t,e)})}catch(r){E(t,r)}}function I(t,e){var r=this;r._instanceConstructor=t,r.promise=new t(m),r._validateInput(e)?(r._input=e,r.length=e.length,r._remaining=e.length,r._init(),0===r.length?T(r.promise,r._result):(r.length=r.length||0,r._enumerate(),0===r._remaining&&T(r.promise,r._result))):E(r.promise,r._validationError())}function D(t){return new lt(this,t).promise}function R(t){function e(t){M(i,t)}function r(t){E(i,t)}var n=this,i=new n(m);if(!X(t))return E(i,new TypeError(\"You must pass an array to race.\")),i;for(var a=t.length,o=0;i._state===nt&&a>o;o++)C(n.resolve(t[o]),void 0,e,r);return i}function F(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var r=new e(m);return M(r,t),r}function N(t){var e=this,r=new e(m);return E(r,t),r}function B(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function U(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function V(t){this._id=dt++,this._state=void 0,this._result=void 0,this._subscribers=[],m!==t&&(o(t)||B(),this instanceof V||U(),O(this,t))}function q(){var t;if(\"undefined\"!=typeof i)t=i;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(e){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var r=t.Promise;(!r||\"[object Promise]\"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(t.Promise=pt)}var H;H=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};var G,Y,W,X=H,Z=0,Q=({}.toString,function(t,e){rt[Z]=t,rt[Z+1]=e,Z+=2,2===Z&&(Y?Y(g):W())}),$=\"undefined\"!=typeof window?window:void 0,K=$||{},J=K.MutationObserver||K.WebKitMutationObserver,tt=\"undefined\"!=typeof n&&\"[object process]\"==={}.toString.call(n),et=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,rt=new Array(1e3);W=tt?c():J?f():et?d():void 0===$&&\"function\"==typeof e?v():p();var nt=void 0,it=1,at=2,ot=new z,st=new z;I.prototype._validateInput=function(t){return X(t)},I.prototype._validationError=function(){return new Error(\"Array Methods must be provided an Array\")},I.prototype._init=function(){this._result=new Array(this.length)};var lt=I;I.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,i=0;r._state===nt&&e>i;i++)t._eachEntry(n[i],i)},I.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;s(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},I.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===nt&&(n._remaining--,t===at?E(i,r):n._result[e]=r),0===n._remaining&&T(i,n._result)},I.prototype._willSettleAt=function(t,e){var r=this;C(t,void 0,function(t){r._settledAt(it,e,t)},function(t){r._settledAt(at,e,t)})};var ut=D,ct=R,ht=F,ft=N,dt=0,pt=V;V.all=ut,V.race=ct,V.resolve=ht,V.reject=ft,V._setScheduler=l,V._setAsap=u,V._asap=Q,V.prototype={constructor:V,then:function(t,e){var r=this,n=r._state;if(n===it&&!t||n===at&&!e)return this;var i=new this.constructor(m),a=r._result;if(n){var o=arguments[n-1];Q(function(){j(n,i,o,a)})}else C(r,i,t,e);return i},\"catch\":function(t){return this.then(null,t)}};var gt=q,vt={Promise:pt,polyfill:gt};\"function\"==typeof t&&t.amd?t(function(){return vt}):\"undefined\"!=typeof r&&r.exports?r.exports=vt:\"undefined\"!=typeof this&&(this.ES6Promise=vt),gt()}).call(this)}).call(this,e(\"_process\"),\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{_process:38}],57:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return\"function\"==typeof t}function a(t){return\"number\"==typeof t}function o(t){return\"object\"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!a(t)||0>t||isNaN(t))throw TypeError(\"n must be a positive number\");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,a,l,u;if(this._events||(this._events={}),\"error\"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified \"error\" event.')}if(r=this._events[t],s(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),u=r.slice(),n=u.length,l=0;n>l;l++)u[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError(\"listener must be a function\");return this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&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(0>n)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){var e;return e=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)}},{}],58:[function(t,e,r){\"use strict\";function n(t){for(var e,r=t.length,n=0;r>n;n++)if(e=t.charCodeAt(n),(9>e||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(8192>e||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(t=+t,0===t&&n(r))return!1}else if(\"number\"!==e)return!1;return 1>t-t}},{}],59:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}function i(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(0>a)return t.bufferData(e,i,n),o;if(o+a>r)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;n>i;++i)r[i]=t[i];return r}function o(t,e){for(var r=1,n=e.length-1;n>=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&&\"undefined\"!=typeof t.shape){var r=t.dtype;if(h.indexOf(r)<0&&(r=\"float32\"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var n=gl.getExtension(\"OES_element_index_uint\");r=n&&\"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 s=l.malloc(t.size,r),f=c(s,t.shape);u.assign(f,t),0>e?this.length=i(this.gl,this.type,this.length,this.usage,s,e):this.length=i(this.gl,this.type,this.length,this.usage,s.subarray(0,t.size),e),l.free(s)}}else if(Array.isArray(t)){var d;d=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,\"uint16\"):a(t,\"float32\"),0>e?this.length=i(this.gl,this.type,this.length,this.usage,d,e):this.length=i(this.gl,this.type,this.length,this.usage,d.subarray(0,t.length),e),l.free(d)}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&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:189,\"ndarray-ops\":184,\"typedarray-pool\":217}],60:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.shader=e,this.buffer=r,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=new n(t,r,i);return s.update(e),t.addObject(s),s}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=[1,0,0,0,1,0,0,0,1],e=[1,1];return function(){var r=this.plot,n=this.shader,i=this.buffer,a=this.bounds,o=this.numPoints,s=(this.color,r.gl),l=r.dataBox,c=r.viewBox,h=r.pixelRatio,f=a[2]-a[0],d=a[3]-a[1],p=l[2]-l[0],g=l[3]-l[1];t[0]=2*f/p,t[4]=2*d/g,t[6]=2*(a[0]-l[0])/p-1,t[7]=2*(a[1]-l[1])/g-1;var v=c[2]-c[0],m=c[3]-c[1];e[0]=2*h/v,e[1]=2*h/m,i.bind(),n.bind(),n.uniforms.viewTransform=t,n.uniforms.pixelScale=e,n.uniforms.color=this.color,n.attributes.position.pointer(s.FLOAT,!1,16,0),n.attributes.pixelOffset.pointer(s.FLOAT,!1,16,8),s.drawArrays(s.TRIANGLES,0,o*u.length)}}(),c.drawPick=function(t){return t},c.pick=function(t,e){return null},c.update=function(t){t=t||{};var e=t.positions||[],r=t.errors||[],n=1;\"lineWidth\"in t&&(n=+t.lineWidth);var i=5;\"capSize\"in t&&(i=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();for(var a=this.bounds=[1/0,1/0,-(1/0),-(1/0)],o=this.numPoints=e.length>>1,l=0;o>l;++l){var c=e[2*l],h=e[2*l+1];a[0]=Math.min(c,a[0]),a[1]=Math.min(h,a[1]),a[2]=Math.max(c,a[2]),a[3]=Math.max(h,a[3])}a[2]===a[0]&&(a[2]+=1),a[3]===a[1]&&(a[3]+=1);for(var f=1/(a[2]-a[0]),d=1/(a[3]-a[1]),p=a[0],g=a[1],v=s.mallocFloat32(o*u.length*4),m=0,l=0;o>l;++l)for(var c=e[2*l],h=e[2*l+1],y=r[4*l],b=r[4*l+1],x=r[4*l+2],_=r[4*l+3],w=0;w<u.length;++w){var k=u[w],A=k[0],M=k[1];0>A?A*=y:A>0&&(A*=b),0>M?M*=x:M>0&&(M*=_),v[m++]=f*(c-p+A),v[m++]=d*(h-g+M),v[m++]=n*k[2]+(i+n)*k[4],v[m++]=n*k[3]+(i+n)*k[5]}this.buffer.update(v),s.free(v)},c.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.buffer.dispose()}},{\"./lib/shaders\":61,\"gl-buffer\":59,\"gl-shader\":138,\"typedarray-pool\":217}],61:[function(t,e,r){e.exports={vertex:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 position;\\nattribute vec2 pixelOffset;\\n\\nuniform mat3 viewTransform;\\nuniform vec2 pixelScale;\\n\\nvoid main() {\\n vec3 scrPosition = viewTransform * vec3(position, 1);\\n gl_Position = vec4(\\n scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\\n 0,\\n scrPosition.z);\\n}\\n\",fragment:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\\n\"}},{}],62:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=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.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;3>r;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}function o(t){var e=t.gl,r=s(e),i=l(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),a=u(e);a.attributes.position.location=0,a.attributes.color.location=1,a.attributes.offset.location=2;var o=new n(e,r,i,a);return o.update(t),o}e.exports=o;var s=t(\"gl-buffer\"),l=t(\"gl-vao\"),u=t(\"./shaders/index\"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=n.prototype;h.isOpaque=function(){return this.opacity>=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;3>h;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;3>e;++e){for(var r=[],n=1;2>=n;++n)for(var i=-1;1>=i;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;3>u;++u){this.lineOffset[u]=l;t:for(var c=0;s>c;++c){for(var h=r[c],f=0;3>f;++f)if(isNaN(h[f])||!isFinite(h[f]))continue t;var d=n[c],p=e[u];if(Array.isArray(p[0])&&(p=e[c]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][u])&&!isNaN(d[1][u])){if(d[0][u]<0){var g=h.slice();g[u]+=d[0][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,g),l+=2+a(o,g,p,u)}if(d[1][u]>0){var g=h.slice();g[u]+=d[1][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,g),l+=2+a(o,g,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\":63,\"gl-buffer\":59,\"gl-vao\":166}],63:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 position, offset;\\nattribute vec4 color;\\nuniform mat4 model, view, projection;\\nuniform float capSize;\\nvarying vec4 fragColor;\\nvarying vec3 fragPosition;\\n\\nvoid main() {\\n vec4 worldPosition = model * vec4(position, 1.0);\\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\\n gl_Position = projection * view * worldPosition;\\n fragColor = color;\\n fragPosition = position;\\n}\",a=\"#define GLSLIFY 1\\nprecision mediump float;\\nuniform vec3 clipBounds[2];\\nuniform float opacity;\\nvarying vec3 fragPosition;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\\n discard;\\n }\\n gl_FragColor = opacity * fragColor;\\n}\";\n",
"e.exports=function(t){return n(t,i,a,null,[{name:\"position\",type:\"vec3\"},{name:\"offset\",type:\"vec3\"},{name:\"color\",type:\"vec4\"}])}},{\"gl-shader\":138}],64:[function(t,e,r){\"use strict\";function n(t){var e=t.getParameter(t.FRAMEBUFFER_BINDING),r=t.getParameter(t.RENDERBUFFER_BINDING),n=t.getParameter(t.TEXTURE_BINDING_2D);return[e,r,n]}function i(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function a(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);y=new Array(r+1);for(var n=0;r>=n;++n){for(var i=new Array(r),a=0;n>a;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(var a=n;r>a;++a)i[a]=t.NONE;y[n]=i}}function o(t){switch(t){case p:throw new Error(\"gl-fbo: Framebuffer unsupported\");case g:throw new Error(\"gl-fbo: Framebuffer incomplete attachment\");case v:throw new Error(\"gl-fbo: Framebuffer incomplete dimensions\");case m:throw new Error(\"gl-fbo: Framebuffer incomplete missing attachment\");default:throw new Error(\"gl-fbo: Framebuffer failed for unspecified reason\")}}function s(t,e,r,n,i,a){if(!n)return null;var o=d(t,e,r,i,n);return o.magFilter=t.NEAREST,o.minFilter=t.NEAREST,o.mipSamples=1,o.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,o.handle,0),o}function l(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function u(t){var e=n(t.gl),r=t.gl,a=t.handle=r.createFramebuffer(),u=t._shape[0],c=t._shape[1],h=t.color.length,f=t._ext,d=t._useStencil,p=t._useDepth,g=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,a);for(var v=0;h>v;++v)t.color[v]=s(r,u,c,g,r.RGBA,r.COLOR_ATTACHMENT0+v);0===h?(t._color_rb=l(r,u,c,r.RGBA4,r.COLOR_ATTACHMENT0),f&&f.drawBuffersWEBGL(y[0])):h>1&&f.drawBuffersWEBGL(y[h]);var m=r.getExtension(\"WEBGL_depth_texture\");m?d?t.depth=s(r,u,c,m.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;v<t.color.length;++v)t.color[v].dispose(),t.color[v]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),i(r,e),o(b)}i(r,e)}function c(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var l=0;i>l;++l)this.color[l]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var c=this,h=[0|e,0|r];Object.defineProperties(h,{0:{get:function(){return c._shape[0]},set:function(t){return c.width=t}},1:{get:function(){return c._shape[1]},set:function(t){return c.height=t}}}),this._shapeVector=h,u(this)}function h(t,e,r){if(t._destroyed)throw new Error(\"gl-fbo: Can't resize destroyed FBO\");if(t._shape[0]!==e||t._shape[1]!==r){var a=t.gl,s=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(0>e||e>s||0>r||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;u<t.color.length;++u)t.color[u].shape=t._shape;t._color_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._color_rb),a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX,t._shape[0],t._shape[1])),a.bindFramebuffer(a.FRAMEBUFFER,t.handle);var c=a.checkFramebufferStatus(a.FRAMEBUFFER);c!==a.FRAMEBUFFER_COMPLETE&&(t.dispose(),i(a,l),o(c)),i(a,l)}}function f(t,e,r,n){p||(p=t.FRAMEBUFFER_UNSUPPORTED,g=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,v=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,m=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var i=t.getExtension(\"WEBGL_draw_buffers\");if(!y&&i&&a(t,i),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),\"number\"!=typeof e)throw new Error(\"gl-fbo: Missing shape parameter\");var o=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(0>e||e>o||0>r||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>s)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,g,v,m,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|t,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|t,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<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{\"gl-texture2d\":162}],65:[function(t,e,r){r.lineVertex=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nfloat inverse_1_0(float m) {\\n return 1.0 / m;\\n}\\n\\nmat2 inverse_1_0(mat2 m) {\\n return mat2(m[1][1],-m[0][1],\\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\\n}\\n\\nmat3 inverse_1_0(mat3 m) {\\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\\n\\n float b01 = a22 * a11 - a12 * a21;\\n float b11 = -a22 * a10 + a12 * a20;\\n float b21 = a21 * a10 - a11 * a20;\\n\\n float det = a00 * b01 + a01 * b11 + a02 * b21;\\n\\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\\n}\\n\\nmat4 inverse_1_0(mat4 m) {\\n float\\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\\n\\n b00 = a00 * a11 - a01 * a10,\\n b01 = a00 * a12 - a02 * a10,\\n b02 = a00 * a13 - a03 * a10,\\n b03 = a01 * a12 - a02 * a11,\\n b04 = a01 * a13 - a03 * a11,\\n b05 = a02 * a13 - a03 * a12,\\n b06 = a20 * a31 - a21 * a30,\\n b07 = a20 * a32 - a22 * a30,\\n b08 = a20 * a33 - a23 * a30,\\n b09 = a21 * a32 - a22 * a31,\\n b10 = a21 * a33 - a23 * a31,\\n b11 = a22 * a33 - a23 * a32,\\n\\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\\n\\n return mat4(\\n a11 * b11 - a12 * b10 + a13 * b09,\\n a02 * b10 - a01 * b11 - a03 * b09,\\n a31 * b05 - a32 * b04 + a33 * b03,\\n a22 * b04 - a21 * b05 - a23 * b03,\\n a12 * b08 - a10 * b11 - a13 * b07,\\n a00 * b11 - a02 * b08 + a03 * b07,\\n a32 * b02 - a30 * b05 - a33 * b01,\\n a20 * b05 - a22 * b02 + a23 * b01,\\n a10 * b10 - a11 * b08 + a13 * b06,\\n a01 * b08 - a00 * b10 - a03 * b06,\\n a30 * b04 - a31 * b02 + a33 * b00,\\n a21 * b02 - a20 * b04 - a23 * b00,\\n a11 * b07 - a10 * b09 - a12 * b06,\\n a00 * b09 - a01 * b07 + a02 * b06,\\n a31 * b01 - a30 * b03 - a32 * b00,\\n a20 * b03 - a21 * b01 + a22 * b00) / det;\\n}\\n\\n\\n\\nattribute vec2 a, d;\\n\\nuniform mat3 matrix;\\nuniform vec2 screenShape;\\nuniform float width;\\n\\nvarying vec2 direction;\\n\\nvoid main() {\\n vec2 dir = (matrix * vec3(d, 0)).xy;\\n vec3 base = matrix * vec3(a, 1);\\n vec2 n = 0.5 * width *\\n normalize(screenShape.yx * vec2(dir.y, -dir.x)) / screenShape.xy;\\n vec2 tangent = normalize(screenShape.xy * dir);\\n if(dir.x < 0.0 || (dir.x == 0.0 && dir.y < 0.0)) {\\n direction = -tangent;\\n } else {\\n direction = tangent;\\n }\\n gl_Position = vec4(base.xy/base.z + n, 0, 1);\\n}\\n\",r.lineFragment=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec4 color;\\nuniform vec2 screenShape;\\nuniform sampler2D dashPattern;\\nuniform float dashLength;\\n\\nvarying vec2 direction;\\n\\nvoid main() {\\n float t = fract(dot(direction, gl_FragCoord.xy) / dashLength);\\n vec4 pcolor = color * texture2D(dashPattern, vec2(t, 0.0)).r;\\n gl_FragColor = vec4(pcolor.rgb * pcolor.a, pcolor.a);\\n}\\n\",r.mitreVertex=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 p;\\n\\nuniform mat3 matrix;\\nuniform vec2 screenShape;\\nuniform float radius;\\n\\nvoid main() {\\n vec3 pp = matrix * vec3(p, 1);\\n gl_Position = vec4(pp.xy, 0, pp.z);\\n gl_PointSize = radius;\\n}\\n\",r.mitreFragment=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n if(length(gl_PointCoord.xy - 0.5) > 0.25) {\\n discard;\\n }\\n gl_FragColor = vec4(color.rgb, color.a);\\n}\\n\",r.pickVertex=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 a, d;\\nattribute vec4 pick0, pick1;\\n\\nuniform mat3 matrix;\\nuniform vec2 screenShape;\\nuniform float width;\\n\\nvarying vec4 pickA, pickB;\\n\\nfloat inverse_1_0(float m) {\\n return 1.0 / m;\\n}\\n\\nmat2 inverse_1_0(mat2 m) {\\n return mat2(m[1][1],-m[0][1],\\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\\n}\\n\\nmat3 inverse_1_0(mat3 m) {\\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\\n\\n float b01 = a22 * a11 - a12 * a21;\\n float b11 = -a22 * a10 + a12 * a20;\\n float b21 = a21 * a10 - a11 * a20;\\n\\n float det = a00 * b01 + a01 * b11 + a02 * b21;\\n\\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\\n}\\n\\nmat4 inverse_1_0(mat4 m) {\\n float\\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\\n\\n b00 = a00 * a11 - a01 * a10,\\n b01 = a00 * a12 - a02 * a10,\\n b02 = a00 * a13 - a03 * a10,\\n b03 = a01 * a12 - a02 * a11,\\n b04 = a01 * a13 - a03 * a11,\\n b05 = a02 * a13 - a03 * a12,\\n b06 = a20 * a31 - a21 * a30,\\n b07 = a20 * a32 - a22 * a30,\\n b08 = a20 * a33 - a23 * a30,\\n b09 = a21 * a32 - a22 * a31,\\n b10 = a21 * a33 - a23 * a31,\\n b11 = a22 * a33 - a23 * a32,\\n\\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\\n\\n return mat4(\\n a11 * b11 - a12 * b10 + a13 * b09,\\n a02 * b10 - a01 * b11 - a03 * b09,\\n a31 * b05 - a32 * b04 + a33 * b03,\\n a22 * b04 - a21 * b05 - a23 * b03,\\n a12 * b08 - a10 * b11 - a13 * b07,\\n a00 * b11 - a02 * b08 + a03 * b07,\\n a32 * b02 - a30 * b05 - a33 * b01,\\n a20 * b05 - a22 * b02 + a23 * b01,\\n a10 * b10 - a11 * b08 + a13 * b06,\\n a01 * b08 - a00 * b10 - a03 * b06,\\n a30 * b04 - a31 * b02 + a33 * b00,\\n a21 * b02 - a20 * b04 - a23 * b00,\\n a11 * b07 - a10 * b09 - a12 * b06,\\n a00 * b09 - a01 * b07 + a02 * b06,\\n a31 * b01 - a30 * b03 - a32 * b00,\\n a20 * b03 - a21 * b01 + a22 * b00) / det;\\n}\\n\\n\\n\\nvoid main() {\\n vec3 base = matrix * vec3(a, 1);\\n vec2 n = width *\\n normalize(screenShape.yx * vec2(d.y, -d.x)) / screenShape.xy;\\n gl_Position = vec4(base.xy/base.z + n, 0, 1);\\n pickA = pick0;\\n pickB = pick1;\\n}\\n\",r.pickFragment=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec4 pickOffset;\\n\\nvarying vec4 pickA, pickB;\\n\\nvoid main() {\\n vec4 fragId = vec4(pickA.xyz, 0.0);\\n if(pickB.w > pickA.w) {\\n fragId.xyz = pickB.xyz;\\n }\\n\\n fragId += 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 gl_FragColor = fragId / 255.0;\\n}\\n\",r.fillVertex=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 a, d;\\n\\nuniform mat3 matrix;\\nuniform vec2 projectAxis;\\nuniform float projectValue;\\nuniform float depth;\\n\\nvoid main() {\\n vec3 base = matrix * vec3(a, 1);\\n vec2 p = base.xy / base.z;\\n if(d.y < 0.0 || (d.y == 0.0 && d.x < 0.0)) {\\n if(dot(p, projectAxis) < projectValue) {\\n p = p * (1.0 - abs(projectAxis)) + projectAxis * projectValue;\\n }\\n }\\n gl_Position = vec4(p, depth, 1);\\n}\\n\",r.fillFragment=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\\n\"},{}],66:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s){this.plot=t,this.dashPattern=e,this.lineBuffer=r,this.pickBuffer=n,this.lineShader=i,this.mitreShader=a,this.fillShader=o,this.pickShader=s,this.usingDashes=!1,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.width=1,this.color=[0,0,1,1],this.fill=[!1,!1,!1,!1],this.fillColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.data=null,this.numPoints=0,this.vertCount=0,this.pickOffset=0,this.lodBuffer=[]}function i(t){return t.map(function(t){return t.slice()})}function a(t,e){var r=t.gl,i=s(r),a=s(r),u=l(r,[1,1]),c=o(r,h.lineVertex,h.lineFragment),f=o(r,h.mitreVertex,h.mitreFragment),d=o(r,h.fillVertex,h.fillFragment),p=o(r,h.pickVertex,h.pickFragment),g=new n(t,u,i,a,c,f,d,p);return t.addObject(g),g.update(e),g}e.exports=a;var o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"gl-texture2d\"),u=t(\"ndarray\"),c=t(\"typedarray-pool\"),h=t(\"./lib/shaders\"),f=n.prototype;f.draw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0],r=[1,0],n=[-1,0],i=[0,1],a=[0,-1];return function(){var o=this.plot,s=this.color,l=this.width,u=(this.numPoints,this.bounds),c=this.vertCount,h=o.gl,f=o.viewBox,d=o.dataBox,p=o.pixelRatio,g=u[2]-u[0],v=u[3]-u[1],m=d[2]-d[0],y=d[3]-d[1],b=f[2]-f[0],x=f[3]-f[1];t[0]=2*g/m,t[4]=2*v/y,t[6]=2*(u[0]-d[0])/m-1,t[7]=2*(u[1]-d[1])/y-1,e[0]=b,e[1]=x;var _=this.lineBuffer;_.bind();var w=this.fill;if(w[0]||w[1]||w[2]||w[3]){var k=this.fillShader;k.bind();var A=k.uniforms;A.matrix=t,A.depth=o.nextDepthValue();var M=k.attributes;M.a.pointer(h.FLOAT,!1,16,0),M.d.pointer(h.FLOAT,!1,16,8),h.depthMask(!0),h.enable(h.DEPTH_TEST);var L=this.fillColor;w[0]&&(A.color=L[0],A.projectAxis=n,A.projectValue=1,h.drawArrays(h.TRIANGLES,0,c)),w[1]&&(A.color=L[1],A.projectAxis=a,A.projectValue=1,h.drawArrays(h.TRIANGLES,0,c)),w[2]&&(A.color=L[2],A.projectAxis=r,A.projectValue=1,h.drawArrays(h.TRIANGLES,0,c)),w[3]&&(A.color=L[3],A.projectAxis=i,A.projectValue=1,h.drawArrays(h.TRIANGLES,0,c)),h.depthMask(!1),h.disable(h.DEPTH_TEST)}var T=this.lineShader;T.bind();var E=T.uniforms;E.matrix=t,E.color=s,E.width=l*p,E.screenShape=e,E.dashPattern=this.dashPattern.bind(),E.dashLength=this.dashLength*p;var C=T.attributes;if(C.a.pointer(h.FLOAT,!1,16,0),C.d.pointer(h.FLOAT,!1,16,8),h.drawArrays(h.TRIANGLES,0,c),l>2&&!this.usingDashes){var S=this.mitreShader;S.bind();var z=S.uniforms;z.matrix=t,z.color=s,z.screenShape=e,z.radius=l*p,S.attributes.p.pointer(h.FLOAT,!1,48,0),h.drawArrays(h.POINTS,0,c/3|0)}}}(),f.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0],r=[0,0,0,0];return function(n){var i=this.plot,a=this.pickShader,o=this.lineBuffer,s=this.pickBuffer,l=this.width,u=this.numPoints,c=this.bounds,h=this.vertCount,f=i.gl,d=i.viewBox,p=i.dataBox,g=i.pickPixelRatio,v=c[2]-c[0],m=c[3]-c[1],y=p[2]-p[0],b=p[3]-p[1],x=d[2]-d[0],_=d[3]-d[1];this.pickOffset=n,t[0]=2*v/y,t[4]=2*m/b,t[6]=2*(c[0]-p[0])/y-1,t[7]=2*(c[1]-p[1])/b-1,e[0]=x,e[1]=_,r[0]=255&n,r[1]=n>>>8&255,r[2]=n>>>16&255,r[3]=n>>>24,a.bind();var w=a.uniforms;w.matrix=t,w.width=l*g,w.pickOffset=r,w.screenShape=e;var k=a.attributes;return o.bind(),k.a.pointer(f.FLOAT,!1,16,0),k.d.pointer(f.FLOAT,!1,16,8),s.bind(),k.pick0.pointer(f.UNSIGNED_BYTE,!1,8,0),k.pick1.pointer(f.UNSIGNED_BYTE,!1,8,4),f.drawArrays(f.TRIANGLES,0,h),n+u}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(n>r||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=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]]);for(var r=t.dashes||[1],n=0,a=0;a<r.length;++a)n+=r[a];for(var o=c.mallocUint8(n),s=0,h=255,a=0;a<r.length;++a){for(var f=0;f<r[a];++f)o[s++]=h;h^=255}this.dashPattern.dispose(),this.usingDashes=r.length>1,this.dashPattern=l(e,u(o,[n,1,4],[1,0,0])),this.dashPattern.minFilter=e.NEAREST,this.dashPattern.magFilter=e.NEAREST,this.dashLength=n,c.free(o);var d=t.positions;this.data=d;var p=this.bounds;p[0]=p[1]=1/0,p[2]=p[3]=-(1/0);var g=this.numPoints=d.length>>>1;if(0!==g){for(var a=0;g>a;++a){var v=d[2*a],m=d[2*a+1];p[0]=Math.min(p[0],v),p[1]=Math.min(p[1],m),p[2]=Math.max(p[2],v),p[3]=Math.max(p[3],m)}p[0]===p[2]&&(p[2]+=1),p[3]===p[1]&&(p[3]+=1);var y=c.mallocFloat32(24*(g-1)),b=c.mallocUint32(12*(g-1)),x=y.length,_=b.length,s=g;for(this.vertCount=6*(g-1);s>1;){var w=--s,v=d[2*s],m=d[2*s+1];v=(v-p[0])/(p[2]-p[0]),m=(m-p[1])/(p[3]-p[1]);var k=w-1,A=d[2*k],M=d[2*k+1];A=(A-p[0])/(p[2]-p[0]),M=(M-p[1])/(p[3]-p[1]);var L=A-v,T=M-m,E=w|1<<24,C=w-1,S=w,z=w-1|1<<24;y[--x]=-T,y[--x]=-L,y[--x]=m,y[--x]=v,b[--_]=E,b[--_]=C,y[--x]=T,y[--x]=L,y[--x]=M,y[--x]=A,b[--_]=S,b[--_]=z,y[--x]=-T,y[--x]=-L,y[--x]=M,y[--x]=A,b[--_]=S,b[--_]=z,y[--x]=T,y[--x]=L,y[--x]=M,y[--x]=A,b[--_]=S,b[--_]=z,y[--x]=-T,y[--x]=-L,y[--x]=m,y[--x]=v,b[--_]=E,b[--_]=C,y[--x]=T,y[--x]=L,y[--x]=m,y[--x]=v,b[--_]=E,b[--_]=C}this.lineBuffer.update(y),this.pickBuffer.update(b),c.free(y),c.free(b)}},f.dispose=function(){this.plot.removeObject(this),this.lineBuffer.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{\"./lib/shaders\":65,\"gl-buffer\":59,\"gl-shader\":138,\"gl-texture2d\":162,ndarray:189,\"typedarray-pool\":217}],67:[function(t,e,r){var n=t(\"gl-shader\"),i=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 position, nextPosition;\\nattribute float arcLength, lineWidth;\\nattribute vec4 color;\\n\\nuniform vec2 screenShape;\\nuniform float pixelRatio;\\nuniform mat4 model, view, projection;\\n\\nvarying vec4 fragColor;\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\n\\nvoid main() {\\n vec4 projected = projection * view * model * vec4(position, 1.0);\\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\\n vec2 tangent = normalize(screenShape * tangentClip.xy);\\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\\n\\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\\n\\n worldPosition = position;\\n pixelArcLength = arcLength;\\n fragColor = color;\\n}\\n\",a=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec3 clipBounds[2];\\nuniform sampler2D dashTexture;\\nuniform float dashScale;\\nuniform float opacity;\\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 float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\\n if(dashWeight < 0.5) {\\n discard;\\n }\\n gl_FragColor = fragColor * opacity;\\n}\\n\",o=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\n#define FLOAT_MAX 1.70141184e38\\n#define FLOAT_MIN 1.17549435e-38\\n\\nlowp vec4 encode_float_1_0(highp float v) {\\n highp float av = abs(v);\\n\\n //Handle special cases\\n if(av < FLOAT_MIN) {\\n return vec4(0.0, 0.0, 0.0, 0.0);\\n } else if(v > 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}\",s=[{name:\"position\",type:\"vec3\"},{name:\"nextPosition\",type:\"vec3\"},{name:\"arcLength\",type:\"float\"},{name:\"lineWidth\",type:\"float\"},{name:\"color\",type:\"vec4\"}];r.createShader=function(t){return n(t,i,a,null,s)},r.createPickShader=function(t){return n(t,i,o,null,s)}},{\"gl-shader\":138}],68:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0,n=0;3>n;++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;3>r;++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=g(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;1024>h;++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\"),g=p.createShader,v=p.createPickShader,m=[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||m,view:t.view||m,projection:t.projection||m,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||m,view:t.view||m,projection:t.projection||m,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){this.dirty=!0,\"dashScale\"in t&&(this.dashScale=t.dashScale),\"opacity\"in t&&(this.opacity=+t.opacity);var e=t.position||t.positions;if(e){var r=t.color||t.colors||[0,0,0,1],i=t.lineWidth||1,a=[],o=[],s=[],l=0,u=0,c=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];t:for(var h=1;h<e.length;++h){var p=e[h-1],g=e[h];o.push(l),s.push(p.slice());for(var v=0;3>v;++v){if(isNaN(p[v])||isNaN(g[v])||!isFinite(p[v])||!isFinite(g[v]))continue t;c[0][v]=Math.min(c[0][v],p[v],g[v]),c[1][v]=Math.max(c[1][v],p[v],g[v])}var m,y;Array.isArray(r[0])?(m=r[h-1],y=r[h]):m=y=r,3===m.length&&(m=[m[0],m[1],m[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]);var b,x;Array.isArray(i)?(b=i[h-1],x=lineWidht[h]):b=x=i;var _=l;l+=n(p,g),a.push(p[0],p[1],p[2],g[0],g[1],g[2],_,b,m[0],m[1],m[2],m[3],p[0],p[1],p[2],g[0],g[1],g[2],_,-b,m[0],m[1],m[2],m[3],g[0],g[1],g[2],p[0],p[1],p[2],l,-b,y[0],y[1],y[2],y[3],g[0],g[1],g[2],p[0],p[1],p[2],l,b,y[0],y[1],y[2],y[3]),u+=4}if(this.buffer.update(a),o.push(l),s.push(e[e.length-1].slice()),this.bounds=c,this.vertexCount=u,this.points=s,this.arcLength=o,\"dashes\"in t){var w=t.dashes,k=w.slice();k.unshift(0);for(var h=1;h<k.length;++h)k[h]=k[h-1]+k[h];for(var A=d(new Array(1024),[256,1,4]),h=0;256>h;++h){for(var v=0;4>v;++v)A.set(h,0,v,0);1&f.le(k,k[k.length-1]*h/255)?A.set(h,0,0,0):A.set(h,0,0,255)}this.texture.setPixels(A)}}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=h(t.value[0],t.value[1],t.value[2],0),r=f.le(this.arcLength,e);if(0>r)return null;if(r===this.arcLength.length-1)return new a(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],o=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),s=1-o,l=[0,0,0],u=0;3>u;++u)l[u]=s*n[u]+o*i[u];var c=Math.min(.5>o?r:r+1,this.points.length-1);return new a(e,l,c,this.points[c])}},{\"./lib/shaders\":67,\"binary-search-bounds\":69,\"gl-buffer\":59,\"gl-texture2d\":162,\"gl-vao\":166,\"glsl-read-float\":70,ndarray:189}],69:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],70:[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)},{}],71:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null}e.exports=n},{}],72:[function(t,e,r){function n(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}e.exports=n},{}],73:[function(t,e,r){function n(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],74:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],v=t[15],m=e*o-r*a,y=e*s-n*a,b=e*l-i*a,x=r*s-n*o,_=r*l-i*o,w=n*l-i*s,k=u*p-c*d,A=u*g-h*d,M=u*v-f*d,L=c*g-h*p,T=c*v-f*p,E=h*v-f*g;return m*E-y*T+b*L+x*M-_*A+w*k}e.exports=n},{}],75:[function(t,e,r){function n(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,g=a*o,v=a*s,m=a*l;return t[0]=1-h-p,t[1]=c+m,t[2]=f-v,t[3]=0,t[4]=c-m,t[5]=1-u-p,t[6]=d+g,t[7]=0,t[8]=f+v,t[9]=d-g,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],76:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,g=a*u,v=o*s,m=o*l,y=o*u;return t[0]=1-(d+g),t[1]=h+y,t[2]=f-m,t[3]=0,t[4]=h-y,t[5]=1-(c+g),t[6]=p+v,t[7]=0,t[8]=f+m,t[9]=p-v,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}e.exports=n},{}],77:[function(t,e,r){function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],78:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,k=i*u-a*l,A=c*g-h*p,M=c*v-f*p,L=c*m-d*p,T=h*v-f*g,E=h*m-d*g,C=f*m-d*v,S=y*C-b*E+x*T+_*L-w*M+k*A;return S?(S=1/S,t[0]=(s*C-l*E+u*T)*S,t[1]=(i*E-n*C-a*T)*S,t[2]=(g*k-v*w+m*_)*S,t[3]=(f*w-h*k-d*_)*S,t[4]=(l*L-o*C-u*M)*S,t[5]=(r*C-i*L+a*M)*S,t[6]=(v*x-p*k-m*b)*S,t[7]=(c*k-f*x+d*b)*S,t[8]=(o*E-s*L+u*A)*S,t[9]=(n*L-r*E-a*A)*S,t[10]=(p*w-g*x+m*y)*S,t[11]=(h*x-c*w-d*y)*S,t[12]=(s*M-o*T-l*A)*S,t[13]=(r*T-n*M+i*A)*S,t[14]=(g*b-p*_-v*y)*S,t[15]=(c*_-h*b+f*y)*S,t):null}e.exports=n},{}],79:[function(t,e,r){function n(t,e,r,n){var a,o,s,l,u,c,h,f,d,p,g=e[0],v=e[1],m=e[2],y=n[0],b=n[1],x=n[2],_=r[0],w=r[1],k=r[2];return Math.abs(g-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(m-k)<1e-6?i(t):(h=g-_,f=v-w,d=m-k,p=1/Math.sqrt(h*h+f*f+d*d),h*=p,f*=p,d*=p,a=b*d-x*f,o=x*h-y*d,s=y*f-b*h,p=Math.sqrt(a*a+o*o+s*s),p?(p=1/p,a*=p,o*=p,s*=p):(a=0,o=0,s=0),l=f*s-d*o,u=d*a-h*s,c=h*o-f*a,p=Math.sqrt(l*l+u*u+c*c),p?(p=1/p,l*=p,u*=p,c*=p):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=d,t[11]=0,t[12]=-(a*g+o*v+s*m),t[13]=-(l*g+u*v+c*m),t[14]=-(h*g+f*v+d*m),t[15]=1,t)}var i=t(\"./identity\");e.exports=n},{\"./identity\":77}],80:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*h+w*g,t[1]=b*i+x*l+_*f+w*v,t[2]=b*a+x*u+_*d+w*m,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*h+w*g,t[5]=b*i+x*l+_*f+w*v,t[6]=b*a+x*u+_*d+w*m,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*h+w*g,t[9]=b*i+x*l+_*f+w*v,t[10]=b*a+x*u+_*d+w*m,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*h+w*g,t[13]=b*i+x*l+_*f+w*v,t[14]=b*a+x*u+_*d+w*m,t[15]=b*o+x*c+_*p+w*y,t}e.exports=n},{}],81:[function(t,e,r){function n(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}e.exports=n},{}],82:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,g,v,m,y,b,x,_,w,k,A,M,L,T,E=n[0],C=n[1],S=n[2],z=Math.sqrt(E*E+C*C+S*S);\n",
"return Math.abs(z)<1e-6?null:(z=1/z,E*=z,C*=z,S*=z,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],f=e[5],d=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=E*E*o+a,x=C*E*o+S*i,_=S*E*o-C*i,w=E*C*o-S*i,k=C*C*o+a,A=S*C*o+E*i,M=E*S*o+C*i,L=C*S*o-E*i,T=S*S*o+a,t[0]=s*b+h*x+g*_,t[1]=l*b+f*x+v*_,t[2]=u*b+d*x+m*_,t[3]=c*b+p*x+y*_,t[4]=s*w+h*k+g*A,t[5]=l*w+f*k+v*A,t[6]=u*w+d*k+m*A,t[7]=c*w+p*k+y*A,t[8]=s*M+h*L+g*T,t[9]=l*M+f*L+v*T,t[10]=u*M+d*L+m*T,t[11]=c*M+p*L+y*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}e.exports=n},{}],83:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}e.exports=n},{}],84:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}e.exports=n},{}],85:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(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]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}e.exports=n},{}],86:[function(t,e,r){function n(t,e,r){var n=r[0],i=r[1],a=r[2];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]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}e.exports=n},{}],87:[function(t,e,r){function n(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,g=r[0],v=r[1],m=r[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*g+s*v+h*m+e[12],t[13]=i*g+l*v+f*m+e[13],t[14]=a*g+u*v+d*m+e[14],t[15]=o*g+c*v+p*m+e[15]),t}e.exports=n},{}],88:[function(t,e,r){function n(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}e.exports=n},{}],89:[function(t,e,r){\"use strict\";function n(t,e){for(var r=[0,0,0,0],n=0;4>n;++n)for(var i=0;4>i;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,a){for(var o=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;3>s;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function a(t,e){if(2===t.length){for(var r=0,n=0,i=0;2>i;++i)r+=Math.pow(e[i]-t[0][i],2),n+=Math.pow(e[i]-t[1][i],2);return r=Math.sqrt(r),n=Math.sqrt(n),1e-6>r+n?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var a=[0,0];return u(t[0],t[1],t[2],e,a),l(t,a)}return[]}function o(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;3>o;++o)r[o]+=a*i[o];return r}function s(t,e,r,n,s,l){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),c=0;c<t.length;++c)u[c]=i(t[c],r,n,s,l);for(var h=0,f=1/0,c=0;c<u.length;++c){for(var d=0,p=0;2>p;++p)d+=Math.pow(u[c][p]-e[p],2);f>d&&(f=d,h=c)}for(var g=a(u,e),v=0,c=0;3>c;++c){if(g[c]<-.001||g[c]>1.0001)return null;v+=g[c]}return Math.abs(v-1)>.001?null:[h,o(t,g),g]}var l=t(\"barycentric\"),u=t(\"polytope-closest-point/lib/closest_point_2d.js\");e.exports=s},{barycentric:92,\"polytope-closest-point/lib/closest_point_2d.js\":94}],90:[function(t,e,r){var n=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",i=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",a=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",o=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",s=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",l=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",u=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",c=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",h=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\",f=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n}\",d=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec3 contourColor;\\n\\nvoid main() {\\n gl_FragColor = vec4(contourColor,1);\\n}\\n\";r.meshShader={vertex:n,fragment:i,attributes:[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.wireShader={vertex:a,fragment:o,attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.pointShader={vertex:s,fragment:l,attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"},{name:\"pointSize\",type:\"float\"}]},r.pickShader={vertex:u,fragment:c,attributes:[{name:\"position\",type:\"vec3\"},{name:\"id\",type:\"vec4\"}]},r.pointPickShader={vertex:h,fragment:c,attributes:[{name:\"position\",type:\"vec3\"},{name:\"pointSize\",type:\"float\"},{name:\"id\",type:\"vec4\"}]},r.contourShader={vertex:f,fragment:d,attributes:[{name:\"position\",type:\"vec3\"}]}},{}],91:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,g,v,m,y,b,x,_,w,k,A,M,L){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=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=x,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=L,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=j,this._view=j,this._projection=j,this._resolution=[1,1]}function i(t){for(var e=w({colormap:t,nshades:256,format:\"rgba\"}),r=new Uint8Array(1024),n=0;256>n;++n){for(var i=e[n],a=0;3>a;++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;e>i;++i)n[i]=0;for(var a=t.length,i=0;a>i;++i)for(var o=t[i],s=0;s<o.length;++s)n[o[s]]=r[i];return n}function o(t){for(var e=t.length,r=new Array(e),n=0;e>n;++n)r[n]=t[n][2];return r}function s(t){var e=p(t,T);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function l(t){var e=p(t,E);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=p(t,C);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function c(t){var e=p(t,S);return e.attributes.position.location=0,e.attributes.id.location=1,e}function h(t){var e=p(t,z);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function f(t){var e=p(t,P);return e.attributes.position.location=0,e}function d(t){var e=t.gl,r=s(e),i=l(e),a=u(e),o=c(e),d=h(e),p=f(e),y=m(e,_(new Uint8Array([255,255,255,255]),[1,1,4]));y.generateMipmap(),y.minFilter=e.LINEAR_MIPMAP_LINEAR,y.magFilter=e.LINEAR;var b=g(e),x=g(e),w=g(e),k=g(e),A=g(e),M=v(e,[{buffer:b,type:e.FLOAT,size:3},{buffer:A,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:e.FLOAT,size:4},{buffer:w,type:e.FLOAT,size:2},{buffer:k,type:e.FLOAT,size:3}]),L=g(e),T=g(e),E=g(e),C=g(e),S=v(e,[{buffer:L,type:e.FLOAT,size:3},{buffer:C,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:T,type:e.FLOAT,size:4},{buffer:E,type:e.FLOAT,size:2}]),z=g(e),P=g(e),j=g(e),O=g(e),I=g(e),D=v(e,[{buffer:z,type:e.FLOAT,size:3},{buffer:I,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:P,type:e.FLOAT,size:4},{buffer:j,type:e.FLOAT,size:2},{buffer:O,type:e.FLOAT,size:1}]),R=g(e),F=v(e,[{buffer:R,type:e.FLOAT,size:3}]),N=new n(e,y,r,i,a,o,d,p,b,A,x,w,k,M,L,C,T,E,S,z,I,P,j,O,D,R,F);return N.update(t),N}var p=t(\"gl-shader\"),g=t(\"gl-buffer\"),v=t(\"gl-vao\"),m=t(\"gl-texture2d\"),y=t(\"normals\"),b=t(\"gl-mat4/multiply\"),x=t(\"gl-mat4/invert\"),_=t(\"ndarray\"),w=t(\"colormap\"),k=t(\"simplicial-complex-contour\"),A=t(\"typedarray-pool\"),M=t(\"./lib/shaders\"),L=t(\"./lib/closest-point\"),T=M.meshShader,E=M.wireShader,C=M.pointShader,S=M.pickShader,z=M.pointPickShader,P=M.contourShader,j=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],O=n.prototype;O.isOpaque=function(){return this.opacity>=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)return void(this.contourCount=0);for(var e=k(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=A.mallocFloat32(6*a),s=0,l=0;a>l;++l)for(var u=r[l],c=0;2>c;++c){var h=u[0];2===u.length&&(h=u[c]);for(var f=n[h][0],d=n[h][1],p=i[h],g=1-p,v=this.positions[f],m=this.positions[d],y=0;3>y;++y)o[s++]=p*v[y]+g*m[y]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),A.free(o)},O.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,\"contourEnable\"in t&&(this.contourEnable=t.contourEnable),\"contourColor\"in t&&(this.contourColor=t.contourColor),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"opacity\"in t&&(this.opacity=t.opacity),t.texture?(this.texture.dispose(),this.texture=m(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(i(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var s=[],l=[],u=[],c=[],h=[],f=[],d=[],p=[],g=[],v=[],b=[],x=[],_=[],w=[];this.cells=r,this.positions=n;var k=t.vertexNormals,A=t.cellNormals;t.useFacetNormals&&!A&&(A=y.faceNormals(r,n)),A||k||(k=y.vertexNormals(r,n));var M=t.vertexColors,L=t.cellColors,T=t.meshColor||[1,1,1,1],E=t.vertexUVs,C=t.vertexIntensity,S=t.cellUVs,z=t.cellIntensity,P=1/0,j=-(1/0);if(!E&&!S)if(C)for(var O=0;O<C.length;++O){var I=C[O];P=Math.min(P,I),j=Math.max(j,I)}else if(z)for(var O=0;O<z.length;++O){var I=z[O];P=Math.min(P,I),j=Math.max(j,I)}else for(var O=0;O<n.length;++O){var I=n[O][2];P=Math.min(P,I),j=Math.max(j,I)}C?this.intensity=C:z?this.intensity=a(r,n.length,z):this.intensity=o(n);var D=t.pointSizes,R=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(var O=0;O<n.length;++O)for(var F=n[O],N=0;3>N;++N)!isNaN(F[N])&&isFinite(F[N])&&(this.bounds[0][N]=Math.min(this.bounds[0][N],F[N]),this.bounds[1][N]=Math.max(this.bounds[1][N],F[N]));var B=0,U=0,V=0;t:for(var O=0;O<r.length;++O){var q=r[O];switch(q.length){case 1:for(var H=q[0],F=n[H],N=0;3>N;++N)if(isNaN(F[N])||!isFinite(F[N]))continue t;v.push(F[0],F[1],F[2]);var G;G=M?M[H]:L?L[O]:T,3===G.length?b.push(G[0],G[1],G[2],1):b.push(G[0],G[1],G[2],G[3]);var Y;Y=E?E[H]:C?[(C[H]-P)/(j-P),0]:S?S[O]:z?[(z[O]-P)/(j-P),0]:[(F[2]-P)/(j-P),0],x.push(Y[0],Y[1]),D?_.push(D[H]):_.push(R),w.push(O),V+=1;break;case 2:for(var N=0;2>N;++N)for(var H=q[N],F=n[H],W=0;3>W;++W)if(isNaN(F[W])||!isFinite(F[W]))continue t;for(var N=0;2>N;++N){var H=q[N],F=n[H];f.push(F[0],F[1],F[2]);var G;G=M?M[H]:L?L[O]:T,3===G.length?d.push(G[0],G[1],G[2],1):d.push(G[0],G[1],G[2],G[3]);var Y;Y=E?E[H]:C?[(C[H]-P)/(j-P),0]:S?S[O]:z?[(z[O]-P)/(j-P),0]:[(F[2]-P)/(j-P),0],p.push(Y[0],Y[1]),g.push(O)}U+=1;break;case 3:for(var N=0;3>N;++N)for(var H=q[N],F=n[H],W=0;3>W;++W)if(isNaN(F[W])||!isFinite(F[W]))continue t;for(var N=0;3>N;++N){var H=q[N],F=n[H];s.push(F[0],F[1],F[2]);var G;G=M?M[H]:L?L[O]:T,3===G.length?l.push(G[0],G[1],G[2],1):l.push(G[0],G[1],G[2],G[3]);var Y;Y=E?E[H]:C?[(C[H]-P)/(j-P),0]:S?S[O]:z?[(z[O]-P)/(j-P),0]:[(F[2]-P)/(j-P),0],c.push(Y[0],Y[1]);var X;X=k?k[H]:A[O],u.push(X[0],X[1],X[2]),h.push(O)}B+=1}}this.pointCount=V,this.edgeCount=U,this.triangleCount=B,this.pointPositions.update(v),this.pointColors.update(b),this.pointUVs.update(x),this.pointSizes.update(_),this.pointIds.update(new Uint32Array(w)),this.edgePositions.update(f),this.edgeColors.update(d),this.edgeUVs.update(p),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(h))}},O.drawTransparent=O.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||j,n=t.view||j,i=t.projection||j,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;3>o;++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]);var s={model:r,view:n,projection:i,clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var l=new Array(16);b(l,s.view,s.model),b(l,s.projection,l),x(l,l);for(var o=0;3>o;++o)s.eyePosition[o]=l[12+o]/l[15];for(var u=l[15],o=0;3>o;++o)u+=this.lightPosition[o]*l[4*o+3];for(var o=0;3>o;++o){for(var c=l[12+o],h=0;3>h;++h)c+=l[4*h+o]*this.lightPosition[h];s.lightPosition[o]=c/u}if(this.triangleCount>0){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()}},O.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||j,n=t.view||j,i=t.projection||j,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;3>o;++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()}},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],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=L(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;for(var s=o[2],l=0,a=0;a<r.length;++a)l+=s[a]*this.intensity[r[a]];return{position:o[1],index:r[o[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[o[0]]]}},O.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=d},{\"./lib/closest-point\":89,\"./lib/shaders\":90,colormap:40,\"gl-buffer\":59,\"gl-mat4/invert\":78,\"gl-mat4/multiply\":80,\"gl-shader\":138,\"gl-texture2d\":162,\"gl-vao\":166,ndarray:189,normals:93,\"simplicial-complex-contour\":95,\"typedarray-pool\":217}],92:[function(t,e,r){\"use strict\";function n(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}function i(t,e){for(var r=e.length,i=new Array(r+1),o=0;r>o;++o){for(var s=new Array(r+1),l=0;r>=l;++l)s[l]=t[l][o];i[o]=s}i[r]=new Array(r+1);for(var o=0;r>=o;++o)i[r][o]=1;for(var u=new Array(r+1),o=0;r>o;++o)u[o]=e[o];u[r]=1;var c=a(i,u),h=n(c[r+1]);0===h&&(h=1);for(var f=new Array(r+1),o=0;r>=o;++o)f[o]=n(c[o])/h;return f}e.exports=i;var a=t(\"robust-linear-solve\")},{\"robust-linear-solve\":192}],93:[function(t,e,r){var n=1e-6;r.vertexNormals=function(t,e){for(var r=e.length,i=new Array(r),a=0;r>a;++a)i[a]=[0,0,0];for(var a=0;a<t.length;++a)for(var o=t[a],s=0,l=o[o.length-1],u=o[0],c=0;c<o.length;++c){s=l,l=u,u=o[(c+1)%o.length];for(var h=e[s],f=e[l],d=e[u],p=new Array(3),g=0,v=new Array(3),m=0,y=0;3>y;++y)p[y]=h[y]-f[y],g+=p[y]*p[y],v[y]=d[y]-f[y],m+=v[y]*v[y];if(g*m>n)for(var b=i[l],x=1/Math.sqrt(g*m),y=0;3>y;++y){var _=(y+1)%3,w=(y+2)%3;b[y]+=x*(v[_]*p[w]-v[w]*p[_])}}for(var a=0;r>a;++a){for(var b=i[a],k=0,y=0;3>y;++y)k+=b[y]*b[y];if(k>n)for(var x=1/Math.sqrt(k),y=0;3>y;++y)b[y]*=x;else for(var y=0;3>y;++y)b[y]=0}return i},r.faceNormals=function(t,e){for(var r=t.length,i=new Array(r),a=0;r>a;++a){for(var o=t[a],s=new Array(3),l=0;3>l;++l)s[l]=e[o[l]];for(var u=new Array(3),c=new Array(3),l=0;3>l;++l)u[l]=s[1][l]-s[0][l],c[l]=s[2][l]-s[0][l];for(var h=new Array(3),f=0,l=0;3>l;++l){var d=(l+1)%3,p=(l+2)%3;h[l]=u[d]*c[p]-u[p]*c[d],f+=h[l]*h[l]}f=f>n?1/Math.sqrt(f):0;for(var l=0;3>l;++l)h[l]*=f;i[a]=h}return i}},{}],94:[function(t,e,r){\"use strict\";function n(t,e,r,n,s){i.length<n.length&&(i=new Float64Array(n.length),a=new Float64Array(n.length),o=new Float64Array(n.length));for(var l=0;l<n.length;++l)i[l]=t[l]-n[l],a[l]=e[l]-t[l],o[l]=r[l]-t[l];for(var u=0,c=0,h=0,f=0,d=0,p=0,l=0;l<n.length;++l){var g=a[l],v=o[l],m=i[l];u+=g*g,c+=g*v,h+=v*v,f+=m*g,d+=m*v,p+=m*m}var y,b=Math.abs(u*h-c*c),x=c*d-h*f,_=c*f-u*d;if(b>=x+_)if(0>x)0>_&&0>f?(_=0,-f>=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 k,A,M,L;0>x?(k=c+f,A=h+d,A>k?(M=A-k,L=u-2*c+h,M>=L?(x=1,_=0,y=u+2*f+p):(x=M/L,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(x=0,0>=A?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):(_=-d/h,y=d*_+p))):0>_?(k=c+d,A=u+f,A>k?(M=A-k,L=u-2*c+h,M>=L?(_=1,x=0,y=h+2*d+p):(_=M/L,x=1-_,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(_=0,0>=A?(x=1,y=u+2*f+p):f>=0?(x=0,y=p):(x=-f/u,y=f*x+p))):(M=h+d-c-f,0>=M?(x=0,_=1,y=h+2*d+p):(L=u-2*c+h,M>=L?(x=1,_=0,y=u+2*f+p):(x=M/L,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)))}for(var T=1-x-_,l=0;l<n.length;++l)s[l]=T*t[l]+x*e[l]+_*r[l];return 0>y?0:y}var i=new Float64Array(4),a=new Float64Array(4),o=new Float64Array(4);e.exports=n},{}],95:[function(t,e,r){\"use strict\";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=h.mallocUint8(r),i=0;r>i;++i)n[i]=t[i]<e|0;return n}function a(t,e){for(var r=t.length,n=e*(e+1)/2*r|0,i=h.mallocUint32(2*n),a=0,o=0;r>o;++o)for(var s=t[o],e=s.length,l=0;e>l;++l)for(var u=0;l>u;++u){var d=s[u],p=s[l];i[a++]=0|Math.min(d,p),i[a++]=0|Math.max(d,p)}var g=a/2|0;f(c(i,[g,2]));for(var v=2,o=2;a>o;o+=2)(i[o-2]!==i[o]||i[o-1]!==i[o+1])&&(i[v++]=i[o],i[v++]=i[o+1]);return c(i,[v/2|0,2])}function o(t,e,r,n){for(var i=t.data,a=t.shape[0],o=h.mallocDouble(a),s=0,l=0;a>l;++l){var u=i[2*l],f=i[2*l+1];if(r[u]!==r[f]){var d=e[u],p=e[f];i[2*s]=u,i[2*s+1]=f,o[s++]=(p-n)/(p-d)}}return t.shape[0]=s,c(o,[s])}function s(t,e){var r=h.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var a=0,o=0;n>o;++o){var s=i[2*o];if(s!==a){for(r[2*a+1]=o;++a<s;)r[2*a]=o,r[2*a+1]=o;r[2*a]=o}}for(r[2*a+1]=n;++a<e;)r[2*a]=r[2*a+1]=n;return r}function l(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;e>i;++i)n[i]=[r[2*i],r[2*i+1]];return n}function u(t,e,r,u){r=r||0,\"undefined\"==typeof u&&(u=n(t));var c=t.length;if(0===c||1>u)return{cells:[],vertexIds:[],vertexWeights:[]};var f=i(e,+r),p=a(t,u),g=o(p,e,f,+r),v=s(p,0|e.length),m=d(u)(t,p.data,v,f),y=l(p),b=[].slice.call(g.data,0,g.shape[0]);return h.free(f),h.free(p.data),h.free(g.data),h.free(v),{cells:m,vertexIds:y,vertexWeights:b}}e.exports=u;var c=t(\"ndarray\"),h=t(\"typedarray-pool\"),f=t(\"ndarray-sort\"),d=t(\"./lib/codegen\")},{\"./lib/codegen\":96,ndarray:189,\"ndarray-sort\":99,\"typedarray-pool\":217}],96:[function(t,e,r){\"use strict\";function n(t){function e(t){if(!(t.length<=0)){u.push(\"R.push(\");for(var e=0;e<t.length;++e){var r=t[e];e>0&&u.push(\",\"),u.push(\"[\");for(var n=0;n<r.length;++n){var i=r[n];n>0&&u.push(\",\"),u.push(\"B(C,E,c[\",i[0],\"],c[\",i[1],\"])\")}u.push(\"]\")}u.push(\");\")}}var r=0,n=new Array(t+1);n[0]=[[]];for(var i=1;t>=i;++i)for(var s=n[i]=o(i),l=0;l<s.length;++l)r=Math.max(r,s[i].length);for(var u=[\"function B(C,E,i,j){\",\"var a=Math.min(i,j)|0,b=Math.max(i,j)|0,l=C[2*a],h=C[2*a+1];\",\"while(l<h){\",\"var m=(l+h)>>1,v=E[2*m+1];\",\"if(v===b){return m}\",\"if(b<v){h=m}else{l=m+1}\",\"}\",\"return l;\",\"};\",\"function getContour\",t,\"d(F,E,C,S){\",\"var n=F.length,R=[];\",\"for(var i=0;i<n;++i){var c=F[i],l=c.length;\"],i=t+1;i>1;--i){t+1>i&&u.push(\"else \"),u.push(\"if(l===\",i,\"){\");for(var c=[],l=0;i>l;++l)c.push(\"(S[c[\"+l+\"]]<<\"+l+\")\");u.push(\"var M=\",c.join(\"+\"),\";if(M===0||M===\",(1<<i)-1,\"){continue}switch(M){\");for(var s=n[i-1],l=0;l<s.length;++l)u.push(\"case \",l,\":\"),e(s[l]),u.push(\"break;\");u.push(\"}}\")}u.push(\"}return R;};return getContour\",t,\"d\");var h=new Function(\"pool\",u.join(\"\"));return h(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\":97,\"typedarray-pool\":217}],97:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],i=[],a=0;t>=a;++a)if(e&1<<a){r.push(n(t,a-1,a-1)),i.push(null);for(var s=0;t>=s;++s)~e&1<<s&&(r.push(n(t,a-1,s-1)),i.push([a,s]))}var l=o(r),u=[];t:for(var a=0;a<l.length;++a){for(var c=l[a],h=[],s=0;s<c.length;++s){if(!i[c[s]])continue t;h.push(i[c[s]].slice())}u.push(h)}return u}function a(t){for(var e=1<<t+1,r=new Array(e),n=0;e>n;++n)r[n]=i(t,n);return r}e.exports=a;var o=t(\"convex-hull\")},{\"convex-hull\":42}],98:[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;t>r;++r)e.push(\"s\"+r);for(var r=0;t>r;++r)e.push(\"n\"+r);for(var r=1;t>r;++r)e.push(\"d\"+r);for(var r=1;t>r;++r)e.push(\"e\"+r);for(var r=1;t>r;++r)e.push(\"f\"+r);return e}function a(t,e){function r(t){return\"generic\"===e?[\"data.get(\",t,\")\"].join(\"\"):[\"data[\",t,\"]\"].join(\"\")}function a(t,r){return\"generic\"===e?[\"data.set(\",t,\",\",r,\")\"].join(\"\"):[\"data[\",t,\"]=\",r].join(\"\")}var o=[\"'use strict'\"],s=[\"ndarrayInsertionSort\",t.join(\"d\"),e].join(\"\"),l=[\"left\",\"right\",\"data\",\"offset\"].concat(i(t.length)),u=n(e),c=[\"i,j,cptr,ptr=left*s0+offset\"];if(t.length>1){for(var h=[],f=1;f<t.length;++f)c.push(\"i\"+f),h.push(\"n\"+f);u?c.push(\"scratch=malloc(\"+h.join(\"*\")+\")\"):c.push(\"scratch=new Array(\"+h.join(\"*\")+\")\"),c.push(\"dptr\",\"sptr\",\"a\",\"b\")}else c.push(\"scratch\");if(o.push([\"function \",s,\"(\",l.join(\",\"),\"){var \",c.join(\",\")].join(\"\"),\"for(i=left+1;i<=right;++i){\",\"j=i;ptr+=s0\",\"cptr=ptr\"),t.length>1){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,\"<n\",d,\";++i\",d,\"){\"].join(\"\"))}o.push(\"scratch[dptr++]=\",r(\"sptr\"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push(\"sptr+=d\"+d,\"}\")}o.push(\"__g:while(j-->left){\",\"dptr=0\",\"sptr=cptr-s0\");for(var f=1;f<t.length;++f)1===f&&o.push(\"__l:\"),o.push([\"for(i\",f,\"=0;i\",f,\"<n\",f,\";++i\",f,\"){\"].join(\"\"));o.push([\"a=\",r(\"sptr\"),\"\\nb=scratch[dptr]\\nif(a<b){break __g}\\nif(a>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,\"<n\",d,\";++i\",d,\"){\"].join(\"\"))}o.push(a(\"dptr\",r(\"sptr\")));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push([\"dptr+=d\",d,\";sptr+=d\",d].join(\"\"),\"}\")}o.push(\"cptr-=s0\\n}\"),o.push(\"dptr=cptr;sptr=0\");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push([\"for(i\",d,\"=0;i\",d,\"<n\",d,\";++i\",d,\"){\"].join(\"\"))}o.push(a(\"dptr\",\"scratch[sptr++]\"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push(\"dptr+=d\"+d,\"}\")}}else o.push(\"scratch=\"+r(\"ptr\"),\"while((j-->left)&&(\"+r(\"cptr-s0\")+\">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(\"\");\n",
"}function l(e,r,n){if(1===e.length)_.push(\"ptr0=\"+a(e[0]));else for(var i=0;i<e.length;++i)_.push([\"b_ptr\",i,\"=s0*\",e[i]].join(\"\"));r&&_.push(\"pivot_ptr=0\"),_.push(\"ptr_shift=offset\");for(var i=t.length-1;i>=0;--i){var o=t[i];0!==o&&_.push([\"for(i\",o,\"=0;i\",o,\"<n\",o,\";++i\",o,\"){\"].join(\"\"))}if(e.length>1)for(var i=0;i<e.length;++i)_.push([\"ptr\",i,\"=b_ptr\",i,\"+ptr_shift\"].join(\"\"));_.push(n),r&&_.push(\"++pivot_ptr\");for(var i=0;i<t.length;++i){var o=t[i];0!==o&&(e.length>1?_.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;o<r.length;++o)_.push([\"b_ptr\",o,\"=s0*\",r[o]].join(\"\"));_.push(\"ptr_shift=offset\")}n&&_.push(\"pivot_ptr=0\"),e&&_.push(e+\":\");for(var o=1;o<t.length;++o)_.push([\"for(i\",o,\"=0;i\",o,\"<n\",o,\";++i\",o,\"){\"].join(\"\"));if(r.length>1)for(var o=0;o<r.length;++o)_.push([\"ptr\",o,\"=b_ptr\",o,\"+ptr_shift\"].join(\"\"));_.push(i);for(var o=t.length-1;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&&A&&_.push(\"free(pivot1)\",\"free(pivot2)\")}function f(e,r){var n=\"el\"+e,i=\"el\"+r;if(t.length>1){var s=\"__l\"+ ++M;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\"+ ++M;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 g(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 m(t,e){g(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\",++M,\":while(true){\"].join(\"\")),l([e],!0,[\"if(\",o(\"ptr0\"),\"!==pivot\",r,\"[pivot_ptr]){break __l\",M,\"}\"].join(\"\")),_.push(n,\"}\")):_.push([\"while(\",o(a(e)),\"===pivot\",r,\"){\",n,\"}\"].join(\"\"))}var _=[\"'use strict'\"],w=[\"ndarrayQuickSort\",t.join(\"d\"),e].join(\"\"),k=[\"left\",\"right\",\"data\",\"offset\"].concat(i(t.length)),A=n(e),M=0;_.push([\"function \",w,\"(\",k.join(\",\"),\"){\"].join(\"\"));var L=[\"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 T=[],E=1;E<t.length;++E)T.push(\"n\"+E),L.push(\"i\"+E);for(var E=0;8>E;++E)L.push(\"b_ptr\"+E);L.push(\"ptr3\",\"ptr4\",\"ptr5\",\"ptr6\",\"ptr7\",\"pivot_ptr\",\"ptr_shift\",\"elementSize=\"+T.join(\"*\")),A?L.push(\"pivot1=malloc(elementSize)\",\"pivot2=malloc(elementSize)\"):L.push(\"pivot1=new Array(elementSize),pivot2=new Array(elementSize)\")}else L.push(\"pivot1\",\"pivot2\");if(_.push(\"var \"+L.join(\",\")),f(1,2),f(4,5),f(1,3),f(2,3),f(1,4),f(3,4),f(2,5),f(2,3),f(4,5),t.length>1?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){\"),g(\"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{\"),m(\"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){\"),g(\"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(--great<k){break}\"),_.push(\"continue\"),_.push(\"}else{\"),p(\"comp\",\"great\",1),_.push(\"if(comp<0){\"),v(\"k\",\"less\",\"great\"),_.push(\"}else{\"),m(\"k\",\"great\"),_.push(\"}\"),_.push(\"break\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),y(\"left\",\"(less-1)\",1),y(\"right\",\"(great+1)\",2),b(\"left\",\"(less-2)\"),b(\"(great+2)\",\"right\"),_.push(\"if(pivots_are_equal){\"),h(),_.push(\"return\"),_.push(\"}\"),_.push(\"if(less<index1&&great>index5){\"),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){\"),g(\"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(--great<k){break}\"),_.push(\"continue\"),_.push(\"}else{\"),p(\"comp\",\"great\",1),_.push(\"if(comp<0){\"),v(\"k\",\"less\",\"great\"),_.push(\"}else{\"),m(\"k\",\"great\"),_.push(\"}\"),_.push(\"break\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),_.push(\"}\"),h(),b(\"less\",\"great\"),_.push(\"}return \"+w),t.length>1&&A){var C=new Function(\"insertionSort\",\"malloc\",\"free\",_.join(\"\\n\"));return C(r,A[0],A[1])}var C=new Function(\"insertionSort\",_.join(\"\\n\"));return C(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;c<t.length;++c)l.push([\"s\",c,\"=stride[\",c,\"]|0,n\",c,\"=shape[\",c,\"]|0\"].join(\"\"));for(var h=new Array(t.length),f=[],c=0;c<t.length;++c){var d=t[c];0!==d&&(0===f.length?h[d]=\"1\":h[d]=f.join(\"*\"),f.push(\"n\"+d))}for(var p=-1,g=-1,c=0;c<t.length;++c){var v=t[c];0!==v&&(p>0?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&&(g>0?l.push([\"e\",d,\"=s\",d,\"-e\",g,\"*n\",g,\",f\",d,\"=\",h[d],\"-f\",g,\"*n\",g].join(\"\")):l.push([\"e\",d,\"=s\",d,\",f\",d,\"=\",h[d]].join(\"\")),g=d)}r.push(\"var \"+l.join(\",\"));var m=[\"0\",\"n0-1\",\"data\",\"offset\"].concat(i(t.length));r.push([\"if(n0<=\",u,\"){\",\"insertionSort(\",m.join(\",\"),\")}else{\",\"quickSort(\",m.join(\",\"),\")}\"].join(\"\")),r.push(\"}return \"+n);var y=new Function(\"insertionSort\",\"quickSort\",r.join(\"\\n\")),b=a(t,e),x=o(t,e,b);return y(b,x)}var l=t(\"typedarray-pool\"),u=32;e.exports=s},{\"typedarray-pool\":217}],99:[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\":98}],100:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[0,0,0,1,1,0,1,1]),i=o(e,s.boxVert,s.lineFrag);return new n(t,r,i)}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"./shaders\"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawBox=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o){var s=this.plot,l=this.shader,u=s.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,l.uniforms.lo=t,l.uniforms.hi=e,l.uniforms.color=o,u.drawArrays(u.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":103,\"gl-buffer\":59,\"gl-shader\":138}],101:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function i(t,e){return t-e}function a(t){var e=t.gl,r=o(e),i=s(e,u.gridVert,u.gridFrag),a=s(e,u.tickVert,u.gridFrag),l=new n(t,r,i,a);return l}e.exports=a;var o=t(\"gl-buffer\"),s=t(\"gl-shader\"),l=t(\"binary-search-bounds\"),u=t(\"./shaders\"),c=n.prototype;c.draw=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){for(var n=this.plot,i=this.vbo,a=this.shader,o=this.ticks,s=n.gl,l=n._tickBounds,u=n.dataBox,c=n.viewBox,h=n.gridLineWidth,f=n.gridLineColor,d=n.gridLineEnable,p=n.pixelRatio,g=0;2>g;++g){var v=l[g],m=l[g+2],y=m-v,b=.5*(u[g+2]+u[g]),x=u[g+2]-u[g];e[g]=2*y/x,t[g]=2*(v-b)/x}a.bind(),i.bind(),a.attributes.dataCoord.pointer(),a.uniforms.dataShift=t,a.uniforms.dataScale=e;for(var _=0,g=0;2>g;++g){r[0]=r[1]=0,r[g]=1,a.uniforms.dataAxis=r,a.uniforms.lineWidth=h[g]/(c[g+2]-c[g])*p,a.uniforms.color=f[g];var w=6*o[g].length;d[g]&&s.drawArrays(s.TRIANGLES,_,w),_+=w}}}(),c.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,u=this.vbo,c=this.tickShader,h=this.ticks,f=s.gl,d=s._tickBounds,p=s.dataBox,g=s.viewBox,v=s.pixelRatio,m=s.screenBox,y=m[2]-m[0],b=m[3]-m[1],x=g[2]-g[0],_=g[3]-g[1],w=0;2>w;++w){var k=d[w],A=d[w+2],M=A-k,L=.5*(p[w+2]+p[w]),T=p[w+2]-p[w];e[w]=2*M/T,t[w]=2*(k-L)/T}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var E=c.uniforms;E.dataShift=t,E.dataScale=e;var C=s.tickMarkLength,S=s.tickMarkWidth,z=s.tickMarkColor,P=0,j=6*h[0].length,O=Math.min(l.ge(h[0],(p[0]-d[0])/(d[2]-d[0]),i),h[0].length),I=Math.min(l.gt(h[0],(p[2]-d[0])/(d[2]-d[0]),i),h[0].length),D=P+6*O,R=6*Math.max(0,I-O),F=Math.min(l.ge(h[1],(p[1]-d[1])/(d[3]-d[1]),i),h[1].length),N=Math.min(l.gt(h[1],(p[3]-d[1])/(d[3]-d[1]),i),h[1].length),B=j+6*F,U=6*Math.max(0,N-F);a[0]=2*(g[0]-C[1])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=C[1]*v/y,o[1]=S[1]*v/b,E.color=z[1],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,B,U),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[1]-C[0])/b-1,o[0]=S[0]*v/y,o[1]=C[0]*v/b,E.color=z[0],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,D,R),a[0]=2*(g[2]+C[3])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=C[3]*v/y,o[1]=S[3]*v/b,E.color=z[3],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,B,U),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[3]+C[2])/b-1,o[0]=S[2]*v/y,o[1]=C[2]*v/b,E.color=z[2],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,D,R)}}(),c.update=function(){var t=[1,1,-1,-1,1,-1],e=[1,-1,1,1,-1,-1];return function(r){for(var n=r.ticks,i=r.bounds,a=new Float32Array(18*(n[0].length+n[1].length)),o=(this.plot.zeroLineEnable,0),s=[[],[]],l=0;2>l;++l)for(var u=s[l],c=n[l],h=i[l],f=i[l+2],d=0;d<c.length;++d){var p=(c[d].x-h)/(f-h);u.push(p);for(var g=0;6>g;++g)a[o++]=p,a[o++]=t[g],a[o++]=e[g]}this.ticks=s,this.vbo.update(a)}}(),c.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{\"./shaders\":103,\"binary-search-bounds\":105,\"gl-buffer\":59,\"gl-shader\":138}],102:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl,r=a(e,[-1,-1,-1,1,1,-1,1,1]),i=o(e,s.lineVert,s.lineFrag),l=new n(t,r,i);return l}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"./shaders\"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawLine=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o,s){var l=this.plot,u=this.shader,c=l.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,u.uniforms.start=t,u.uniforms.end=e,u.uniforms.width=o*l.pixelRatio,u.uniforms.color=s,c.drawArrays(c.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":103,\"gl-buffer\":59,\"gl-shader\":138}],103:[function(t,e,r){\"use strict\";var n=\"#define GLSLIFY 1\\nprecision lowp float;\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = vec4(color.xyz * color.w, color.w);\\n}\\n\";e.exports={lineVert:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 start, end;\\nuniform float width;\\n\\nvec2 perp(vec2 v) {\\n return vec2(v.y, -v.x);\\n}\\n\\nvec2 screen(vec2 v) {\\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n vec2 delta = normalize(perp(start - end));\\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\\n}\\n\",lineFrag:n,textVert:\"#define GLSLIFY 1\\nattribute vec3 textCoordinate;\\n\\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\\nuniform float angle;\\n\\nvoid main() {\\n float dataOffset = textCoordinate.z;\\n vec2 glyphOffset = textCoordinate.xy;\\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\\n glyphMatrix * glyphOffset * textScale + screenOffset;\\n gl_Position = vec4(screenCoordinate, 0, 1);\\n}\\n\",textFrag:n,gridVert:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale;\\nuniform float lineWidth;\\n\\nvoid main() {\\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\\n gl_Position = vec4(pos, 0, 1);\\n}\\n\",gridFrag:n,boxVert:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 lo, hi;\\n\\nvec2 screen(vec2 v) {\\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\\n}\\n\",tickVert:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\\n\\nvoid main() {\\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\\n}\\n\"}},{}],104:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function i(t){var e=t.gl,r=a(e),i=o(e,u.textVert,u.textFrag),s=new n(t,r,i);return s}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"text-cache\"),l=t(\"binary-search-bounds\"),u=t(\"./shaders\"),c=n.prototype;c.drawTicks=function(){var t=[0,0],e=[0,0],r=[0,0];return function(n){var i=this.plot,a=this.shader,o=this.tickX[n],s=this.tickOffset[n],u=i.gl,c=i.viewBox,h=i.dataBox,f=i.screenBox,d=i.pixelRatio,p=i.tickEnable,g=i.tickPad,v=i.tickColor,m=i.tickAngle,y=(i.tickMarkLength,i.labelEnable),b=i.labelPad,x=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],k=this.labelCount[n],A=l.lt(o,h[n]),M=l.le(o,h[n+2]);t[0]=t[1]=0,t[n]=1,e[n]=(c[2+n]+c[n])/(f[2+n]-f[n])-1;var L=2/f[2+(1^n)]-f[1^n];e[1^n]=L*c[1^n]-1,p[n]&&(e[1^n]-=L*d*g[n],M>A&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n],a.uniforms.angle=m[n],u.drawArrays(u.TRIANGLES,s[A],s[M]-s[A]))),y[n]&&(e[1^n]-=L*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,k)),e[1^n]=L*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=L*d*g[n+2],M>A&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n+2],a.uniforms.angle=m[n+2],u.drawArrays(u.TRIANGLES,s[A],s[M]-s[A]))),y[n+2]&&(e[1^n]+=L*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,k))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){for(var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,o=r.titleCenter,u=r.pixelRatio,c=0;2>c;++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;2>u;++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],g=l[u],v=l[u+2],m=v-g,y=s[u],b=s[u+2],x=b-y;e[u]=2*f/p*m/x,t[u]=2*(c-d)/p*m/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){for(var e=[],r=t.ticks,n=t.bounds,i=0;2>i;++i){for(var a=[Math.floor(e.length/3)],o=[-(1/0)],l=r[i],u=0;u<l.length;++u){for(var c=l[u],h=c.x,f=c.text,d=c.font||\"sans-serif\",p=c.fontSize||12,g=s(d,f).data,v=1/(n[i+2]-n[i]),m=n[i],y=0;y<g.length;y+=2)e.push(g[y]*p,-g[y+1]*p,(h-m)*v);a.push(Math.floor(e.length/3)),o.push(h)}this.tickOffset[i]=a,this.tickX[i]=o}for(var i=0;2>i;++i){this.labelOffset[i]=Math.floor(e.length/3);for(var g=s(t.labelFont[i],t.labels[i]).data,p=t.labelSize[i],u=0;u<g.length;u+=2)e.push(g[u]*p,-g[u+1]*p,0);this.labelCount[i]=Math.floor(e.length/3)-this.labelOffset[i]}this.titleOffset=Math.floor(e.length/3);for(var g=s(t.titleFont,t.title).data,p=t.titleSize,u=0;u<g.length;u+=2)e.push(g[u]*p,-g[u+1]*p,0);this.titleCount=Math.floor(e.length/3)-this.titleOffset,this.vbo.update(e)},c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":103,\"binary-search-bounds\":105,\"gl-buffer\":59,\"gl-shader\":138,\"text-cache\":212}],105:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){var a=[\"function \",t,\"(a,l,h,\",n.join(\",\"),\"){\",i?\"\":\"var i=\",r?\"l-1\":\"h+1\",\";while(l<=h){var m=(l+h)>>>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){var a=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(\"\"));return a()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],106:[function(t,e,r){\"use strict\";function n(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-(1/0),-(1/0)],this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}function i(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function a(t,e){return t.x-e.x}function o(t){var e=t.gl,r=s(e,[e.drawingBufferWidth,e.drawingBufferHeight]),i=new n(e,r);return i.grid=l(i),i.text=u(i),i.line=c(i),i.box=h(i),i.update(t),i}e.exports=o;var s=t(\"gl-select-static\"),l=t(\"./lib/grid\"),u=t(\"./lib/text\"),c=t(\"./lib/line\"),h=t(\"./lib/box\"),f=n.prototype;f.setDirty=function(){this.dirty=this.pickDirty=!0},f.setOverlayDirty=function(){this.dirty=!0},f.nextDepthValue=function(){return this._depthCounter++/65536},f.draw=function(){return function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,i=this.pixelRatio,a=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var u=this.borderColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var c=this.backgroundColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var h=this.zeroLineEnable,f=this.zeroLineColor,d=this.zeroLineWidth;if(h[0]||h[1]){o.bind();for(var p=0;2>p;++p)if(h[p]&&n[p]<=0&&n[p+2]>=0){var g=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(g,e[1],g,e[3],d[p],f[p]):o.drawLine(e[0],g,e[2],g,d[p],f[p])}}for(var p=0;p<l.length;++p)l[p].draw();t.viewport(e[0],e[1],e[2]-e[0],e[3]-e[1]),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.grid.drawTickMarks(),o.bind();var v=this.borderLineEnable,m=this.borderLineWidth,y=this.borderLineColor;v[1]&&o.drawLine(r[0],r[1]-.5*m[1]*i,r[0],r[3]+.5*m[3]*i,m[1],y[1]),v[0]&&o.drawLine(r[0]-.5*m[0]*i,r[1],r[2]+.5*m[2]*i,r[1],m[0],y[0]),v[3]&&o.drawLine(r[2],r[1]-.5*m[1]*i,r[2],r[3]+.5*m[3]*i,m[3],y[3]),v[2]&&o.drawLine(r[0]-.5*m[0]*i,r[3],r[2]+.5*m[2]*i,r[3],m[2],y[2]),s.bind();for(var p=0;2>p;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();for(var b=this.overlays,p=0;p<b.length;++p)b[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}}}(),f.drawPick=function(){return function(){var t=this.pickBuffer;this.gl;this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}}(),f.pick=function(){return function(t,e){var r=this.pixelRatio,n=this.pickPixelRatio,i=this.viewBox,a=0|Math.round((t-i[0]/r)*n),o=0|Math.round((e-i[1]/r)*n),s=this.pickBuffer.query(a,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),u=this.objects,c=0;c<u.length;++c){var h=u[c].pick(a,o,l);if(h)return h}return null}}(),f.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},f.setDataBox=function(t){var e=this.dataBox,r=e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3];r&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},f.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},f.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,o=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/o,10,10/o]),this.borderColor=(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=i(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=i(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=i(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!(\"titleEnable\"in t&&!t.titleEnable),this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=i(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=i(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=i(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var s=t.ticks||[[],[]],l=this._tickBounds;l[0]=l[1]=1/0,l[2]=l[3]=-(1/0);for(var u=0;2>u;++u){var c=s[u].slice(0);0!==c.length&&(c.sort(a),l[u]=Math.min(l[u],c[0].x),l[u+2]=Math.max(l[u+2],c[c.length-1].x))}this.grid.update({bounds:l,ticks:s}),this.text.update({bounds:l,ticks:s,labels:t.labels||[\"x\",\"y\"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||[\"sans-serif\",\"sans-serif\"],title:t.title||\"\",titleSize:t.titleSize||18,titleFont:t.titleFont||\"sans-serif\"}),this.setDirty()},f.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=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;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},f.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},f.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{\"./lib/box\":100,\"./lib/grid\":101,\"./lib/line\":102,\"./lib/text\":104,\"gl-select-static\":137}],107:[function(t,e,r){var n=t(\"gl-shader\"),i=\"#define GLSLIFY 1\\nprecision mediump float;\\nattribute vec2 position;\\nvarying vec2 uv;\\nvoid main() {\\n uv = position;\\n gl_Position = vec4(position, 0, 1);\\n}\",a=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform sampler2D accumBuffer;\\nvarying vec2 uv;\\n\\nvoid main() {\\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\\n gl_FragColor = min(vec4(1,1,1,1), accum);\\n}\";e.exports=function(t){return n(t,i,a,null,[{name:\"position\",type:\"vec2\"}])}},{\"gl-shader\":138}],108:[function(t,e,r){\"use strict\";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];\"distanceLimits\"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),\"zoomMin\"in e&&(r[0]=e.zoomMin),\"zoomMax\"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||\"orbit\",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay;n.idle(e-r),n.flush(e-(100+2*r));var a=e-2*r;n.recalcMatrix(a);for(var o=!0,s=n.computedMatrix,f=0;16>f;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){return n.setMode(t),n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener(\"contextmenu\",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s=1/t.clientHeight,l=s*(r-d),c=s*(a-p),h=f.flipX?1:-1,g=f.flipY?1:-1,v=Math.PI*f.rotateSpeed,m=i();if(1&e)o.shift?n.rotate(m,0,0,-l*v):n.rotate(m,h*v*l,-g*v*c,0);else if(2&e)n.pan(m,-f.translateSpeed*l*u,f.translateSpeed*c*u,0);else if(4&e){var y=f.zoomSpeed*c/window.innerHeight*(m-n.lastT())*50;n.pan(m,0,0,u*(Math.exp(y)-1))}d=r,p=a}),s(t,function(t,e,r){var a=f.flipX?1:-1,o=f.flipY?1:-1,s=i();if(Math.abs(t)>Math.abs(e))n.rotate(s,0,0,-t*a*Math.PI*f.rotateSpeed/window.innerWidth);else{var l=f.zoomSpeed*o*e/window.innerHeight*(s-n.lastT())/100;n.pan(s,0,0,u*(Math.exp(l)-1))}},!0),f}e.exports=n;var i=t(\"right-now\"),a=t(\"3d-view\"),o=t(\"mouse-change\"),s=t(\"mouse-wheel\")},{\"3d-view\":22,\"mouse-change\":173,\"mouse-wheel\":177,\"right-now\":191}],109:[function(t,e,r){!function(){\"use strict\";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,d.length)==d&&\"___\"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError(\"Not an object: \"+t);var e=t[p];if(e&&e.key===t)return e;if(!f(t))return void 0;e={key:t};try{return h(t,p,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(r){return void 0}}function i(t){return t.prototype=null,Object.freeze(t)}function a(){y||\"undefined\"==typeof console||(y=!0,console.warn(\"WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future.\"))}if(\"undefined\"==typeof ses||!ses.ok||ses.ok()){\"undefined\"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var o=!1;if(\"function\"==typeof WeakMap){var s=WeakMap;if(\"undefined\"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,u=Object.freeze({});if(l.set(u,1),1===l.get(u))return void(e.exports=WeakMap);o=!0}}var c=(Object.prototype.hasOwnProperty,\n",
"Object.getOwnPropertyNames),h=Object.defineProperty,f=Object.isExtensible,d=\"weakmap:\",p=d+\"ident:\"+Math.random()+\"___\";if(\"undefined\"!=typeof crypto&&\"function\"==typeof crypto.getRandomValues&&\"function\"==typeof ArrayBuffer&&\"function\"==typeof Uint8Array){var g=new ArrayBuffer(25),v=new Uint8Array(g);crypto.getRandomValues(v),p=d+\"rand:\"+Array.prototype.map.call(v,function(t){return(t%36).toString(36)}).join(\"\")+\"___\"}if(h(Object,\"getOwnPropertyNames\",{value:function(t){return c(t).filter(r)}}),\"getPropertyNames\"in Object){var m=Object.getPropertyNames;h(Object,\"getPropertyNames\",{value:function(t){return m(t).filter(r)}})}!function(){var t=Object.freeze;h(Object,\"freeze\",{value:function(e){return n(e),t(e)}});var e=Object.seal;h(Object,\"seal\",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;h(Object,\"preventExtensions\",{value:function(t){return n(t),r(t)}})}();var y=!1,b=0,x=function(){function t(t,e){var r,i=n(t);return i?u in i?i[u]:e:(r=s.indexOf(t),r>=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>e?!1:(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):!1)}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)}}()},{}],110:[function(t,e,r){\"use strict\";function n(t){var e=s.get(t);if(!e||!t.isBuffer(e._triangleBuffer.buffer)){var r=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:r,type:t.FLOAT,size:2}]),e._triangleBuffer=r,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\":59,\"gl-vao\":166,\"weak-map\":109}],111:[function(t,e,r){\"use strict\";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=[\"sans-serif\",\"sans-serif\",\"sans-serif\"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=[\"x\",\"y\",\"z\"],this.labelEnable=[!0,!0,!0],this.labelFont=\"sans-serif\",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=c(t)}function a(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function o(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;3>c;++c)if(e!==c){var h=a,f=s,d=o,p=l;u&1<<c&&(h=s,f=a,d=l,p=o),h[c]=r[0][c],f[c]=r[1][c],i[c]>0?(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;3>s;++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;2>d;++d)for(var p=0;3>p;++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;3>d;++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;3>d;++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 g=a(\"labels\");a(\"labelFont\")&&(g=!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&&(g||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 g=[new a,new a,new a],v=[0,0,0],m={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||m;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],k=this.pixelRatio*(a[3]*f+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,A=0;3>A;++A)this.lastCubeProps.cubeEdges[A]=u[A],this.lastCubeProps.axis[A]=c[A];for(var M=g,A=0;3>A;++A)o(g[A],A,this.bounds,u,c);for(var e=this.gl,L=v,A=0;3>A;++A)this.backgroundEnable[A]?L[A]=c[A]:L[A]=0;this._background.draw(r,i,a,s,L,this.backgroundColor),this._lines.bind(r,i,a,this);for(var A=0;3>A;++A){var T=[0,0,0];c[A]>0?T[A]=s[1][A]:T[A]=s[0][A];for(var E=0;2>E;++E){var C=(A+1+E)%3,S=(A+1+(1^E))%3;this.gridEnable[C]&&this._lines.drawGrid(C,S,this.bounds,T,this.gridColor[C],this.gridWidth[C]*this.pixelRatio)}for(var E=0;2>E;++E){var C=(A+1+E)%3,S=(A+1+(1^E))%3;this.zeroEnable[S]&&s[0][S]<=0&&s[1][S]>=0&&this._lines.drawZero(C,S,this.bounds,T,this.zeroLineColor[S],this.zeroLineWidth[S]*this.pixelRatio)}}for(var A=0;3>A;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);for(var z=n(y,M[A].primalMinor),P=n(b,M[A].mirrorMinor),j=this.lineTickLength,E=0;3>E;++E){var O=k/r[5*E];z[E]*=j[E]*O,P[E]*=j[E]*O}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,P,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var A=0;3>A;++A){for(var I=M[A].primalMinor,D=n(x,M[A].primalOffset),E=0;3>E;++E)this.lineTickEnable[A]&&(D[E]+=k*I[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[A]){for(var E=0;3>E;++E)D[E]+=k*I[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],D,this.tickColor[A])}if(this.labelEnable[A]){for(var E=0;3>E;++E)D[E]+=k*I[E]*this.labelPad[E]/r[5*E];D[A]+=.5*(s[0][A]+s[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],D,this.labelColor[A])}}},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\":112,\"./lib/cube.js\":113,\"./lib/lines.js\":114,\"./lib/text.js\":116,\"./lib/ticks.js\":117}],112:[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;3>l;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;1>=d;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;1>=p;p+=2){h[u]=p;for(var g=-1;1>=g;g+=2)h[c]=g,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),i+=1}var v=u;u=c,c=v}var m=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,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,m,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;3>s;++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\":115,\"gl-buffer\":59,\"gl-vao\":166}],113:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=0;4>n;++n){t[n]=r[12+n];for(var i=0;3>i;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;e<g.length;++e)if(t=l.positive(t,g[e]),t.length<3)return 0;for(var r=t[0],n=r[0]/r[3],i=r[1]/r[3],a=0,e=1;e+1<t.length;++e){var o=t[e],s=t[e+1],u=o[0]/o[3],c=o[1]/o[3],h=s[0]/s[3],f=s[1]/s[3],d=u-n,p=c-i,v=h-n,m=f-i;a+=Math.abs(d*m-p*v)}return a}function a(t,e,r,a){s(c,e,t),s(c,r,c);for(var l=0,g=0;2>g;++g){d[2]=a[g][2];for(var b=0;2>b;++b){d[1]=a[b][1];for(var x=0;2>x;++x)d[0]=a[x][0],n(h[l],d,c),l+=1}}for(var _=-1,g=0;8>g;++g){for(var w=h[g][3],k=0;3>k;++k)f[g][k]=h[g][k]/w;0>w&&(0>_?_=g:f[g][2]<f[_][2]&&(_=g))}if(0>_){_=0;for(var A=0;3>A;++A){for(var M=(A+2)%3,L=(A+1)%3,T=-1,E=-1,C=0;2>C;++C){var S=C<<A,z=S+(C<<M)+(1-C<<L),P=S+(1-C<<M)+(C<<L);u(f[S],f[z],f[P],p)<0||(C?T=1:E=1)}if(0>T||0>E)E>T&&(_|=1<<A);else{for(var C=0;2>C;++C){var S=C<<A,z=S+(C<<M)+(1-C<<L),P=S+(1-C<<M)+(C<<L),j=i([h[S],h[z],h[P],h[S+(1<<M)+(1<<L)]]);C?T=j:E=j}E>T&&(_|=1<<A)}}}for(var O=7^_,I=-1,g=0;8>g;++g)g!==_&&g!==O&&(0>I?I=g:f[I][1]>f[g][1]&&(I=g));for(var D=-1,g=0;3>g;++g){var R=I^1<<g;if(R!==_&&R!==O){0>D&&(D=R);var L=f[R];L[0]<f[D][0]&&(D=R)}}for(var F=-1,g=0;3>g;++g){var R=I^1<<g;if(R!==_&&R!==O&&R!==D){0>F&&(F=R);var L=f[R];L[0]>f[F][0]&&(F=R)}}var N=v;N[0]=N[1]=N[2]=0,N[o.log2(D^I)]=I&D,N[o.log2(I^F)]=I&F;var B=7^F;B===_||B===O?(B=7^D,N[o.log2(F^B)]=B&F):N[o.log2(D^B)]=B&D;for(var U=m,V=_,A=0;3>A;++A)V&1<<A?U[A]=-1:U[A]=1;return y}e.exports=a;var o=t(\"bit-twiddle\"),s=t(\"gl-mat4/multiply\"),l=(t(\"gl-mat4/invert\"),t(\"split-polygon\")),u=t(\"robust-orientation\"),c=new Array(16),h=(new Array(16),new Array(8)),f=new Array(8),d=new Array(3),p=[0,0,0];!function(){for(var t=0;8>t;++t)h[t]=[1,1,1,1],f[t]=[1,1,1]}();var g=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],v=[1,1,1],m=[0,0,0],y={cubeEdges:v,axis:m}},{\"bit-twiddle\":33,\"gl-mat4/invert\":78,\"gl-mat4/multiply\":80,\"robust-orientation\":195,\"split-polygon\":119}],114:[function(t,e,r){\"use strict\";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}function o(t,e,r){var n=[],i=[0,0,0],o=[0,0,0],c=[0,0,0],h=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;3>f;++f){for(var d=n.length/3|0,p=0;p<r[f].length;++p){var g=+r[f][p].x;n.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}var v=n.length/3|0;i[f]=d,o[f]=v-d;for(var d=n.length/3|0,m=0;m<r[f].length;++m){var g=+r[f][m].x;n.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}var v=n.length/3|0;c[f]=d,h[f]=v-d}var y=s(t,new Float32Array(n)),b=l(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),x=u(t);return x.attributes.position.location=0,new a(t,y,b,x,o,i,h,c)}e.exports=o;var s=t(\"gl-buffer\"),l=t(\"gl-vao\"),u=t(\"./shaders\").line,c=[0,0,0],h=[0,0,0],f=[0,0,0],d=[0,0,0],p=[1,1],g=a.prototype;g.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=p,this.vao.bind()},g.drawAxisLine=function(t,e,r,a,o){var s=n(h);this.shader.uniforms.majorAxis=h,s[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=s;var l=i(d,r);l[t]+=e[0][t],this.shader.uniforms.offset=l,this.shader.uniforms.lineWidth=o,this.shader.uniforms.color=a;var u=n(f);u[(t+2)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6);var u=n(f);u[(t+1)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6)},g.drawAxisTicks=function(t,e,r,i,a){var o=n(c);o[t]=1,this.shader.uniforms.majorAxis=o,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=i,this.shader.uniforms.lineWidth=a;var s=n(f);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])},g.drawGrid=function(t,e,r,a,o,s){var l=n(h);l[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[e]+=r[0][e],this.shader.uniforms.offset=u;var p=n(c);p[t]=1,this.shader.uniforms.majorAxis=p;var g=n(f);g[t]=1,this.shader.uniforms.screenAxis=g,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])},g.drawZero=function(t,e,r,a,o,s){var l=n(h);this.shader.uniforms.majorAxis=l,l[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[t]+=r[0][t],this.shader.uniforms.offset=u;var c=n(f);c[e]=1,this.shader.uniforms.screenAxis=c,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,6)},g.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{\"./shaders\":115,\"gl-buffer\":59,\"gl-vao\":166}],115:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=\"#define GLSLIFY 1\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\\nuniform float lineWidth;\\nuniform vec2 screenShape;\\n\\nvec3 project(vec3 p) {\\n vec4 pp = projection * view * model * vec4(p, 1.0);\\n return pp.xyz / max(pp.w, 0.0001);\\n}\\n\\nvoid main() {\\n vec3 major = position.x * majorAxis;\\n vec3 minor = position.y * minorAxis;\\n\\n vec3 vPosition = major + minor + offset;\\n vec3 pPosition = project(vPosition);\\n vec3 offset = project(vPosition + screenAxis * position.z);\\n\\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\\n\\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\\n}\\n\",a=\"#define GLSLIFY 1\\nprecision mediump float;\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\";r.line=function(t){return n(t,i,a,null,[{name:\"position\",type:\"vec3\"}])};var o=\"#define GLSLIFY 1\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 offset, axis;\\nuniform float scale, angle, pixelScale;\\nuniform vec2 resolution;\\n\\nvoid main() { \\n //Compute plane offset\\n vec2 planeCoord = position.xy * pixelScale;\\n mat2 planeXform = scale * mat2(cos(angle), sin(angle),\\n -sin(angle), cos(angle));\\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\\n\\n //Compute world offset\\n float axisDistance = position.z;\\n vec3 dataPosition = axisDistance * axis + offset;\\n vec4 worldPosition = model * vec4(dataPosition, 1);\\n \\n //Compute clip position\\n vec4 viewPosition = view * worldPosition;\\n vec4 clipPosition = projection * viewPosition;\\n clipPosition /= clipPosition.w;\\n\\n //Apply text offset in clip coordinates\\n clipPosition += vec4(viewOffset, 0, 0);\\n\\n //Done\\n gl_Position = clipPosition;\\n}\",s=\"#define GLSLIFY 1\\nprecision mediump float;\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\";r.text=function(t){return n(t,o,s,null,[{name:\"position\",type:\"vec3\"}])};var l=\"#define GLSLIFY 1\\nattribute vec3 position;\\nattribute vec3 normal;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 enable;\\nuniform vec3 bounds[2];\\n\\nvarying vec3 colorChannel;\\n\\nvoid main() {\\n if(dot(normal, enable) > 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}\",u=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\";r.bg=function(t){return n(t,l,u,null,[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}])}},{\"gl-shader\":138}],116:[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(r){return console.warn(\"error vectorizing text:\",r),{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=3,d=n.prototype,p=[0,0];d.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,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=p},d.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;d>f;++f)for(var p=c[f],g=2;g>=0;--g){var v=u[p[g]];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],d=[0,0,0],p=0;3>p;++p){c[p]=s.length/f|0,o(.5*(t[0][p]+t[1][p]),e[p],r),d[p]=(s.length/f|0)-c[p],l[p]=s.length/f|0;for(var g=0;g<n[p].length;++g)n[p][g].text&&o(n[p][g].x,n[p][g].text,n[p][g].font||a,n[p][g].fontSize||12);u[p]=(s.length/f|0)-l[p]}this.buffer.update(s),this.tickOffset=l,this.tickCount=u,this.labelOffset=c,this.labelCount=d};var g=[0,0,0];d.drawTicks=function(t,e,r,n,i){var a=g;a[0]=a[1]=a[2]=0,a[t]=1,this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])};var v=[0,0,0];d.drawLabel=function(t,e,r,n,i){this.shader.uniforms.axis=v,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t])},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t(\"_process\"))},{\"./shaders\":115,_process:38,\"gl-buffer\":59,\"gl-vao\":166,\"vectorize-text\":219}],117:[function(t,e,r){\"use strict\";function n(t,e){var r=t+\"\",n=r.indexOf(\".\"),i=0;n>=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;0>o?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u=0|u);var c=\"\"+l;if(0>o&&(c=\"-\"+c),i){for(var h=\"\"+u;h.length<i;)h=\"0\"+h;return c+\".\"+h}return c}function i(t,e){for(var r=[],i=0;3>i;++i){for(var a=[],o=(.5*(t[0][i]+t[1][i]),0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:n(e[i],o)});for(var o=-1;o*e[i]>=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;3>r;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text)return!1}}return!0}r.create=i,r.equal=a},{}],118:[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},{}],119:[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;0>a?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;s>u;++u)l[u]=a*t[u]+o*r[u];return l}function a(t,e){for(var r=[],a=[],o=n(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){l=t[u];var c=n(l,e);if(0>o&&c>0||o>0&&0>c){var h=i(s,c,l,o);r.push(h),a.push(h.slice())}0>c?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;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(0>a&&u>0||a>0&&0>u)&&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;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(0>a&&u>0||a>0&&0>u)&&r.push(i(o,u,s,a)),0>=u&&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\":120,\"robust-sum\":198}],120:[function(t,e,r){\"use strict\";function n(t,e){for(var r=i(t[0],e[0]),n=1;n<t.length;++n)r=a(r,i(t[n],e[n]));return r}var i=t(\"two-product\"),a=t(\"robust-sum\");e.exports=n},{\"robust-sum\":198,\"two-product\":215}],121:[function(t,e,r){\"use strict\";function n(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}function i(t,e,r,n,i){for(var a=0;3>a;++a){for(var o=p,s=g,l=0;3>l;++l)s[l]=o[l]=r[l];s[3]=o[3]=1,s[a]+=1,h(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,h(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,c=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+c*c)}return t}function a(t,e,r,n,a){var h=e.model||f,p=e.view||f,g=e.projection||f,y=t.bounds,a=a||l(h,p,g,y),b=a.axis;a.edges;u(d,p,h),u(d,g,d);for(var x=v,_=0;3>_;++_)x[_].lo=1/0,x[_].hi=-(1/0),x[_].pixelsPerDataUnit=1/0;var w=o(c(d,d));c(d,d);for(var k=0;3>k;++k){var A=(k+1)%3,M=(k+2)%3,L=m;t:for(var _=0;2>_;++_){var T=[];if(b[k]<0!=!!_){L[k]=y[_][k];for(var E=0;2>E;++E){L[A]=y[E^_][A];for(var C=0;2>C;++C)L[M]=y[C^E^_][M],T.push(L.slice())}for(var E=0;E<w.length;++E){if(0===T.length)continue t;T=s.positive(T,w[E])}for(var E=0;E<T.length;++E)for(var M=T[E],S=i(m,d,M,r,n),C=0;3>C;++C)x[C].lo=Math.min(x[C].lo,M[C]),x[C].hi=Math.max(x[C].hi,M[C]),C!==k&&(x[C].pixelsPerDataUnit=Math.min(x[C].pixelsPerDataUnit,Math.abs(S[C])))}}}return x}e.exports=a;var o=t(\"extract-frustum-planes\"),s=t(\"split-polygon\"),l=t(\"./lib/cube.js\"),u=t(\"gl-mat4/multiply\"),c=t(\"gl-mat4/transpose\"),h=t(\"gl-vec4/transformMat4\"),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=new Float32Array(16),p=[0,0,0,1],g=[0,0,0,1],v=[new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0)],m=[0,0,0]},{\"./lib/cube.js\":113,\"extract-frustum-planes\":118,\"gl-mat4/multiply\":80,\"gl-mat4/transpose\":88,\"gl-vec4/transformMat4\":167,\"split-polygon\":119}],122:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=\"#define GLSLIFY 1\\nprecision mediump float;\\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\",a=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n gl_FragColor = fragColor;\\n}\";e.exports=function(t){return n(t,i,a,null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec3\"},{name:\"weight\",type:\"float\"}])}},{\"gl-shader\":138}],123:[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;3>p;++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;3>p;++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\":122,\"gl-buffer\":59,\"gl-vao\":166}],124:[function(t,e,r){\"use strict\";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{r=t.getContext(\"webgl\",e),r||(r=t.getContext(\"experimental-webgl\",e))}catch(n){return null}return r}function a(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(0>e){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){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:!0}function s(t){function e(){if(!_&&H.autoResize){var t=w.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*H.pixelRatio),i=0|Math.ceil(r*H.pixelRatio);if(n!==w.width||i!==w.height){w.width=n,w.height=i;var a=w.style;a.position=a.position||\"absolute\",a.left=\"0px\",a.top=\"0px\",a.width=e+\"px\",a.height=r+\"px\",F=!0}}}function r(){for(var t=O.length,e=R.length,r=0;e>r;++r)D[r]=0;t:for(var r=0;t>r;++r){var n=O[r],i=n.pickSlots;if(i){for(var a=0;e>a;++a)if(D[a]+i<255){I[r]=a,n.setPickBase(D[a]+1),D[a]+=i;continue t}var o=f(A,q);I[r]=e,R.push(o),D.push(i),n.setPickBase(1),e+=1}else I[r]=-1}for(;e>0&&0===D[e-1];)D.pop(),R.pop().dispose()}function s(){return H.contextLost?!0:void(A.isContextLost()&&(H.contextLost=!0,H.mouseListener.enabled=!1,H.selection.object=null,H.oncontextloss&&H.oncontextloss()))}function y(){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=R.length,r=0;e>r;++r){var n=R[r];n.shape=G,n.begin();for(var i=0;t>i;++i)if(I[i]===r){var a=O[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(V))}n.end()}}}function b(){if(!s()){e();var t=H.camera.tick();V.view=H.camera.matrix,F=F||t,N=N||t,z.pixelRatio=H.pixelRatio,j.pixelRatio=H.pixelRatio;var r=O.length,n=X[0],i=X[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-(1/0);for(var o=0;r>o;++o){var l=O[o];l.pixelRatio=H.pixelRatio,l.axes=H.axes,F=F||!!l.dirty,N=N||!!l.dirty;var u=l.bounds;if(u)for(var h=u[0],f=u[1],d=0;3>d;++d)n[d]=Math.min(n[d],h[d]),i[d]=Math.max(i[d],f[d])}var g=H.bounds;if(H.autoBounds)for(var d=0;3>d;++d){if(i[d]<n[d])n[d]=-1,i[d]=1;else{n[d]===i[d]&&(n[d]-=1,i[d]+=1);var m=.05*(i[d]-n[d]);n[d]=n[d]-m,i[d]=i[d]+m}g[0][d]=n[d],g[1][d]=i[d]}for(var b=!1,d=0;3>d;++d)b=b||Z[0][d]!==g[0][d]||Z[1][d]!==g[1][d],Z[0][d]=g[0][d],Z[1][d]=g[1][d];if(b){for(var x=[0,0,0],o=0;3>o;++o)x[o]=a((g[1][o]-g[0][o])/10);z.autoTicks?z.update({bounds:g,tickSpacing:x}):z.update({bounds:g})}N=N||b,F=F||b;var _=A.drawingBufferWidth,w=A.drawingBufferHeight;q[0]=_,q[1]=w,G[0]=0|Math.max(_/H.pixelRatio,1),G[1]=0|Math.max(w/H.pixelRatio,1),v(B,H.fovy,_/w,H.zNear,H.zFar);for(var o=0;16>o;++o)U[o]=0;U[15]=1;for(var k=0,o=0;3>o;++o)k=Math.max(k,g[1][o]-g[0][o]);for(var o=0;3>o;++o)H.autoScale?U[5*o]=H.aspect[o]/(g[1][o]-g[0][o]):U[5*o]=1/k,H.autoCenter&&(U[12+o]=.5*-U[5*o]*(g[0][o]+g[1][o]));for(var o=0;r>o;++o){var l=O[o];l.axesBounds=g,H.clipToBounds&&(l.clipBounds=g)}if(L.object&&(H.snapToData?j.position=L.dataCoordinate:j.position=L.dataPosition,j.bounds=g),N&&(N=!1,y()),F){H.axesPixels=c(H.axes,V,_,w),H.onrender&&H.onrender(),A.bindFramebuffer(A.FRAMEBUFFER,null),A.viewport(0,0,_,w);var M=H.clearColor;A.clearColor(M[0],M[1],M[2],M[3]),\n",
"A.clear(A.COLOR_BUFFER_BIT|A.DEPTH_BUFFER_BIT),A.depthMask(!0),A.colorMask(!0,!0,!0,!0),A.enable(A.DEPTH_TEST),A.depthFunc(A.LEQUAL),A.disable(A.BLEND),A.disable(A.CULL_FACE);var C=!1;z.enable&&(C=C||z.isTransparent(),z.draw(V)),j.axes=z,L.object&&j.draw(V),A.disable(A.CULL_FACE);for(var o=0;r>o;++o){var l=O[o];l.axes=z,l.pixelRatio=H.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(V),l.isTransparent&&l.isTransparent()&&(C=!0)}if(C){T.shape=q,T.bind(),A.clear(A.DEPTH_BUFFER_BIT),A.colorMask(!1,!1,!1,!1),A.depthMask(!0),A.depthFunc(A.LESS),z.enable&&z.isTransparent()&&z.drawTransparent(V);for(var o=0;r>o;++o){var l=O[o];l.isOpaque&&l.isOpaque()&&l.draw(V)}A.enable(A.BLEND),A.blendEquation(A.FUNC_ADD),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.colorMask(!0,!0,!0,!0),A.depthMask(!1),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),z.isTransparent()&&z.drawTransparent(V);for(var o=0;r>o;++o){var l=O[o];l.isTransparent&&l.isTransparent()&&l.drawTransparent(V)}A.bindFramebuffer(A.FRAMEBUFFER,null),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.disable(A.DEPTH_TEST),E.bind(),T.color[0].bind(0),E.uniforms.accumBuffer=0,p(A),A.disable(A.BLEND)}F=!1;for(var o=0;r>o;++o)O[o].dirty=!1}}}function x(){_||H.contextLost||(requestAnimationFrame(x),b())}t=t||{};var _=!1,w=(t.pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!w)if(w=document.createElement(\"canvas\"),t.container){var k=t.container;k.appendChild(w)}else document.body.appendChild(w);var A=t.gl;if(A||(A=i(w,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!A)throw new Error(\"webgl not supported\");var M=t.bounds||[[-10,-10,-10],[10,10,10]],L=new n,T=d(A,[A.drawingBufferWidth,A.drawingBufferHeight],{preferFloat:!0}),E=m(A),C=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:\"turntable\"},S=t.axes||{},z=u(A,S);z.enable=!S.disable;var P=t.spikes||{},j=h(A,P),O=[],I=[],D=[],R=[],F=!0,N=!0,B=new Array(16),U=new Array(16),V={view:null,projection:B,model:U},N=!0,q=[A.drawingBufferWidth,A.drawingBufferHeight],H={gl:A,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:w,selection:L,camera:l(w,C),axes:z,axesPixels:null,spikes:j,bounds:M,objects:O,shape:q,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:o(t.autoResize),autoBounds:o(t.autoBounds),autoScale:!!t.autoScale,autoCenter:o(t.autoCenter),clipToBounds:o(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null},G=[A.drawingBufferWidth/H.pixelRatio|0,A.drawingBufferHeight/H.pixelRatio|0];H.autoResize&&e(),window.addEventListener(\"resize\",e),H.update=function(t){_||(t=t||{},F=!0,N=!0)},H.add=function(t){_||(t.axes=z,O.push(t),I.push(-1),F=!0,N=!0,r())},H.remove=function(t){if(!_){var e=O.indexOf(t);0>e||(O.splice(e,1),I.pop(),F=!0,N=!0,r())}},H.dispose=function(){if(!_&&(_=!0,window.removeEventListener(\"resize\",e),w.removeEventListener(\"webglcontextlost\",s),H.mouseListener.enabled=!1,!H.contextLost)){z.dispose(),j.dispose();for(var t=0;t<O.length;++t)O[t].dispose();T.dispose();for(var t=0;t<R.length;++t)R[t].dispose();E.dispose(),A=null,z=null,j=null,O=[]}};var Y=!1,W=0;H.mouseListener=g(w,function(t,e,r){if(!_){var n=R.length,i=O.length,a=L.object;L.distance=1/0,L.mouse[0]=e,L.mouse[1]=r,L.object=null,L.screen=null,L.dataCoordinate=L.dataPosition=null;var o=!1;if(t)Y=!0;else{Y&&(N=!0),Y=!1;for(var s=0;n>s;++s){var l=R[s].query(e,G[1]-r-1,H.pickRadius);if(l){if(l.distance>L.distance)continue;for(var u=0;i>u;++u){var c=O[u];if(I[u]===s){var h=c.pick(l);h&&(L.screen=l.coord,L.distance=l.distance,L.object=c,L.index=h.distance,L.dataPosition=h.position,L.dataCoordinate=h.dataCoordinate,L.data=h,o=!0)}}}}}a&&a!==L.object&&(a.highlight&&a.highlight(null),F=!0),L.object&&(L.object.highlight&&L.object.highlight(L.data),F=!0),o=o||L.object!==a,o&&H.onselect&&H.onselect(L),1&t&&!(1&W)&&H.onclick&&H.onclick(L),W=t}}),w.addEventListener(\"webglcontextlost\",s);var X=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],Z=[X[0].slice(),X[1].slice()];return x(),H.redraw=function(){_||(F=!0,b())},H}e.exports=s;var l=t(\"3d-view-controls\"),u=t(\"gl-axes3d\"),c=t(\"gl-axes3d/properties\"),h=t(\"gl-spikes3d\"),f=t(\"gl-select-static\"),d=t(\"gl-fbo\"),p=t(\"a-big-triangle\"),g=t(\"mouse-change\"),v=t(\"gl-mat4/perspective\"),m=t(\"./lib/shader\")},{\"./lib/shader\":107,\"3d-view-controls\":108,\"a-big-triangle\":110,\"gl-axes3d\":111,\"gl-axes3d/properties\":121,\"gl-fbo\":64,\"gl-mat4/perspective\":81,\"gl-select-static\":137,\"gl-spikes3d\":123,\"mouse-change\":173}],125:[function(t,e,r){\"use strict\";e.exports={vertex:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 position;\\nattribute vec2 offset;\\nattribute vec4 color;\\n\\nuniform mat3 viewTransform;\\nuniform vec2 pixelScale;\\n\\nvarying vec4 fragColor;\\n\\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\\n vec3 xposition = view * vec3(position, 1.0);\\n return vec4(\\n xposition.xy + scale * offset * xposition.z,\\n 0,\\n xposition.z);\\n}\\n\\n\\n\\n\\nvoid main() {\\n fragColor = color;\\n\\n gl_Position = computePosition_1_0(\\n position,\\n offset,\\n viewTransform,\\n pixelScale);\\n}\\n\",fragment:\"#define GLSLIFY 1\\nprecision lowp float;\\nvarying vec4 fragColor;\\nvoid main() {\\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\\n}\\n\",pickVertex:\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 position;\\nattribute vec2 offset;\\nattribute vec4 id;\\n\\nuniform mat3 viewTransform;\\nuniform vec2 pixelScale;\\nuniform vec4 pickOffset;\\n\\nvarying vec4 fragColor;\\n\\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\\n vec3 xposition = view * vec3(position, 1.0);\\n return vec4(\\n xposition.xy + scale * offset * xposition.z,\\n 0,\\n xposition.z);\\n}\\n\\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_Position = computePosition_1_0(\\n position,\\n offset,\\n viewTransform,\\n pixelScale);\\n}\\n\",pickFragment:\"#define GLSLIFY 1\\nprecision lowp float;\\nvarying vec4 fragColor;\\nvoid main() {\\n gl_FragColor = fragColor;\\n}\\n\"}},{}],126:[function(t,e,r){\"use strict\";function n(t){if(t in f)return f[t];var e=c(t,{polygons:!0,font:\"sans-serif\",textAlign:\"left\",textBaseline:\"alphabetic\"}),r=[],n=[];e.forEach(function(t){t.forEach(function(t){for(var e=0;e<t.length;++e){var i=t[(e+t.length-1)%t.length],a=t[e],o=t[(e+1)%t.length],s=t[(e+2)%t.length],l=a[0]-i[0],u=a[1]-i[1],c=Math.sqrt(l*l+u*u);l/=c,u/=c,r.push(i[0],i[1]+1.4),n.push(u,-l),r.push(i[0],i[1]+1.4),n.push(-u,l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(i[0],i[1]+1.4),n.push(u,-l),r.push(a[0],a[1]+1.4),n.push(u,-l);var h=s[0]-o[0],f=s[1]-o[1],d=Math.sqrt(h*h+f*f);h/=d,f/=d,r.push(a[0],a[1]+1.4),n.push(u,-l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(o[0],o[1]+1.4),n.push(-f,h),r.push(o[0],o[1]+1.4),n.push(-f,h),r.push(a[0],a[1]+1.4),n.push(f,-h),r.push(o[0],o[1]+1.4),n.push(f,-h)}})});for(var i=[1/0,1/0,-(1/0),-(1/0)],a=0;a<r.length;a+=2)for(var o=0;2>o;++o)i[o]=Math.min(i[o],r[a+o]),i[2+o]=Math.max(i[2+o],r[a+o]);return f[t]={coords:r,normals:n,bounds:i}}function i(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.offsetBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.numVertices=0,this.pickOffset=0,this.points=null}function a(t,e){var r=t.gl,n=o(r,h.vertex,h.fragment),a=o(r,h.pickVertex,h.pickFragment),l=s(r),u=s(r),c=s(r),f=s(r),d=new i(t,n,a,l,u,c,f);return d.update(e),t.addObject(d),d}e.exports=a;var o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"text-cache\"),u=t(\"typedarray-pool\"),c=t(\"vectorize-text\"),h=t(\"./lib/shaders\"),f={},d=i.prototype;!function(){function t(){var t=this.plot,n=this.bounds,i=t.viewBox,a=t.dataBox,o=t.pixelRatio,s=n[2]-n[0],l=n[3]-n[1],u=a[2]-a[0],c=a[3]-a[1];e[0]=2*s/u,e[4]=2*l/c,e[6]=2*(n[0]-a[0])/u-1,e[7]=2*(n[1]-a[1])/c-1;var h=i[2]-i[0],f=i[3]-i[1];r[0]=2*o/h,r[1]=2*o/f}var e=[1,0,0,0,1,0,0,0,1],r=[1,1];d.draw=function(){var n=this.plot,i=this.shader,a=this.numVertices,o=n.gl;t.call(this),i.bind(),i.uniforms.pixelScale=r,i.uniforms.viewTransform=e,this.positionBuffer.bind(),i.attributes.position.pointer(),this.offsetBuffer.bind(),i.attributes.offset.pointer(),this.colorBuffer.bind(),i.attributes.color.pointer(o.UNSIGNED_BYTE,!0),o.drawArrays(o.TRIANGLES,0,a)};var n=[0,0,0,0];d.drawPick=function(i){var a=this.plot,o=this.pickShader,s=this.numVertices,l=a.gl;this.pickOffset=i;for(var u=0;4>u;++u)n[u]=i>>8*u&255;return t.call(this),o.bind(),o.uniforms.pixelScale=r,o.uniforms.viewTransform=e,o.uniforms.pickOffset=n,this.positionBuffer.bind(),o.attributes.position.pointer(),this.offsetBuffer.bind(),o.attributes.offset.pointer(),this.idBuffer.bind(),o.attributes.id.pointer(l.UNSIGNED_BYTE,!1),l.drawArrays(l.TRIANGLES,0,s),i+this.numPoints}}(),d.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(n>r||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]]}},d.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],i=t.glyphs||[],a=t.sizes||[],o=t.borderWidths||[],s=t.borderColors||[];this.points=e;for(var c=this.bounds=[1/0,1/0,-(1/0),-(1/0)],h=0,f=0;f<i.length;++f){h+=l(\"sans-serif\",i[f]).data.length+n(i[f]).coords.length>>1;for(var d=0;2>d;++d)c[d]=Math.min(c[d],e[2*f+d]),c[2+d]=Math.max(c[2+d],e[2*f+d])}c[0]===c[2]&&(c[2]+=1),c[3]===c[1]&&(c[3]+=1);for(var p=1/(c[2]-c[0]),g=1/(c[3]-c[1]),v=c[0],m=c[1],y=u.mallocFloat32(2*h),b=u.mallocFloat32(2*h),x=u.mallocUint8(4*h),_=u.mallocUint32(h),w=0,f=0;f<i.length;++f){for(var k=l(\"sans-serif\",i[f]),A=n(i[f]),M=p*(e[2*f]-v),L=g*(e[2*f+1]-m),T=a[f],E=255*r[4*f],C=255*r[4*f+1],S=255*r[4*f+2],z=255*r[4*f+3],P=.5*(A.bounds[0]+A.bounds[2]),j=.5*(A.bounds[1]+A.bounds[3]),d=0;d<k.data.length;d+=2)y[2*w]=M,y[2*w+1]=L,b[2*w]=-T*(k.data[d]-P),b[2*w+1]=-T*(k.data[d+1]-j),x[4*w]=E,x[4*w+1]=C,x[4*w+2]=S,x[4*w+3]=z,_[w]=f,w+=1;var O=o[f];E=255*s[4*f],C=255*s[4*f+1],S=255*s[4*f+2],z=255*s[4*f+3];for(var d=0;d<A.coords.length;d+=2)y[2*w]=M,y[2*w+1]=L,b[2*w]=-(T*(A.coords[d]-P)+O*A.normals[d]),b[2*w+1]=-(T*(A.coords[d+1]-j)+O*A.normals[d+1]),x[4*w]=E,x[4*w+1]=C,x[4*w+2]=S,x[4*w+3]=z,_[w]=f,w+=1}this.numPoints=i.length,this.numVertices=h,this.positionBuffer.update(y),this.offsetBuffer.update(b),this.colorBuffer.update(x),this.idBuffer.update(_),u.free(y),u.free(b),u.free(x),u.free(_)},d.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.offsetBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{\"./lib/shaders\":125,\"gl-buffer\":59,\"gl-shader\":138,\"text-cache\":212,\"typedarray-pool\":217,\"vectorize-text\":219}],127:[function(t,e,r){r.pointVertex=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 position;\\nattribute float weight;\\n\\nuniform mat3 matrix;\\nuniform float pointSize, useWeight;\\n\\nvarying float fragWeight;\\n\\nvoid main() {\\n vec3 hgPosition = matrix * vec3(position, 1);\\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\\n gl_PointSize = pointSize;\\n fragWeight = mix(1.0, weight, useWeight);\\n}\\n\",r.pointFragment=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec4 color, borderColor;\\nuniform float centerFraction;\\n\\nvarying float fragWeight;\\n\\nfloat smoothStep(float x, float y) {\\n return 1.0 / (1.0 + exp(50.0*(x - y)));\\n}\\n\\nvoid main() {\\n float radius = length(2.0*gl_PointCoord.xy-1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\\n float alpha = 1.0 - pow(1.0 - baseColor.a, fragWeight);\\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\\n}\\n\",r.pickVertex=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform vec4 pickOffset;\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n vec3 hgPosition = matrix * vec3(position, 1);\\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\\n gl_PointSize = pointSize;\\n\\n vec4 id = pickId + pickOffset;\\n id.y += floor(id.x / 256.0);\\n id.x -= floor(id.x / 256.0) * 256.0;\\n\\n id.z += floor(id.y / 256.0);\\n id.y -= floor(id.y / 256.0) * 256.0;\\n\\n id.w += floor(id.z / 256.0);\\n id.z -= floor(id.z / 256.0) * 256.0;\\n\\n fragId = id;\\n}\\n\",r.pickFragment=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n float radius = length(2.0*gl_PointCoord.xy-1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n gl_FragColor = fragId / 255.0;\\n}\\n\"},{}],128:[function(t,e,r){arguments[4][105][0].apply(r,arguments)},{dup:105}],129:[function(t,e,r){\"use strict\";function n(t,e,r,n,a){4*f>=a?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;e>=o;++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 g=(e-t+1)/6|0,v=t+g,m=e-g,y=t+e>>1,b=y-g,x=y+g,_=v,w=b,k=y,A=x,M=m,L=t+1,T=e-1,E=0;u(_,w,r,n,d,p)&&(E=_,_=w,w=E),u(A,M,r,n,d,p)&&(E=A,A=M,M=E),u(_,k,r,n,d,p)&&(E=_,_=k,k=E),u(w,k,r,n,d,p)&&(E=w,w=k,k=E),u(_,A,r,n,d,p)&&(E=_,_=A,A=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(w,k,r,n,d,p)&&(E=w,w=k,k=E),u(A,M,r,n,d,p)&&(E=A,A=M,M=E);var C=r[w],S=n[2*w],z=n[2*w+1],P=d[w],j=p[w],O=r[A],I=n[2*A],D=n[2*A+1],R=d[A],F=p[A],N=_,B=k,U=M,V=v,q=y,H=m,G=r[N],Y=r[B],W=r[U];r[V]=G,r[q]=Y,r[H]=W;for(var X=0;2>X;++X){var Z=n[2*N+X],Q=n[2*B+X],$=n[2*U+X];n[2*V+X]=Z,n[2*q+X]=Q,n[2*H+X]=$}var K=d[N],J=d[B],tt=d[U];d[V]=K,d[q]=J,d[H]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=L;T>=it;++it)if(c(it,C,S,z,P,r,n,d))it!==L&&a(it,L,r,n,d,p),++L;else if(!c(it,O,I,D,R,r,n,d))for(;;){if(c(T,O,I,D,R,r,n,d)){c(T,C,S,z,P,r,n,d)?(s(it,L,T,r,n,d,p),++L,--T):(a(it,T,r,n,d,p),--T);break}if(--T<it)break}l(t,L-1,C,S,z,P,j,r,n,d,p),l(e,T+1,O,I,D,R,F,r,n,d,p),f>=L-2-t?i(t,L-2,r,n,d,p):h(t,L-2,r,n,d,p),f>=e-(T+2)?i(T+2,e,r,n,d,p):h(T+2,e,r,n,d,p),f>=T-L?i(L,T,r,n,d,p):h(L,T,r,n,d,p)}e.exports=n;var f=32},{}],130:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s){for(var l=r,u=r;n>u;++u){var c=t[2*u],h=t[2*u+1],f=e[u];c>=i&&o>=c&&h>=a&&s>=h&&(u===l?l+=1:(t[2*u]=t[2*l],t[2*u+1]=t[2*l+1],e[u]=e[l],t[2*l]=c,t[2*l+1]=h,e[l]=f,l+=1))}return l}function i(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}function a(t,e,r,a){function l(i,a,o,s,u,c){var h=.5*o,f=s+1,d=u-s;r[_]=d,x[_++]=c;for(var p=0;2>p;++p)for(var g=0;2>g;++g){var v=i+p*h,m=a+g*h,y=n(t,e,f,u,v,m,v+h,m+h);if(y!==f){if(y-f>=Math.max(.9*d,32)){var b=u+s>>>1;l(v,m,h,f,b,c+1),f=b}l(v,m,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(1>u)return[];for(var c=1/0,h=1/0,f=-(1/0),d=-(1/0),p=0;u>p;++p){var g=t[2*p],v=t[2*p+1];c=Math.min(c,g),f=Math.max(f,g),h=Math.min(h,v),d=Math.max(d,v),e[p]=p}c===f&&(f+=1+Math.abs(f)),h===d&&(d+=1+Math.abs(f));var m=1/(f-c),y=1/(d-h),b=Math.max(f-c,d-h);a=a||[0,0,0,0],a[0]=c,a[1]=h,a[2]=f,a[3]=d;var x=o.mallocInt32(u),_=0;l(c,h,b,0,u,0),s(x,t,e,r,u);for(var w=[],k=0,A=u,_=u-1;_>=0;--_){t[2*_]=(t[2*_]-c)*m,t[2*_+1]=(t[2*_+1]-h)*y;var M=x[_];M!==k&&(w.push(new i(b*Math.pow(.5,M),_+1,A-(_+1))),A=_+1,k=M)}return w.push(new i(b*Math.pow(.5,M+1),0,A)),o.free(x),w}var o=t(\"typedarray-pool\"),s=t(\"./lib/sort\");e.exports=a},{\"./lib/sort\":129,\"typedarray-pool\":217}],131:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.weightBuffer=n,this.shader=i,this.pickShader=a,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.pickOffset=0,this.points=null,this.xCoords=null}function i(t,e){var r=t.gl,i=o(r),s=o(r),l=o(r),u=a(r,c.pointVertex,c.pointFragment),h=a(r,c.pickVertex,c.pickFragment),f=new n(t,i,s,l,u,h);return f.update(e),t.addObject(f),f}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"binary-search-bounds\"),l=t(\"snap-points-2d\"),u=t(\"typedarray-pool\"),c=t(\"./lib/shader\");e.exports=i;var h=n.prototype;h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.xCoords&&u.free(this.xCoords),this.plot.removeObject(this)},h.update=function(t){function e(e,r){return e in t?t[e]:r}t=t||{},this.size=e(\"size\",12),this.color=e(\"color\",[1,0,0,1]).slice(),this.borderSize=e(\"borderSize\",1),this.borderColor=e(\"borderColor\",[0,0,0,1]).slice(),this.xCoords&&u.free(this.xCoords);var r=t.positions,n=u.mallocFloat32(r.length),i=u.mallocInt32(r.length>>>1);n.set(r);var a=u.mallocFloat32(r.length);this.points=r,this.scales=l(n,i,a,this.bounds),this.offsetBuffer.update(n),this.pickBuffer.update(i),this.weightBuffer.update(a);for(var o=u.mallocFloat32(r.length>>>1),s=0,c=0;s<r.length;s+=2,++c)o[c]=n[s];u.free(i),u.free(n),u.free(a),this.xCoords=o,this.pointCount=r.length>>>1,this.pickOffset=0},h.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.scales,o=this.offsetBuffer,l=this.pickBuffer,u=this.bounds,c=this.size,h=this.borderSize,f=n.gl,d=n.pickPixelRatio,p=n.viewBox,g=n.dataBox;if(0===this.pointCount)return r;var v=u[2]-u[0],m=u[3]-u[1],y=g[2]-g[0],b=g[3]-g[1],x=(p[2]-p[0])*d/n.pixelRatio,_=(p[3]-p[1])*d/n.pixelRatio,w=Math.min(y/x,b/_);t[0]=2*v/y,t[4]=2*m/b,t[6]=2*(u[0]-g[0])/y-1,t[7]=2*(u[1]-g[1])/b-1,this.pickOffset=r,e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,i.bind(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointSize=d*(c+h),i.uniforms.pickOffset=e,0===this.borderSize?i.uniforms.centerFraction=2:i.uniforms.centerFraction=c/(c+h+1.25),o.bind(),i.attributes.position.pointer(),l.bind(),i.attributes.pickId.pointer(f.UNSIGNED_BYTE);for(var k=this.xCoords,A=(g[0]-u[0]-w*c*d)/v,M=(g[2]-u[0]+w*c*d)/v,L=a.length-1;L>=0;--L){var T=a[L];if(!(T.pixelSize<w&&L>1)){var E=T.offset,C=T.count+E,S=s.ge(k,A,E,C-1),z=s.lt(k,M,S,C-1)+1;f.drawArrays(f.POINTS,S,z-S)}}return r+this.pointCount}}(),h.draw=function(){var t=[1,0,0,0,1,0,0,0,1];return function(){var e=this.plot,r=this.shader,n=this.scales,i=this.offsetBuffer,a=this.bounds,o=this.size,l=this.borderSize,u=e.gl,c=e.pixelRatio,h=e.viewBox,f=e.dataBox;if(0!==this.pointCount){var d=a[2]-a[0],p=a[3]-a[1],g=f[2]-f[0],v=f[3]-f[1],m=h[2]-h[0],y=h[3]-h[1],b=Math.min(g/m,v/y);t[0]=2*d/g,t[4]=2*p/v,t[6]=2*(a[0]-f[0])/g-1,t[7]=2*(a[1]-f[1])/v-1,r.bind(),r.uniforms.matrix=t,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointSize=c*(o+l),r.uniforms.useWeight=1,0===this.borderSize?r.uniforms.centerFraction=2:r.uniforms.centerFraction=o/(o+l+1.25),i.bind(),r.attributes.position.pointer(),this.weightBuffer.bind(),r.attributes.weight.pointer();for(var x=this.xCoords,_=(f[0]-a[0]-b*o*c)/d,w=(f[2]-a[0]+b*o*c)/d,k=!0,A=n.length-1;A>=0;--A){var M=n[A];if(!(M.pixelSize<b&&A>1)){var L=M.offset,T=M.count+L,E=s.ge(x,_,L,T-1),C=s.lt(x,w,E,T-1)+1;u.drawArrays(u.POINTS,E,C-E),k&&(k=!1,r.uniforms.useWeight=0)}}}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(n>r||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\":127,\"binary-search-bounds\":128,\"gl-buffer\":59,\"gl-shader\":138,\"snap-points-2d\":130,\"typedarray-pool\":217}],132:[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;l<n.positions.length;++l)for(var u=n.positions[l],c=0;2>c;++c)s[0][c]=Math.min(s[0][c],u[c]),s[1][c]=Math.max(s[1][c],u[c]);return r[t]=[o,n,s]}var i=t(\"vectorize-text\");e.exports=n;var a={}},{\"vectorize-text\":219}],133:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t(\"gl-shader\"),a=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\n\\nuniform vec4 highlightId;\\nuniform float highlightScale;\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\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 float scale = 1.0;\\n if(distance(highlightId, id) < 0.0001) {\\n scale = highlightScale;\\n }\\n\\n vec4 worldPosition = model * vec4(position, 1);\\n vec4 viewPosition = view * worldPosition;\\n viewPosition = viewPosition / viewPosition.w;\\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\\n \\n gl_Position = clipPosition;\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = position;\\n }\\n}\",o=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float highlightScale, pixelRatio;\\nuniform vec4 highlightId;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n float scale = pixelRatio;\\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\\n scale *= highlightScale;\\n }\\n\\n vec4 worldPosition = model * vec4(position, 1.0);\\n vec4 viewPosition = view * worldPosition;\\n vec4 clipPosition = projection * viewPosition;\\n clipPosition /= clipPosition.w;\\n \\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = position;\\n }\\n}\",s=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform float highlightScale;\\nuniform vec4 highlightId;\\nuniform vec3 axes[2];\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float scale, pixelRatio;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\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 float lscale = pixelRatio * scale;\\n if(distance(highlightId, id) < 0.0001) {\\n lscale *= highlightScale;\\n }\\n\\n vec4 clipCenter = projection * view * model * vec4(position, 1);\\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\\n\\n gl_Position = clipPosition;\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = dataPosition;\\n }\\n}\\n\",l=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float opacity;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n discard;\\n } else {\\n gl_FragColor = interpColor * opacity;\\n }\\n}\\n\",u=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float pickGroup;\\n\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n discard;\\n } else {\\n gl_FragColor = vec4(pickGroup, pickId.bgr);\\n }\\n}\",c=[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"glyph\",type:\"vec2\"},{name:\"id\",type:\"vec4\"}],h={vertex:a,fragment:l,attributes:c},f={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},g={vertex:o,fragment:u,attributes:c},v={vertex:s,fragment:u,attributes:c};r.createPerspective=function(t){return n(t,h)},r.createOrtho=function(t){return n(t,f)},r.createProject=function(t){return n(t,d)},r.createPickPerspective=function(t){return n(t,p)},r.createPickOrtho=function(t){return n(t,g)},r.createPickProject=function(t){return n(t,v)}},{\"gl-shader\":138}],134:[function(t,e,r){\"use strict\";function n(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function a(t,e){this.index=t,this.dataCoordinate=this.position=e}function o(t,e,r,n,i,o,s,l,u,c,h,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=h,this.pickProjectShader=f,this.points=[],this._selectResult=new a(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function u(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function c(t){for(var e=C,r=0;2>r;++r)for(var n=0;3>n;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function h(t,e,r,n,a){var o,h=e.axesProject,f=e.gl,d=t.uniforms,p=r.model||x,g=r.view||x,v=r.projection||x,y=e.axesBounds,b=c(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/f.drawingBufferWidth,w[1]=2/f.drawingBufferHeight,t.bind(),d.view=g,d.projection=v,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;3>_;++_)if(h[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var C=T,S=0;16>S;++S)C[S]=0;for(var S=0;4>S;++S)C[5*S]=1;C[5*_]=0,o[_]<0?C[12+_]=y[0][_]:C[12+_]=y[1][_],m(C,p,C),d.model=C;var z=(_+1)%3,P=(_+2)%3,j=s(k),O=s(A);j[z]=1,O[P]=1;var I=i(v,g,p,l(M,j)),D=i(v,g,p,l(L,O));if(Math.abs(I[1])>Math.abs(D[1])){var R=I;I=D,D=R,R=j,j=O,O=R;var F=z;z=P,P=F}I[0]<0&&(j[z]=-1),D[1]>0&&(O[P]=-1);for(var N=0,B=0,S=0;4>S;++S)N+=Math.pow(p[4*z+S],2),B+=Math.pow(p[4*P+S],2);j[z]/=Math.sqrt(N),O[P]/=Math.sqrt(B),d.axes[0]=j,d.axes[1]=O,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=P,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=g(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\"),g=t(\"gl-vao\"),v=t(\"typedarray-pool\"),m=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;3>t;++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;3>t;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],k=[0,0,0],A=[0,0,0],M=[0,0,0,1],L=[0,0,0,1],T=x.slice(),E=[0,0,0],C=[[0,0,0],[0,0,0]],S=[-1e8,-1e8,-1e8],z=[1e8,1e8,1e8],P=[S,z];_.draw=function(t){var e=this.useOrtho?this.orthoShader:this.shader;f(e,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){var e=this.useOrtho?this.orthoShader:this.shader;f(e,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){var e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;f(e,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||0>e)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;3>i;++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,g=0,m=n.length;t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b(\"\\u25cf\",i);var k=w[0],A=w[1],M=w[2];p+=3*k.cells.length,g+=2*A.edges.length}var L=p+g,T=v.mallocFloat(3*L),E=v.mallocFloat(4*L),C=v.mallocFloat(2*L),S=v.mallocUint32(L),z=[0,a[1]],P=0,j=p,O=[0,0,0,1],I=[0,0,0,1],D=Array.isArray(u)&&Array.isArray(u[0]),R=Array.isArray(f)&&Array.isArray(f[0]);\n",
"t:for(var y=0;m>y;++y){for(var x=n[y],_=0;3>_;++_){if(isNaN(x[_])||!isFinite(x[_])){d+=1;continue t}s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_])}var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b(\"\\u25cf\",i);var k=w[0],A=w[1],M=w[2];if(Array.isArray(u)){var F;if(F=D?u[y]:u,3===F.length){for(var _=0;3>_;++_)O[_]=F[_];O[3]=1}else if(4===F.length)for(var _=0;4>_;++_)O[_]=F[_]}else O[0]=O[1]=O[2]=0,O[3]=1;if(Array.isArray(f)){var F;if(F=R?f[y]:f,3===F.length){for(var _=0;3>_;++_)I[_]=F[_];I[_]=1}else if(4===F.length)for(var _=0;4>_;++_)I[_]=F[_]}else I[0]=I[1]=I[2]=0,I[3]=1;var N=.5;Array.isArray(c)?N=+c[y]:c?N=+c:this.useOrtho&&(N=12);var B=0;Array.isArray(h)?B=+h[y]:h&&(B=+h);for(var U=Math.cos(B),V=Math.sin(B),x=n[y],_=0;3>_;++_)s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_]);a[0]<0?z[0]=a[0]*(1+M[1][0]):a[0]>0&&(z[0]=-a[0]*(1+M[0][0]));for(var q=k.cells,H=k.positions,_=0;_<q.length;++_)for(var G=q[_],Y=0;3>Y;++Y){for(var W=0;3>W;++W)T[3*P+W]=x[W];for(var W=0;4>W;++W)E[4*P+W]=O[W];S[P]=d;var X=H[G[Y]];C[2*P]=N*(U*X[0]-V*X[1]+z[0]),C[2*P+1]=N*(V*X[0]+U*X[1]+z[1]),P+=1}for(var q=A.edges,H=A.positions,_=0;_<q.length;++_)for(var G=q[_],Y=0;2>Y;++Y){for(var W=0;3>W;++W)T[3*j+W]=x[W];for(var W=0;4>W;++W)E[4*j+W]=I[W];S[j]=d;var X=H[G[Y]];C[2*j]=N*(U*X[0]-V*X[1]+z[0]),C[2*j+1]=N*(V*X[0]+U*X[1]+z[1]),j+=1}d+=1}this.vertexCount=p,this.lineVertexCount=g,this.pointBuffer.update(T),this.colorBuffer.update(E),this.glyphBuffer.update(C),this.idBuffer.update(new Uint32Array(S)),v.free(T),v.free(E),v.free(C),v.free(S),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{\"./lib/glyphs\":132,\"./lib/shaders\":133,\"gl-buffer\":59,\"gl-mat4/multiply\":80,\"gl-vao\":166,\"typedarray-pool\":217}],135:[function(t,e,r){\"use strict\";r.boxVertex=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec2 vertex;\\n\\nuniform vec2 cornerA, cornerB;\\n\\nvoid main() {\\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\\n}\\n\",r.boxFragment=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = color;\\n}\\n\"},{}],136:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-(1/0),-(1/0)],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function i(t,e){var r=t.gl,i=o(r,[0,0,0,1,1,0,1,1]),l=a(r,s.boxVertex,s.boxFragment),u=new n(t,i,l);return u.update(e),t.addOverlay(u),u}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"./lib/shaders\");e.exports=i;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,h=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],f=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],d=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(h=Math.max(h,u[0]),f=Math.max(f,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(h>d||f>p)){o.bind();var g=s[2]-s[0],v=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,g,f,i),o.drawBox(0,f,h,p,i),o.drawBox(0,p,g,v,i),o.drawBox(d,f,g,p,i)),this.innerFill&&o.drawBox(h,f,d,p,n),r>0){var m=r*c;o.drawBox(h-m,f-m,d+m,f+m,a),o.drawBox(h-m,p-m,d+m,p+m,a),o.drawBox(h-m,f-m,h+m,p+m,a),o.drawBox(d-m,f-m,d+m,p+m,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\":135,\"gl-buffer\":59,\"gl-shader\":138}],137:[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){var r=o(t,e),n=s.mallocUint8(e[0]*e[1]*4);return new i(t,r,n)}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(255>_inline_7_arg0_||255>_inline_7_arg1_||255>_inline_7_arg2_||255>_inline_7_arg3_){var _inline_7_l=_inline_7_arg4_-_inline_7_arg6_[0],_inline_7_a=_inline_7_arg5_-_inline_7_arg6_[1],_inline_7_f=_inline_7_l*_inline_7_l+_inline_7_a*_inline_7_a;_inline_7_f<this_closestD2&&(this_closestD2=_inline_7_f,this_closestX=_inline_7_arg6_[0],this_closestY=_inline_7_arg6_[1])}}\",args:[{name:\"_inline_7_arg0_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_7_arg1_\",lvalue:!1,rvalue:!0,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},{name:\"_inline_7_arg5_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_7_arg6_\",lvalue:!1,rvalue:!0,count:4}],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[\"_inline_7_a\",\"_inline_7_f\",\"_inline_7_l\"]},post:{body:\"{return[this_closestX,this_closestY,this_closestD2]}\",args:[],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[]},debug:!1,funcName:\"cwise\",blockSize:64}),h=i.prototype;Object.defineProperty(h,\"shape\",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;r*e*4>i;++i)n[i]=255}return t}}}),h.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},h.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},h.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t=0|t,e=0|e,\"number\"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),u=0|Math.min(Math.max(e+r,0),i[1]);if(a>=o||s>=u)return null;var h=[o-a,u-s],f=l(this.buffer,[h[0],h[1],4],[4,4*i[0],1],4*(a+i[0]*s)),d=c(f.hi(h[0],h[1],1),r,r),p=d[0],g=d[1];if(0>p||Math.pow(this.radius,2)<d[2])return null;var v=f.get(p,g,0),m=f.get(p,g,1),y=f.get(p,g,2),b=f.get(p,g,3);return new n(p+a|0,g+s|0,v,[m,y,b],Math.sqrt(d[2]))},h.dispose=function(){this.gl&&(this.fbo.dispose(),s.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{\"bit-twiddle\":33,\"cwise/lib/wrapper\":48,\"gl-fbo\":64,ndarray:189,\"typedarray-pool\":217}],138:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t(\"./lib/create-uniforms\"),s=t(\"./lib/create-attributes\"),l=t(\"./lib/reflect\"),u=t(\"./lib/shader-cache\"),c=t(\"./lib/runtime-reflect\"),h=n.prototype;h.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},h.dispose=function(){this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},h.update=function(t,e,r,n){function a(){f.program=u.program(d,f._vref,f._fref,b,x);for(var t=0;t<r.length;++t)T[t]=d.getUniformLocation(f.program,r[t].name)}if(!e||1===arguments.length){var h=t;t=h.vertex,e=h.fragment,r=h.uniforms,n=h.attributes}var f=this,d=f.gl,p=f._vref;f._vref=u.shader(d,d.VERTEX_SHADER,t),p&&p.dispose(),f.vertShader=f._vref.shader;var g=this._fref;if(f._fref=u.shader(d,d.FRAGMENT_SHADER,e),g&&g.dispose(),f.fragShader=f._fref.shader,!r||!n){var v=d.createProgram();if(d.attachShader(v,f.fragShader),d.attachShader(v,f.vertShader),d.linkProgram(v),!d.getProgramParameter(v,d.LINK_STATUS)){var m=d.getProgramInfoLog(v);throw console.error(\"gl-shader: Error linking program:\",m),new Error(\"gl-shader: Error linking program:\"+m)}r=r||c.uniforms(d,v),n=n||c.attributes(d,v),d.deleteProgram(v)}n=n.slice(),n.sort(i);for(var y=[],b=[],x=[],_=0;_<n.length;++_){var w=n[_];if(w.type.indexOf(\"mat\")>=0){for(var k=0|w.type.charAt(w.type.length-1),A=new Array(k),M=0;k>M;++M)A[M]=x.length,b.push(w.name+\"[\"+M+\"]\"),\"number\"==typeof w.location?x.push(w.location+M):Array.isArray(w.location)&&w.location.length===k&&\"number\"==typeof w.location[M]?x.push(0|w.location[M]):x.push(-1);y.push({name:w.name,type:w.type,locations:A})}else y.push({name:w.name,type:w.type,locations:[x.length]}),b.push(w.name),\"number\"==typeof w.location?x.push(0|w.location):x.push(-1)}for(var L=0,_=0;_<x.length;++_)if(x[_]<0){for(;x.indexOf(L)>=0;)L+=1;x[_]=L}var T=new Array(r.length);a(),f._relink=a,f.types={uniforms:l(r),attributes:l(n)},f.attributes=s(d,f,y,x),Object.defineProperty(f,\"uniforms\",o(d,f,r,T))},e.exports=a},{\"./lib/create-attributes\":139,\"./lib/create-uniforms\":140,\"./lib/reflect\":141,\"./lib/runtime-reflect\":142,\"./lib/shader-cache\":143}],139:[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;a>c;++c)l.push(\"x\"+c),u.push(\"x\"+c);l.push(\"if(x0.length===void 0){return gl.vertexAttrib\"+a+\"f(v,\"+u.join()+\")}else{return gl.vertexAttrib\"+a+\"fv(v,x0)}\");var h=Function.apply(null,l),f=new n(t,e,r,i,a,h);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),h(t,i[r],e),e},get:function(){return f},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),u=new Array(a),c=0;a>c;++c)i(t,e,r[c],n,a,l,c),u[c]=l[c];Object.defineProperty(l,\"location\",{set:function(t){if(Array.isArray)for(var e=0;a>e;++e)u[e].location=t[e];else for(var e=0;a>e;++e)result[e]=u[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;a>e;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;a>l;++l){var u=n[r[l]];t.vertexAttribPointer(u,a,e,i,o,s+l*a),t.enableVertexAttribArray(u)}};var h=new Array(a),f=t[\"vertexAttrib\"+a+\"fv\"];Object.defineProperty(o,s,{set:function(e){for(var i=0;a>i;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))f.call(t,o,e[i]);else{for(var s=0;a>s;++s)h[s]=e[a*i+s];f.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},s=0,l=r.length;l>s;++s){var u=r[s],c=u.name,h=u.type,f=u.locations;switch(h){case\"bool\":case\"int\":case\"float\":i(t,e,f[0],n,1,o,c);break;default:if(h.indexOf(\"vec\")>=0){var d=h.charCodeAt(h.length-1)-48;if(2>d||d>4)throw new Error(\"gl-shader: Invalid data type for attribute \"+c+\": \"+h);i(t,e,f[0],n,d,o,c)}else{if(!(h.indexOf(\"mat\")>=0))throw new Error(\"gl-shader: Unknown data type for attribute \"+c+\": \"+h);var d=h.charCodeAt(h.length-1)-48;if(2>d||d>4)throw new Error(\"gl-shader: Invalid data type for attribute \"+c+\": \"+h);a(t,e,f,n,d,o,c)}}}return o}e.exports=o;var s=n.prototype;s.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)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},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}})},{}],140:[function(t,e,r){\"use strict\";function n(t){var e=new Function(\"y\",\"return function(){return y}\");return e(t)}function i(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function a(t,e,r,a){function s(r){var n=new Function(\"gl\",\"wrapper\",\"locations\",\"return function(){return gl.getUniform(wrapper.program,locations[\"+r+\"])}\");return n(t,e,a)}function l(t,e,r){switch(r){case\"bool\":case\"int\":case\"sampler2D\":case\"samplerCube\":return\"gl.uniform1i(locations[\"+e+\"],obj\"+t+\")\";case\"float\":return\"gl.uniform1f(locations[\"+e+\"],obj\"+t+\")\";default:var n=r.indexOf(\"vec\");if(!(n>=0&&1>=n&&r.length===4+n)){if(0===r.indexOf(\"mat\")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)throw new Error(\"gl-shader: Invalid uniform dimension type for matrix \"+name+\": \"+r);return\"gl.uniformMatrix\"+i+\"fv(locations[\"+e+\"],false,obj\"+t+\")\"}throw new Error(\"gl-shader: Unknown uniform data type for \"+name+\": \"+r)}var i=r.charCodeAt(r.length-1)-48;if(2>i||i>4)throw new Error(\"gl-shader: 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 Error(\"gl-shader: Unrecognized data type for vector \"+name+\": \"+r)}}}function u(t,e){if(\"object\"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;a+=parseInt(n)+\"\"===n?\"[\"+n+\"]\":\".\"+n,\"object\"==typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function c(e){for(var n=[\"return function updateProperty(obj){\"],i=u(\"\",e),o=0;o<i.length;++o){var s=i[o],c=s[0],h=s[1];a[h]&&n.push(l(c,h,r[h].type))}n.push(\"return obj}\");var f=new Function(\"gl\",\"locations\",n.join(\"\\n\"));return f(t,a)}function h(t){switch(t){case\"bool\":return!1;case\"int\":case\"sampler2D\":case\"samplerCube\":return 0;case\"float\":return 0;default:var e=t.indexOf(\"vec\");if(e>=0&&1>=e&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(2>r||r>4)throw new Error(\"gl-shader: 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(2>r||r>4)throw new Error(\"gl-shader: Invalid uniform dimension type for matrix \"+name+\": \"+t);return i(r*r,0)}throw new Error(\"gl-shader: Unknown uniform data type for \"+name+\": \"+t)}}function f(t,e,i){if(\"object\"==typeof i){var o=d(i);Object.defineProperty(t,e,{get:n(o),set:c(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:s(i),set:c(i),enumerable:!0,configurable:!1}):t[e]=h(r[i].type)}function d(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)f(e,r,t[r])}else{e={};for(var n in t)f(e,n,t[n])}return e}var p=o(r,!0);return{get:n(d(p)),set:c(p),enumerable:!0,configurable:!0}}var o=t(\"./reflect\");e.exports=a},{\"./reflect\":141}],141:[function(t,e,r){\"use strict\";function n(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name,a=i.split(\".\"),o=r,s=0;s<a.length;++s){var l=a[s].split(\"[\");if(l.length>1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u<l.length;++u){var c=parseInt(l[u]);u<l.length-1||s<a.length-1?(c in o||(u<l.length-1?o[c]=[]:o[c]={}),o=o[c]):e?o[c]=n:o[c]=t[n].type}}else s<a.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):e?o[l[0]]=n:o[l[0]]=t[n].type}return r}e.exports=n},{}],142:[function(t,e,r){\"use strict\";function n(t,e){if(!s){var r=Object.keys(o);s={};for(var n=0;n<r.length;++n){var i=r[n];s[t[i]]=o[i]}}return s[e]}function i(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=[],a=0;r>a;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)i.push({name:o.name.replace(\"[0]\",\"[\"+l+\"]\"),type:s});else i.push({name:o.name,type:s})}}return i}function a(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=[],a=0;r>a;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:\"float\",FLOAT_VEC2:\"vec2\",FLOAT_VEC3:\"vec3\",FLOAT_VEC4:\"vec4\",INT:\"int\",INT_VEC2:\"ivec2\",INT_VEC3:\"ivec3\",INT_VEC4:\"ivec4\",BOOL:\"bool\",BOOL_VEC2:\"bvec2\",BOOL_VEC3:\"bvec3\",BOOL_VEC4:\"bvec4\",FLOAT_MAT2:\"mat2\",FLOAT_MAT3:\"mat3\",FLOAT_MAT4:\"mat4\",SAMPLER_2D:\"sampler2D\",SAMPLER_CUBE:\"samplerCube\"},s=null},{}],143:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);throw console.error(\"gl-shader: Error compiling shader:\",i),new Error(\"gl-shader: Error compiling shader:\"+i)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;o<n.length;++o)t.bindAttribLocation(a,i[o],n[o]);if(t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS)){var s=t.getProgramInfoLog(a);throw console.error(\"gl-shader: Error linking program:\",s),new Error(\"gl-shader: Error linking program:\"+s)}return a}function s(t){var e=h.get(t);return e||(e=new i(t),h.set(t,e)),e}function l(t,e,r){return s(t).getShaderReference(e,r)}function u(t,e,r,n,i){return s(t).getProgram(e,r,n,i)}r.shader=l,r.program=u;var c=\"undefined\"==typeof WeakMap?t(\"weakmap-shim\"):WeakMap,h=new c,f=0;n.prototype.dispose=function(){if(0===--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;i>n;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var d=i.prototype;d.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(f++,e,t,s,[],1,this)}return o},d.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(\":\"),n.join(\":\")].join(\"@\"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{\"weakmap-shim\":146}],144:[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\":145}],145:[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},{}],146:[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){t(e).value=r},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\":144}],147:[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)}},{}],148:[function(t,e,r){var n=t(\"gl-shader\"),i=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec4 uv;\\nattribute vec2 f;\\nattribute vec3 normal;\\n\\nuniform mat4 model, view, projection, inverseModel;\\nuniform vec3 lightPosition, eyePosition;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\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 value = f.x;\\n kill = f.y;\\n planeCoordinate = uv.xy;\\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}\",a=\"#define GLSLIFY 1\\nprecision mediump float;\\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;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\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 = beckmannSpecular_1_1(L, V, N, roughness);\\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n float interpValue = (value - lowerBound.z) / (upperBound.z - lowerBound.z);\\n vec4 surfaceColor = texture2D(colormap, vec2(interpValue, interpValue));\\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=\"#define GLSLIFY 1\\nprecision mediump float;\\n\\nattribute vec4 uv;\\n\\nuniform mat3 permutation;\\nuniform mat4 model, view, projection;\\nuniform float height, zOffset;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\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 = dataCoordinate.z;\\n kill = -1.0;\\n worldCoordinate = dataCoordinate;\\n planeCoordinate = uv.zw;\\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=\"#define GLSLIFY 1\\nprecision mediump float;\\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}\";r.createShader=function(t){var e=n(t,i,a,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec2\"},{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:\"vec2\"},{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\"}]);return e.attributes.uv.location=0,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:\"uv\",type:\"vec4\"}]);return e.attributes.uv.location=0,e}},{\"gl-shader\":138}],149:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],150:[function(t,e,r){\"use strict\";function n(t){if(t in l)return l[t];for(var e=[],r=0;t>r;++r)e.push(\"out\",r,\"s=0.5*(inp\",r,\"l-inp\",r,\"r);\");for(var n=[\"array\"],i=[\"junk\"],r=0;t>r;++r){n.push(\"array\"),i.push(\"out\"+r+\"s\");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push(\"inp\"+r+\"l\",\"inp\"+r+\"r\")}return l[t]=s({args:n,pre:c,post:c,body:{body:e.join(\"\"),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf(\"out\"),rvalue:0===t.indexOf(\"inp\"),count:\"junk\"!==t|0}}),thisVars:[],localVars:[]},funcName:\"fdTemplate\"+t})}function i(t){function e(e){for(var r=a-e.length,n=[],i=[],s=[],l=0;a>l;++l)e.indexOf(l+1)>=0?s.push(\"0\"):e.indexOf(-(l+1))>=0?s.push(\"s[\"+l+\"]-1\"):(s.push(\"-1\"),n.push(\"1\"),i.push(\"s[\"+l+\"]-2\"));var u=\".lo(\"+n.join()+\").hi(\"+i.join()+\")\";if(0===n.length&&(u=\"\"),r>0){o.push(\"if(1\");for(var l=0;a>l;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push(\"&&s[\",l,\"]>2\");o.push(\"){grad\",r,\"(src.pick(\",s.join(),\")\",u);for(var l=0;a>l;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push(\",dst.pick(\",s.join(),\",\",l,\")\",u);o.push(\");\")}for(var l=0;l<e.length;++l){var c=Math.abs(e[l])-1,h=\"dst.pick(\"+s.join()+\",\"+c+\")\"+u;switch(t[c]){case\"clamp\":var f=s.slice(),d=s.slice();e[l]<0?f[c]=\"s[\"+c+\"]-2\":d[c]=\"1\",0===r?o.push(\"if(s[\",c,\"]>1){dst.set(\",s.join(),\",\",c,\",0.5*(src.get(\",f.join(),\")-src.get(\",d.join(),\")))}else{dst.set(\",s.join(),\",\",c,\",0)};\"):o.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?o.push(\"dst.set(\",s.join(),\",\",c,\",0);\"):o.push(\"zero(\",h,\");\");break;case\"wrap\":var p=s.slice(),g=s.slice();e[l]<0?(p[c]=\"s[\"+c+\"]-2\",g[c]=\"0\"):(p[c]=\"s[\"+c+\"]-1\",g[c]=\"1\"),0===r?o.push(\"if(s[\",c,\"]>2){dst.set(\",s.join(),\",\",c,\",0.5*(src.get(\",p.join(),\")-src.get(\",g.join(),\")))}else{dst.set(\",s.join(),\",\",c,\",0)};\"):o.push(\"if(s[\",c,\"]>2){diff(\",h,\",src.pick(\",p.join(),\")\",u,\",src.pick(\",g.join(),\")\",u,\");}else{zero(\",h,\");};\");break;default:throw new Error(\"ndarray-gradient: Invalid boundary condition\")}}r>0&&o.push(\"};\")}var r=t.join(),i=u[r];if(i)return i;for(var a=t.length,o=[\"function gradient(dst,src){var s=src.shape.slice();\"],s=0;1<<a>s;++s){for(var c=[],d=0;a>d;++d)s&1<<d&&c.push(d+1);for(var p=0;p<1<<c.length;++p){for(var g=c.slice(),d=0;d<c.length;++d)p&1<<d&&(g[d]=-g[d]);e(g)}}o.push(\"return dst;};return gradient\");for(var v=[\"diff\",\"zero\"],m=[h,f],s=1;a>=s;++s)v.push(\"grad\"+s),m.push(n(s));v.push(o.join(\"\"));var y=Function.apply(void 0,v),i=y.apply(void 0,m);return l[r]=i,i}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<e.dimension;++n)if(t.shape[n]!==e.shape[n])throw new Error(\"ndarray-gradient: shape mismatch\");if(0===e.size)return t;if(e.dimension<=0)return t.set(0),t;var a=i(r);return a(t,e)}e.exports=a;var o=t(\"dup\"),s=t(\"cwise-compiler\"),l={},u={},c={body:\"\",args:[],thisVars:[],localVars:[]},h=s({args:[\"array\",\"array\",\"array\"],pre:c,post:c,body:{args:[{name:\"out\",lvalue:!0,rvalue:!1,count:1},{name:\"left\",lvalue:!1,rvalue:!0,count:1},{name:\"right\",lvalue:!1,rvalue:!0,count:1}],body:\"out=0.5*(left-right)\",thisVars:[],localVars:[]},funcName:\"cdiff\"}),f=s({args:[\"array\"],pre:c,post:c,body:{args:[{name:\"out\",lvalue:!0,rvalue:!1,count:1}],body:\"out=0\",thisVars:[],localVars:[]},funcName:\"zero\"})},{\"cwise-compiler\":151,dup:55}],151:[function(t,e,r){arguments[4][49][0].apply(r,arguments)},{\"./lib/thunk.js\":153,dup:49}],152:[function(t,e,r){arguments[4][50][0].apply(r,arguments)},{dup:50,uniq:154}],153:[function(t,e,r){arguments[4][51][0].apply(r,arguments)},{\"./compile.js\":152,dup:51}],154:[function(t,e,r){arguments[4][52][0].apply(r,arguments)},{dup:52}],155:[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;a instanceof Array;)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\":156,ndarray:189}],156:[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\":157}],157:[function(t,e,r){\"use strict\";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],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.slice(0);for(var i=0;i<r.length;++i){var o=r[i];if(\"array\"===o){if(e.arrayArgs.push(i),e.shimArgs.push(\"array\"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array args\");if(i<e.post.args.length&&e.post.args[i].count>0)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),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array index\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array index\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array index\")}else if(\"shape\"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error(\"cwise: pre() block may not write to array shape\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array shape\");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error(\"cwise: post() block may not write to array shape\");\n",
"}else{if(\"object\"!=typeof o||!o.offset)throw new Error(\"cwise: Unknown argument type \"+r[i]);e.argTypes[i]=\"offset\",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error(\"cwise: No array arguments specified\");if(e.pre.args.length>r.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\":159}],158:[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;a>n;++n)u.push([\"i\",n,\"=0\"].join(\"\"));for(i=0;o>i;++i)for(n=0;a>n;++n)h=c,c=t[n],0===n?u.push([\"d\",i,\"s\",n,\"=t\",i,\"[\",c,\"]\"].join(\"\")):u.push([\"d\",i,\"s\",n,\"=(t\",i,\"[\",c,\"]-s\",h,\"*t\",i,\"[\",h,\"])\"].join(\"\"));for(l.push(\"var \"+u.join(\",\")),n=a-1;n>=0;--n)c=t[n],l.push([\"for(i\",n,\"=0;i\",n,\"<s\",c,\";++i\",n,\"){\"].join(\"\"));for(l.push(r),n=0;a>n;++n){for(h=c,c=t[n],i=0;o>i;++i)l.push([\"p\",i,\"+=d\",i,\"s\",n].join(\"\"));s&&(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;o>c;++c)u.push([\"var offset\",c,\"=p\",c].join(\"\"));for(var c=t;a>c;++c)u.push([\"for(var j\"+c+\"=SS[\",e[c],\"]|0;j\",c,\">0;){\"].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;o>c;++c){for(var h=[\"offset\"+c],f=t;a>f;++f)h.push([\"j\",f,\"*t\",c,\"[\",e[f],\"]\"].join(\"\"));u.push([\"p\",c,\"=(\",h.join(\"+\"),\")\"].join(\"\"))}u.push(n(e,r,i));for(var c=t;a>c;++c)u.push(\"}\");return u.join(\"\\n\")}function a(t){for(var e=0,r=t[0].length;r>e;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}function o(t,e,r){for(var n=t.body,i=[],a=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,\"g\"),u=\"\",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case\"offset\":var h=e.offsetArgIndex.indexOf(o),f=e.offsetArgs[h];c=f.array,u=\"+q\"+h;case\"array\":u=\"p\"+c+u;var d=\"l\"+o,p=\"a\"+c;1===s.count?\"generic\"===r[c]?s.lvalue?(i.push([\"var \",d,\"=\",p,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,d),a.push([p,\".set(\",u,\",\",d,\")\"].join(\"\"))):n=n.replace(l,[p,\".get(\",u,\")\"].join(\"\")):n=n.replace(l,[p,\"[\",u,\"]\"].join(\"\")):\"generic\"===r[c]?(i.push([\"var \",d,\"=\",p,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,d),s.lvalue&&a.push([p,\".set(\",u,\",\",d,\")\"].join(\"\"))):(i.push([\"var \",d,\"=\",p,\"[\",u,\"]\"].join(\"\")),n=n.replace(l,d),s.lvalue&&a.push([p,\"[\",u,\"]=\",d].join(\"\")));break;case\"scalar\":n=n.replace(l,\"Y\"+e.scalarArgs.indexOf(o));break;case\"index\":n=n.replace(l,\"index\");break;case\"shape\":n=n.replace(l,\"shape\")}}}return[i.join(\"\\n\"),n,a.join(\"\\n\")].join(\"\\n\").trim()}function s(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],a=i.match(/\\d+/);a=a?a[0]:\"\",0===i.charAt(0)?e[n]=\"u\"+i.charAt(1)+a:e[n]=i.charAt(0)+a,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join(\"\")}function l(t,e){for(var r=0|e[1].length,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=[\"SS\"],f=[\"'use strict'\"],d=[],p=0;r>p;++p)d.push([\"s\",p,\"=SS[\",p,\"]\"].join(\"\"));for(var g=0;g<t.arrayArgs.length;++g)h.push(\"a\"+g),h.push(\"t\"+g),h.push(\"p\"+g),c[g]=e[2*g],l[g]=e[2*g+1];for(var g=0;g<t.scalarArgs.length;++g)h.push(\"Y\"+g);if(t.shapeArgs.length>0&&d.push(\"shape=SS.slice(0)\"),t.indexArgs.length>0){for(var v=new Array(r),g=0;r>g;++g)v[g]=\"0\";d.push([\"index=[\",v.join(\",\"),\"]\"].join(\"\"))}for(var g=0;g<t.offsetArgs.length;++g){for(var m=t.offsetArgs[g],y=[],p=0;p<m.offset.length;++p)0!==m.offset[p]&&(1===m.offset[p]?y.push([\"t\",m.array,\"[\",p,\"]\"].join(\"\")):y.push([m.offset[p],\"*t\",m.array,\"[\",p,\"]\"].join(\"\")));0===y.length?d.push(\"q\"+g+\"=0\"):d.push([\"q\",g,\"=(\",y.join(\"+\"),\")|0\"].join(\"\"))}var b=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));d=d.concat(b),f.push(\"var \"+d.join(\",\"));for(var g=0;g<t.arrayArgs.length;++g)f.push(\"p\"+g+\"|=0\");t.pre.body.length>3&&f.push(o(t.pre,t,c));var x=o(t.body,t,c),_=a(l);r>_?f.push(i(_,l[0],t,x)):f.push(n(l[0],t,x)),t.post.body.length>3&&f.push(o(t.post,t,c)),t.debug&&console.log(\"Generated cwise routine for \",e,\":\\n\\n\",f.join(\"\\n\"));var w=[t.funcName||\"unnamed\",\"_cwise_loop_\",l[0].join(\"s\"),\"m\",_,s(c)].join(\"\"),k=new Function([\"function \",w,\"(\",h.join(\",\"),\"){\",f.join(\"\\n\"),\"} return \",w].join(\"\"));return k()}var u=t(\"uniq\");e.exports=l},{uniq:160}],159:[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\"].join(\"\")],l=0;l<t.arrayArgs.length;++l){var u=t.arrayArgs[l];r.push([\"t\",u,\"=array\",u,\".dtype,\",\"r\",u,\"=array\",u,\".order\"].join(\"\")),a.push(\"t\"+u),a.push(\"r\"+u),o.push(\"t\"+u),o.push(\"r\"+u+\".join()\"),s.push(\"array\"+u+\".data\"),s.push(\"array\"+u+\".stride\"),s.push(\"array\"+u+\".offset|0\")}for(var l=0;l<t.scalarArgs.length;++l)s.push(\"scalar\"+t.scalarArgs[l]);r.push([\"type=[\",o.join(\",\"),\"].join()\"].join(\"\")),r.push(\"proc=CACHED[type]\"),e.push(\"var \"+r.join(\",\")),e.push([\"if(!proc){\",\"CACHED[type]=proc=compile([\",a.join(\",\"),\"])}\",\"return proc(\",s.join(\",\"),\")}\"].join(\"\")),t.debug&&console.log(\"Generated thunk:\",e.join(\"\\n\"));var c=new Function(\"compile\",e.join(\"\\n\"));return c(i.bind(void 0,t))}var i=t(\"./compile.js\");e.exports=n},{\"./compile.js\":158}],160:[function(t,e,r){\"use strict\";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;n>o;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;r>a;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?[]:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],161:[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:256,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._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._field=[_(m.mallocFloat(1024),[0,0]),_(m.mallocFloat(1024),[0,0]),_(m.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.dirty=!0}function o(t,e){for(var r=e.axes&&e.axes.lastCubeProps.axis||R,n=e.showSurface,i=e.showContour,a=0;3>a;++a){n=n||e.surfaceProject[a];for(var o=0;3>o;++o)i=i||e.contourProject[a][o]}for(var a=0;3>a;++a){for(var s=F.projections[a],o=0;16>o;++o)s[o]=0;for(var o=0;4>o;++o)s[5*o]=1;s[5*a]=0,s[12+a]=e.axesBounds[+(r[a]>0)][a],k(s,t.model,s);for(var l=F.clipBounds[a],u=0;2>u;++u)for(var o=0;3>o;++o)l[u][o]=t.clipBounds[u][o];l[0][a]=-1e8,l[1][a]=1e8}return F.showSurface=n,F.showContour=i,F}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=N;n.model=t.model||j,n.view=t.view||j,n.projection=t.projection||j,n.lowerBound=this.bounds[0],n.upperBound=this.bounds[1],n.contourColor=this.contourColor[0],n.inverseModel=A(n.inverseModel,n.model);for(var i=0;2>i;++i)for(var a=n.clipBounds[i],s=0;3>s;++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.shape=n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=U;var l=B;k(l,n.view,n.model),k(l,n.projection,l),A(l,l);for(var i=0;3>i;++i)n.eyePosition[i]=l[12+i]/l[15];for(var u=l[15],i=0;3>i;++i)u+=this.lightPosition[i]*l[4*i+3];for(var i=0;3>i;++i){for(var c=l[12+i],s=0;3>s;++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){this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vao.draw(r.TRIANGLES,this._vertexCount);for(var i=0;3>i;++i)this.surfaceProject[i]&&(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;d.bind();for(var i=0;3>i;++i){f.uniforms.permutation=I[i],r.lineWidth(this.contourWidth[i]);for(var s=0;s<this.contourLevels[i].length;++s)s===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):(0===s||s-1===this.highlightLevel[i])&&(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),f.uniforms.height=this.contourLevels[i][s],d.draw(r.LINES,this._contourCounts[i][s],this._contourOffsets[i][s])}for(var i=0;3>i;++i){f.uniforms.model=h.projections[i],f.uniforms.clipBounds=h.clipBounds[i];for(var s=0;3>s;++s)if(this.contourProject[i][s]){f.uniforms.permutation=I[s],r.lineWidth(this.contourWidth[s]);for(var p=0;p<this.contourLevels[s].length;++p)p===this.highlightLevel[s]?(f.uniforms.contourColor=this.highlightColor[s],f.uniforms.contourTint=this.highlightTint[s]):(0===p||p-1===this.highlightLevel[s])&&(f.uniforms.contourColor=this.contourColor[s],f.uniforms.contourTint=this.contourTint[s]),f.uniforms.height=this.contourLevels[s][p],d.draw(r.LINES,this._contourCounts[s][p],this._contourOffsets[s][p])}}d=this._dynamicVAO,d.bind();for(var i=0;3>i;++i)if(0!==this._dynamicCounts[i]){f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=I[i],r.lineWidth(this.dynamicWidth[i]),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]);for(var s=0;3>s;++s)this.contourProject[s][i]&&(f.uniforms.model=h.projections[s],f.uniforms.clipBounds=h.clipBounds[s],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]))}d.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();b.assign(t.lo(1,1).hi(r[0],r[1]),e),b.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),b.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),b.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),b.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function u(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function c(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function h(t){if(Array.isArray(t)){if(Array.isArray(t))return[c(t[0]),c(t[1]),c(t[2])];var e=c(t);return[e.slice(),e.slice(),e.slice()]}}function f(t){var e=t.gl,r=(t.field||t.coords&&t.coords[2]||_([],[0,0]),E(e)),n=S(e),i=C(e),o=z(e),s=p(e),l=g(e,[{buffer:s,size:4,stride:P,offset:0},{buffer:s,size:2,stride:P,offset:16},{buffer:s,size:3,stride:P,offset:24}]),u=p(e),c=g(e,[{buffer:u,size:4}]),h=p(e),f=g(e,[{buffer:h,size:2,type:e.FLOAT}]),d=v(e,1,256,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var m=new a(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,d,i,o,u,c,h,f),y={levels:[[],[],[]]};for(var b in t)y[b]=t[b];return y.colormap=y.colormap||\"jet\",m.update(y),m}e.exports=f;var d=t(\"bit-twiddle\"),p=t(\"gl-buffer\"),g=t(\"gl-vao\"),v=t(\"gl-texture2d\"),m=t(\"typedarray-pool\"),y=t(\"colormap\"),b=t(\"ndarray-ops\"),x=t(\"ndarray-pack\"),_=t(\"ndarray\"),w=t(\"surface-nets\"),k=t(\"gl-mat4/multiply\"),A=t(\"gl-mat4/invert\"),M=t(\"binary-search-bounds\"),L=t(\"ndarray-gradient\"),_=t(\"ndarray\"),T=t(\"./lib/shaders\"),E=T.createShader,C=T.createContourShader,S=T.createPickShader,z=T.createPickContourShader,P=36,j=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],O=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],I=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;3>t;++t){var e=I[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var D=a.prototype;D.isTransparent=function(){return this.opacity<1},D.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;3>t;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},D.pickSlots=1,D.setPickBase=function(t){this.pickId=t};var R=[0,0,0],F={showSurface:!1,showContour:!1,projections:[j.slice(),j.slice(),j.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},N={model:j,view:j,projection:j,inverseModel:j.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},B=j.slice(),U=[1,0,0,0,1,0,0,0,1];D.draw=function(t){return s.call(this,t,!1)},D.drawTransparent=function(t){return s.call(this,t,!0)};var V={model:j,view:j,projection:j,inverseModel:j,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]};D.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=V;r.model=t.model||j,r.view=t.view||j,r.projection=t.projection||j,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=U;for(var n=0;2>n;++n)for(var i=r.clipBounds[n],a=0;3>a;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount);for(var n=0;3>n;++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;u.bind();for(var a=0;3>a;++a){e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=I[a];for(var n=0;n<this.contourLevels[a].length;++n)l.uniforms.height=this.contourLevels[a][n],u.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n])}for(var n=0;3>n;++n){l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n];for(var a=0;3>a;++a)if(this.contourProject[n][a]){l.uniforms.permutation=I[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)l.uniforms.height=this.contourLevels[a][c],u.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c])}}u.unbind()}},D.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>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;2>c;++c)for(var h=c?a:1-a,f=0;2>f;++f)for(var d=f?l:1-l,p=i+c,g=s+f,v=h*d,m=0;3>m;++m)u[m]+=this._field[m].get(p,g)*v;for(var y=this._pickResult.level,b=0;3>b;++b)if(y[b]=M.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][y[b]],_=this.contourLevels[b][y[b]+1];Math.abs(x-u[b])>Math.abs(_-u[b])&&(y[b]+=1)}r.index[0]=.5>a?i:i+1,r.index[1]=.5>l?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1];for(var m=0;3>m;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},D.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);var e=t.field||t.coords&&t.coords[2]||null;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&&(m.freeFloat(this._field[2].data),this._field[2].data=m.mallocFloat(d.nextPow2(r))),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 n=this.shape,a=0;2>a;++a)this._field[2].size>this._field[a].data.length&&(m.freeFloat(this._field[a].data),this._field[a].data=m.mallocFloat(this._field[2].size)),this._field[a]=_(this._field[a].data,[n[0]+2,n[1]+2]);if(t.coords){var o=t.coords;if(!Array.isArray(o)||3!==o.length)throw new Error(\"gl-surface: invalid coordinates for x/y\");for(var a=0;2>a;++a){for(var s=o[a],c=0;2>c;++c)if(s.shape[c]!==n[c])throw new Error(\"gl-surface: coords have incorrect shape\");l(this._field[a],s)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error(\"gl-surface: invalid ticks\");for(var a=0;2>a;++a){var p=f[a];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==n[a])throw new Error(\"gl-surface: invalid tick length\");var g=_(p.data,n);g.stride[a]=p.stride[0],g.stride[1^a]=0,l(this._field[a],g)}}else{for(var a=0;2>a;++a){var v=[0,0];v[a]=1,this._field[a]=_(this._field[a].data,[n[0]+2,n[1]+2],v,0)}this._field[0].set(0,0,0);for(var c=0;c<n[0];++c)this._field[0].set(c+1,0,c);this._field[0].set(n[0]+1,0,n[0]-1),this._field[1].set(0,0,0);for(var c=0;c<n[1];++c)this._field[1].set(0,c+1,c);this._field[1].set(0,n[1]+1,n[1]-1)}for(var y=this._field,b=(y[2].size,_(m.mallocFloat(3*y[2].size*2),[3,n[0]+2,n[1]+2,2])),a=0;3>a;++a)L(b.pick(a),y[a],\"mirror\");for(var x=_(m.mallocFloat(3*y[2].size),[n[0]+2,n[1]+2,3]),a=0;a<n[0]+2;++a)for(var c=0;c<n[1]+2;++c){var k=b.get(0,a,c,0),A=b.get(0,a,c,1),M=b.get(1,a,c,0),T=b.get(1,a,c,1),E=b.get(2,a,c,0),C=b.get(2,a,c,1),S=M*C-T*E,z=E*A-C*k,P=k*T-A*M,j=Math.sqrt(S*S+z*z+P*P);1e-8>j?(j=Math.max(Math.abs(S),Math.abs(z),Math.abs(P)),1e-8>j?(P=1,z=S=0,j=1):j=1/j):j=1/Math.sqrt(j),x.set(a,c,0,S*j),x.set(a,c,1,z*j),x.set(a,c,2,P*j)}m.free(b.data);for(var I=[1/0,1/0,1/0],D=[-(1/0),-(1/0),-(1/0)],R=(n[0]-1)*(n[1]-1)*6,F=m.mallocFloat(d.nextPow2(9*R)),N=0,B=0,a=0;a<n[0]-1;++a)t:for(var c=0;c<n[1]-1;++c){for(var U=0;2>U;++U)for(var V=0;2>V;++V)for(var q=0;3>q;++q){var H=this._field[q].get(1+a+U,1+c+V);if(isNaN(H)||!isFinite(H))continue t}for(var q=0;6>q;++q){var G=a+O[q][0],Y=c+O[q][1],W=this._field[0].get(G+1,Y+1),X=this._field[1].get(G+1,Y+1),H=this._field[2].get(G+1,Y+1),S=x.get(G+1,Y+1,0),z=x.get(G+1,Y+1,1),P=x.get(G+1,Y+1,2);F[N++]=G,F[N++]=Y,F[N++]=W,F[N++]=X,F[N++]=H,F[N++]=0,F[N++]=S,F[N++]=z,F[N++]=P,I[0]=Math.min(I[0],W),I[1]=Math.min(I[1],X),I[2]=Math.min(I[2],H),D[0]=Math.max(D[0],W),D[1]=Math.max(D[1],X),D[2]=Math.max(D[2],H),B+=1}}this._vertexCount=B,this._coordinateBuffer.update(F.subarray(0,N)),m.freeFloat(F),m.free(x.data),this.bounds=[I,D]}var Z=!1;if(\"levels\"in t){var Q=t.levels;Q=Array.isArray(Q[0])?Q.slice():[[],[],Q];for(var a=0;3>a;++a)Q[a]=Q[a].slice(),Q.sort(function(t,e){return t-e});t:for(var a=0;3>a;++a){if(Q[a].length!==this.contourLevels[a].length){Z=!0;break}for(var c=0;c<Q[a].length;++c)if(Q[a][c]!==this.contourLevels[a][c]){Z=!0;break t}}this.contourLevels=Q}if(Z){for(var y=this._field,n=this.shape,$=[],K=0;3>K;++K){for(var Q=this.contourLevels[K],J=[],tt=[],et=[0,0],a=0;a<Q.length;++a){var rt=w(this._field[K],Q[a]);J.push($.length/4|0);var B=0;t:for(var c=0;c<rt.cells.length;++c)for(var nt=rt.cells[c],q=0;2>q;++q){var it=rt.positions[nt[q]],at=it[0],ot=0|Math.floor(at),st=at-ot,lt=it[1],ut=0|Math.floor(lt),ct=lt-ut,ht=!1;e:for(var ft=0;2>ft;++ft){et[ft]=0;for(var dt=(K+ft+1)%3,U=0;2>U;++U)for(var pt=U?st:1-st,G=0|Math.min(Math.max(ot+U,0),n[0]),V=0;2>V;++V){var gt=V?ct:1-ct,Y=0|Math.min(Math.max(ut+V,0),n[1]),H=this._field[dt].get(G,Y);if(!isFinite(H)||isNaN(H)){ht=!0;break e}var vt=pt*gt;et[ft]+=vt*H}}if(ht){if(q>0){for(var mt=0;4>mt;++mt)$.pop();B-=1}continue t}$.push(et[0],et[1],it[0],it[1]),B+=1}tt.push(B)}this._contourOffsets[K]=J,this._contourCounts[K]=tt}for(var yt=m.mallocFloat($.length),a=0;a<$.length;++a)yt[a]=$[a];this._contourBuffer.update(yt),m.freeFloat(yt)}t.colormap&&this._colorMap.setPixels(i(t.colormap))},D.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;3>t;++t)m.freeFloat(this._field[t].data)},D.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;3>e;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=m.mallocFloat(12*i[0]*i[1]),o=0;3>o;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var s=(o+1)%3,l=(o+2)%3,u=this._field[o],c=this._field[s],h=this._field[l],f=w(u,r[o]),d=f.cells,p=f.positions;this._dynamicOffsets[o]=n;for(var e=0;e<d.length;++e)for(var g=d[e],v=0;2>v;++v){var y=p[g[v]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),k=b-x,A=1-k,M=+y[1],L=0|M,T=0|Math.min(L+1,i[1]),E=M-L,C=1-E,S=A*C,z=A*E,P=k*C,j=k*E,O=S*c.get(x,L)+z*c.get(x,T)+P*c.get(_,L)+j*c.get(_,T),I=S*h.get(x,L)+z*h.get(x,T)+P*h.get(_,L)+j*h.get(_,T);if(isNaN(O)||isNaN(I)){v&&(n-=1);break}a[2*n+0]=O,a[2*n+1]=I,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),m.freeFloat(a)}}},{\"./lib/shaders\":148,\"binary-search-bounds\":149,\"bit-twiddle\":33,colormap:40,\"gl-buffer\":59,\"gl-mat4/invert\":78,\"gl-mat4/multiply\":80,\"gl-texture2d\":162,\"gl-vao\":166,ndarray:189,\"ndarray-gradient\":150,\"ndarray-ops\":184,\"ndarray-pack\":155,\"surface-nets\":211,\"typedarray-pool\":217}],162:[function(t,e,r){\"use strict\";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],m=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],y=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(0>e||e>i||0>r||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 a(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 o(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 s(t,e,r,n,i,a,s,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=o(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\");var m=1;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}m=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 y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),h===a&&v)0===l.offset&&l.data.length===y?x?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):x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var _;_=a===t.FLOAT?g.mallocFloat32(y):g.mallocUint8(y);var w=d(_,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?b(w,l):p.assign(w,l),x?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,_.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,_.subarray(0,y)),a===t.FLOAT?g.freeFloat32(_):g.freeUint8(_)}}function l(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 u(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(0>e||e>o||0>r||r>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=l(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,s,e,r,n,i)}function c(t,e,r,n){var i=l(t);return t.texImage2D(t.TEXTURE_2D,0,r,r,n,e),new a(t,i,0|e.width,0|e.height,r,n)}function h(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 s=o(n,e.stride.slice()),u=0;\"float32\"===r?u=t.FLOAT:\"float64\"===r?(u=t.FLOAT,s=!1,r=\"float32\"):\"uint8\"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,s=!1,r=\"uint8\");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=d(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}}u!==t.FLOAT||t.getExtension(\"OES_texture_float\")||(u=t.UNSIGNED_BYTE,s=!1);var h,f,v=e.size;if(s)h=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var m=[n[2],n[2]*n[0],1];f=g.malloc(v,r);var y=d(f,n,m,0);\"float32\"!==r&&\"float64\"!==r||u!==t.UNSIGNED_BYTE?p.assign(y,e):b(y,e),h=f.subarray(0,v)}var x=l(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,u,h),s||g.free(f),new a(t,x,n[0],n[1],c,u)}function f(t){if(arguments.length<=1)throw new Error(\"gl-texture2d: Missing arguments for texture2d constructor\");if(v||n(t),\"number\"==typeof arguments[1])return u(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return u(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];if(e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)return c(t,e,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return h(t,e)}throw new Error(\"gl-texture2d: Invalid arguments for texture2d constructor\")}var d=t(\"ndarray\"),p=t(\"ndarray-ops\"),g=t(\"typedarray-pool\");e.exports=f;var v=null,m=null,y=null,b=function(t,e){p.muls(t,e,255)},x=a.prototype;Object.defineProperties(x,{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)),m.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)),m.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=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(),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;2>e;++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 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 i(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|t,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){\n",
"return t=0|t,i(this,this._shape[0],t),t}}}),x.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},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.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)},x.setPixels=function(t,e,r,n){var i=this.gl;if(this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0,t instanceof HTMLCanvasElement||t instanceof ImageData||t instanceof HTMLImageElement||t instanceof HTMLVideoElement){var a=this._mipLevels.indexOf(n)<0;a?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,t),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,r,this.format,this.type,t)}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||0>e||0>r)throw new Error(\"gl-texture2d: Texture dimensions are out of bounds\");s(i,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:189,\"ndarray-ops\":184,\"typedarray-pool\":217}],163:[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;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,u=!!a.normalized,c=a.stride||0,h=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,u,c,h)}else{if(\"number\"==typeof a)t.vertexAttrib1f(i,a);else if(1===a.length)t.vertexAttrib1f(i,a[0]);else if(2===a.length)t.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)t.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error(\"gl-vao: Invalid vertex attribute\");t.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}t.disableVertexAttribArray(i)}}for(;n>i;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var i=0;n>i;++i)t.disableVertexAttribArray(i)}}e.exports=n},{}],164:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var a=t(\"./do-bind.js\");n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{\"./do-bind.js\":163}],165:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function a(t,e){return new i(t,e,e.createVertexArrayOES())}var o=t(\"./do-bind.js\");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},i.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},i.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},i.prototype.update=function(t,e,r){if(this.bind(),o(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var a=t[i];\"number\"==typeof a?this._attribs.push(new n(i,1,a)):Array.isArray(a)&&this._attribs.push(new n(i,a.length,a[0],a[1],a[2],a[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=a},{\"./do-bind.js\":163}],166:[function(t,e,r){\"use strict\";function n(t,e,r,n){var o,s=t.getExtension(\"OES_vertex_array_object\");return o=s?i(t,s):a(t),o.update(e,r,n),o}var i=t(\"./lib/vao-native.js\"),a=t(\"./lib/vao-emulated.js\");e.exports=n},{\"./lib/vao-emulated.js\":164,\"./lib/vao-native.js\":165}],167:[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},{}],168:[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;t>=r;++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;t>=n;++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(i>=r)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;i>=c;++c)l[c]=c;0>o&&(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;i>=c;++c){for(var p=l.slice(),g=0;i>=g;++g)g===c&&(p[g]=-1);var v=p[0];p[0]=p[1],p[1]=v;var m=new n(p,new Array(i+1),!0);f[c]=m,d[c]=m}d[i+1]=h;for(var c=0;i>=c;++c)for(var p=f[c].vertices,y=f[c].adjacent,g=0;i>=g;++g){var b=p[g];if(0>b)y[g]=h;else for(var x=0;i>=x;++x)f[x].vertices.indexOf(b)<0&&(y[g]=f[x])}for(var _=new s(i,a,d),w=!!e,c=i+1;r>c;++c)_.insert(t[c],w);return _.boundary()}e.exports=l;var u=t(\"robust-orientation\"),c=t(\"simplicial-complex\").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var h=[],f=s.prototype;f.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;r>=l;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;r>=h;++h){var f=c[h];0>f?i[h]=e:i[h]=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;n>=c;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;n>=c;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var d=this.orient();if(a[c]=f,0>d){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,g=d.indexOf(r);if(!(0>g))for(var v=0;o>=v;++v)if(v!==g){var m=p[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var b=0,x=0;o>=x;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,m.boundary=!1,u.push(m),h.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var w=m.adjacent,k=d.slice(),A=p.slice(),M=new n(k,A,!0);c.push(M);var L=w.indexOf(e);if(!(0>L)){w[L]=M,A[g]=m,k[v]=-1,A[v]=e,p[v]=M,M.flip();for(var x=0;o>=x;++x){var T=k[x];if(!(0>T||T===r)){for(var E=new Array(o-1),C=0,S=0;o>=S;++S){var z=k[S];0>z||S===x||(E[C++]=z)}f.push(new i(E,M,x))}}}}}}f.sort(a);for(var v=0;v+1<f.length;v+=2){var P=f[v],j=f[v+1],O=P.index,I=j.index;0>O||0>I||(P.cell.adjacent[P.index]=j.cell,j.cell.adjacent[j.index]=P.cell)}},f.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;i>=o;++o){var s=n.vertices[o];0>s?a[o]=t:a[o]=r[s]}var l=this.orient(a);0>l||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},f.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;n>i;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,u=0,c=0;t>=c;++c)s[c]>=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\":195,\"simplicial-complex\":171}],169:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],170:[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;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n;var i=n.prototype;Object.defineProperty(i,\"length\",{get:function(){return this.roots.length}}),i.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},i.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},i.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],171:[function(t,e,r){\"use strict\";\"use restrict\";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;i>n;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;i>n;++n)for(var a=t[n],o=0,s=a.length;s>o;++o)e=r(e,a[o]);return e+1}function a(t){for(var e=new Array(t.length),r=0,n=t.length;n>r;++r)e[r]=t[r].slice(0);return e}function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:var a=t[0]+t[1]-e[0]-e[1];return a?a:i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),u=i(e[0],e[1]),a=i(l,t[2])-i(u,e[2]);return a?a:i(l+t[2],o)-i(u+e[2],s);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;r>f;++f)if(n=c[f]-h[f])return n;return 0}}function s(t,e){return o(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;r>i;++i)n[i]=[t[i],e[i]];n.sort(s);for(var i=0;r>i;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(o),t}function u(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;r>n;++n){var i=t[n];if(o(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;n>=r;){var a=r+n>>1,s=o(t[a],e);0>=s?(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;i>n;++n)r[n]=[];for(var a=[],n=0,s=e.length;s>n;++n)for(var l=e[n],u=l.length,h=1,f=1<<u;f>h;++h){a.length=b.popCount(h);for(var d=0,p=0;u>p;++p)h&1<<p&&(a[d++]=l[p]);var g=c(t,a);if(!(0>g))for(;;)if(r[g++].push(n),g>=t.length||0!==o(t[g],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;e>n;++n)r[n]=[];for(var n=0,i=t.length;i>n;++n)for(var a=t[n],o=0,s=a.length;s>o;++o)r[a[o]].push(n);return r}function d(t){for(var e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0|i.length,o=1,s=1<<a;s>o;++o){for(var u=[],c=0;a>c;++c)o>>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function p(t,e){if(0>e)return[];for(var r=[],n=(1<<e+1)-1,i=0;i<t.length;++i)for(var a=t[i],o=n;o<1<<a.length;o=b.nextCombination(o)){for(var s=new Array(e+1),u=0,c=0;c<a.length;++c)o&1<<c&&(s[u++]=a[c]);r.push(s)}return l(r)}function g(t){for(var e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;++a){for(var s=new Array(i.length-1),u=0,c=0;o>u;++u)u!==a&&(s[c++]=i[u]);e.push(s)}return l(e)}function v(t,e){for(var r=new x(e),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=a+1;o<i.length;++o)r.link(i[a],i[o]);for(var s=[],l=r.ranks,n=0;n<l.length;++n)l[n]=-1;for(var n=0;n<t.length;++n){var u=r.find(t[n][0]);l[u]<0?(l[u]=s.length,s.push([t[n].slice(0)])):s[l[u]].push(t[n].slice(0))}return s}function m(t){for(var e=u(l(p(t,0))),r=new x(e.length),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=c(e,[i[a]]),s=a+1;s<i.length;++s)r.link(o,c(e,[i[s]]));for(var h=[],f=r.ranks,n=0;n<f.length;++n)f[n]=-1;for(var n=0;n<t.length;++n){var d=r.find(c(e,[t[n][0]]));f[d]<0?(f[d]=h.length,h.push([t[n].slice(0)])):h[f[d]].push(t[n].slice(0))}return h}function y(t,e){return e?v(t,e):m(t)}var b=t(\"bit-twiddle\"),x=t(\"union-find\");r.dimension=n,r.countVertices=i,r.cloneCells=a,r.compareCells=o,r.normalize=l,r.unique=u,r.findCell=c,r.incidence=h,r.dual=f,r.explode=d,r.skeleton=p,r.boundary=g,r.connectedComponents=y},{\"bit-twiddle\":169,\"union-find\":170}],172:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],173:[function(t,e,r){\"use strict\";function n(t,e){function r(t){var e=!1;return\"altKey\"in t&&(e=e||t.altKey!==g.alt,g.alt=!!t.altKey),\"shiftKey\"in t&&(e=e||t.shiftKey!==g.shift,g.shift=!!t.shiftKey),\"ctrlKey\"in t&&(e=e||t.ctrlKey!==g.control,g.control=!!t.ctrlKey),\"metaKey\"in t&&(e=e||t.metaKey!==g.meta,g.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!==f||a!==d||o!==p||r(n))&&(f=0|t,d=a||0,p=o||0,e(f,d,p,g))}function a(t){n(0,t)}function o(){(f||d||p||g.shift||g.alt||g.meta||g.control)&&(d=p=0,f=0,g.shift=g.alt=g.control=g.meta=!1,e(0,0,0,g))}function s(t){r(t)&&e(f,d,p,g)}function l(t){0===i.buttons(t)?n(0,t):n(f,t)}function u(t){n(f|i.buttons(t),t)}function c(t){n(f&~i.buttons(t),t)}function h(){v||(v=!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)))}e||(e=t,t=window);var f=0,d=0,p=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;h();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return v},set:function(t){t&&h()},enumerable:!0},buttons:{get:function(){return f},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),m}e.exports=n;var i=t(\"mouse-event\")},{\"mouse-event\":174}],174:[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<<e-1}else if(\"button\"in t){var e=t.button;if(1===e)return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0}function i(t){return t.target||t.srcElement||window}function a(t){if(\"object\"==typeof t){if(\"offsetX\"in t)return t.offsetX;var e=i(t),r=e.getBoundingClientRect();return t.clientX-r.left}return 0}function o(t){if(\"object\"==typeof t){if(\"offsetY\"in t)return t.offsetY;var e=i(t),r=e.getBoundingClientRect();return t.clientY-r.top}return 0}r.buttons=n,r.element=i,r.x=a,r.y=o},{}],175:[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}},{}],176:[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\":175}],177:[function(t,e,r){\"use strict\";function n(t,e,r){\"function\"==typeof t&&(r=!!e,e=t,t=window);var n=i(\"ex\",t);t.addEventListener(\"wheel\",function(t){r&&t.preventDefault();var i=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=t.deltaMode,l=1;switch(s){case 1:l=n;break;case 2:l=window.innerHeight}return i*=l,a*=l,o*=l,i||a||o?e(i,a,o):void 0})}var i=t(\"to-px\");e.exports=n},{\"to-px\":176}],178:[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\":48}],179:[function(t,e,r){\"use strict\";function n(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:i(t,e);break;case 9:a(t,e);break;case 16:o(t,e);break;default:throw new Error(\"currently supports matrices up to 4x4\")}return t}e.exports=n;var i=t(\"gl-mat2/invert\"),a=t(\"gl-mat3/invert\"),o=t(\"gl-mat4/invert\")},{\"gl-mat2/invert\":180,\"gl-mat3/invert\":71,\"gl-mat4/invert\":78}],180:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}e.exports=n},{}],181:[function(t,e,r){\"use strict\";function n(t,e){var r=Math.floor(e),n=e-r,i=r>=0&&r<t.shape[0],a=r+1>=0&&r+1<t.shape[0],o=i?+t.get(r):0,s=a?+t.get(r+1):0;return(1-n)*o+n*s}function i(t,e,r){var n=Math.floor(e),i=e-n,a=n>=0&&n<t.shape[0],o=n+1>=0&&n+1<t.shape[0],s=Math.floor(r),l=r-s,u=s>=0&&s<t.shape[1],c=s+1>=0&&s+1<t.shape[1],h=a&&u?t.get(n,s):0,f=a&&c?t.get(n,s+1):0,d=o&&u?t.get(n+1,s):0,p=o&&c?t.get(n+1,s+1):0;return(1-l)*((1-i)*h+i*d)+l*((1-i)*f+i*p)}function a(t,e,r,n){var i=Math.floor(e),a=e-i,o=i>=0&&i<t.shape[0],s=i+1>=0&&i+1<t.shape[0],l=Math.floor(r),u=r-l,c=l>=0&&l<t.shape[1],h=l+1>=0&&l+1<t.shape[1],f=Math.floor(n),d=n-f,p=f>=0&&f<t.shape[2],g=f+1>=0&&f+1<t.shape[2],v=o&&c&&p?t.get(i,l,f):0,m=o&&h&&p?t.get(i,l+1,f):0,y=s&&c&&p?t.get(i+1,l,f):0,b=s&&h&&p?t.get(i+1,l+1,f):0,x=o&&c&&g?t.get(i,l,f+1):0,_=o&&h&&g?t.get(i,l+1,f+1):0,w=s&&c&&g?t.get(i+1,l,f+1):0,k=s&&h&&g?t.get(i+1,l+1,f+1):0;return(1-d)*((1-u)*((1-a)*v+a*y)+u*((1-a)*m+a*b))+d*((1-u)*((1-a)*x+a*w)+u*((1-a)*_+a*k))}function o(t){var e,r,n=0|t.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(e=0;n>e;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,u,c,h=0;t:for(e=0;1<<n>e;++e){for(u=1,c=t.offset,l=0;n>l;++l)if(e&1<<l){if(!s[l])continue t;u*=a[l],c+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;u*=1-a[l],c+=t.stride[l]*i[l]}h+=u*t.data[c]}return h}function s(t,e,r,s){switch(t.shape.length){case 0:return 0;case 1:return n(t,e);case 2:return i(t,e,r);case 3:return a(t,e,r,s);default:return o.apply(void 0,arguments)}}e.exports=s,e.exports.d1=n,e.exports.d2=i,e.exports.d3=a},{}],182:[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_12_arg4_)}\",args:[{name:\"_inline_12_arg0_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_12_arg1_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_12_arg2_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_12_arg3_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_12_arg4_\",lvalue:!1,rvalue:!0,count:1}],thisVars:[\"this_warped\"],localVars:[]},body:{body:\"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_.apply(void 0,this_warped)}\",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}],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_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0])}\",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:\"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_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1])}\",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:\"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_22_arg2_(this_warped,_inline_22_arg0_),_inline_22_arg1_=_inline_22_arg3_(_inline_22_arg4_,this_warped[0],this_warped[1],this_warped[2])}\",args:[{name:\"_inline_22_arg0_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_22_arg1_\",lvalue:!0,rvalue:!1,count:1},{name:\"_inline_22_arg2_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_22_arg3_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_22_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\":48,\"ndarray-linear-interpolate\":181}],183:[function(t,e,r){\"use strict\";function n(t,e,r){var n=e.dimension,o=a([],r);return i(t,e,function(t,e){for(var r=0;n>r;++r){t[r]=o[(n+1)*n+r];for(var i=0;n>i;++i)t[r]+=o[(n+1)*i+r]*e[i]}for(var a=o[(n+1)*(n+1)-1],i=0;n>i;++i)a+=o[(n+1)*i+n]*e[i];for(var s=1/a,r=0;n>r;++r)t[r]*=s;return t}),t}var i=t(\"ndarray-warp\"),a=t(\"gl-matrix-invert\");e.exports=n},{\"gl-matrix-invert\":179,\"ndarray-warp\":182}],184:[function(t,e,r){\"use strict\";function n(t){if(!t)return s;for(var e=0;e<t.args.length;++e){var r=t.args[e];0===e?t.args[e]={name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:t.args[e]={name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function i(t){return o({args:t.args,pre:n(t.pre),body:n(t.body),post:n(t.proc),funcName:t.funcName})}function a(t){for(var e=[],r=0;r<t.args.length;++r)e.push(\"a\"+r);var n=new Function(\"P\",[\"return function \",t.funcName,\"_ndarrayops(\",e.join(\",\"),\") {P(\",e.join(\",\"),\");return a0}\"].join(\"\"));return n(i(t))}var o=t(\"cwise-compiler\"),s={body:\"\",args:[],thisVars:[],localVars:[]},l={add:\"+\",sub:\"-\",mul:\"*\",div:\"/\",mod:\"%\",band:\"&\",bor:\"|\",bxor:\"^\",lshift:\"<<\",rshift:\">>\",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;t<h.length;++t){var e=h[t];r[e]=a({args:[\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(b)\",thisVars:[\"this_f\"]},funcName:e}),r[e+\"eq\"]=a({args:[\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\"],body:\"a=this_f(a)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"eq\"})}}();var f=[\"max\",\"min\",\"atan2\",\"pow\"];!function(){for(var t=0;t<f.length;++t){var e=f[t];r[e]=a({args:[\"array\",\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(b,c)\",thisVars:[\"this_f\"]},funcName:e}),r[e+\"s\"]=a({args:[\"array\",\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(b,c)\",thisVars:[\"this_f\"]},funcName:e+\"s\"}),r[e+\"eq\"]=a({args:[\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(a,b)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"eq\"}),r[e+\"seq\"]=a({args:[\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(a,b)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"seq\"})}}();var d=[\"atan2\",\"pow\"];!function(){for(var t=0;t<d.length;++t){var e=d[t];r[e+\"op\"]=a({args:[\"array\",\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(c,b)\",thisVars:[\"this_f\"]},funcName:e+\"op\"}),r[e+\"ops\"]=a({args:[\"array\",\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\",\"c\"],body:\"a=this_f(c,b)\",thisVars:[\"this_f\"]},funcName:e+\"ops\"}),r[e+\"opeq\"]=a({args:[\"array\",\"array\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(b,a)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"opeq\"}),r[e+\"opseq\"]=a({args:[\"array\",\"scalar\"],pre:{args:[],body:\"this_f=Math.\"+e,thisVars:[\"this_f\"]},body:{args:[\"a\",\"b\"],body:\"a=this_f(b,a)\",thisVars:[\"this_f\"]},rvalue:!0,count:2,funcName:e+\"opseq\"})}}(),r.any=o({args:[\"array\"],pre:s,body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:1}],body:\"if(a){return true}\",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:\"return false\"},funcName:\"any\"}),r.all=o({args:[\"array\"],pre:s,body:{args:[{name:\"x\",lvalue:!1,rvalue:!0,count:1}],body:\"if(!x){return false}\",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:\"return true\"},funcName:\"all\"}),r.sum=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:1}],body:\"this_s+=a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"sum\"}),r.prod=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=1\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:1}],body:\"this_s*=a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"prod\"}),r.norm2squared=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:2}],body:\"this_s+=a*a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return this_s\"},funcName:\"norm2squared\"}),r.norm2=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:2}],body:\"this_s+=a*a\",localVars:[],thisVars:[\"this_s\"]},post:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"return Math.sqrt(this_s)\"},funcName:\"norm2\"}),r.norminf=o({args:[\"array\"],pre:{args:[],localVars:[],thisVars:[\"this_s\"],body:\"this_s=0\"},body:{args:[{name:\"a\",lvalue:!1,rvalue:!0,count:4}],body:\"if(-a>this_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_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.argmin=o({args:[\"index\",\"array\",\"shape\"],pre:{body:\"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}\",args:[{name:\"_inline_0_arg0_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg1_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg2_\",lvalue:!1,rvalue:!0,count:1}],thisVars:[\"this_i\",\"this_v\"],localVars:[]},body:{body:\"{if(_inline_1_arg1_<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.argmax=o({args:[\"index\",\"array\",\"shape\"],pre:{body:\"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}\",args:[{name:\"_inline_0_arg0_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg1_\",lvalue:!1,rvalue:!1,count:0},{name:\"_inline_0_arg2_\",lvalue:!1,rvalue:!0,count:1}],thisVars:[\"this_i\",\"this_v\"],localVars:[]},body:{body:\"{if(_inline_1_arg1_>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]}}}\",\n",
"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\":185}],185:[function(t,e,r){arguments[4][49][0].apply(r,arguments)},{\"./lib/thunk.js\":187,dup:49}],186:[function(t,e,r){arguments[4][50][0].apply(r,arguments)},{dup:50,uniq:188}],187:[function(t,e,r){arguments[4][51][0].apply(r,arguments)},{\"./compile.js\":186,dup:51}],188:[function(t,e,r){arguments[4][52][0].apply(r,arguments)},{dup:52}],189:[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;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(n);var i=new Array(r.length);for(t=0;t<i.length;++t)i[t]=r[t][1];return i}function a(t,e){var r=[\"View\",e,\"d\",t].join(\"\");0>e&&(r=\"View_Nil\"+t);var n=\"generic\"===t;if(-1===e){var a=\"function \"+r+\"(a){this.data=a;};var proto=\"+r+\".prototype;proto.dtype='\"+t+\"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new \"+r+\"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_\"+r+\"(a){return new \"+r+\"(a);}\",o=new Function(a);return o()}if(0===e){var a=\"function \"+r+\"(a,d) {this.data = a;this.offset = d};var proto=\"+r+\".prototype;proto.dtype='\"+t+\"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function \"+r+\"_copy() {return new \"+r+\"(this.data,this.offset)};proto.pick=function \"+r+\"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function \"+r+\"_get(){return \"+(n?\"this.data.get(this.offset)\":\"this.data[this.offset]\")+\"};proto.set=function \"+r+\"_set(v){return \"+(n?\"this.data.set(this.offset,v)\":\"this.data[this.offset]=v\")+\"};return function construct_\"+r+\"(a,b,c,d){return new \"+r+\"(a,d)}\",o=new Function(\"TrivialArray\",a);return o(h[t][0])}var a=[\"'use strict'\"],s=l(e),u=s.map(function(t){return\"i\"+t}),c=\"this.offset+\"+s.map(function(t){return\"this.stride[\"+t+\"]*i\"+t}).join(\"+\"),f=s.map(function(t){return\"b\"+t}).join(\",\"),d=s.map(function(t){return\"c\"+t}).join(\",\");a.push(\"function \"+r+\"(a,\"+f+\",\"+d+\",d){this.data=a\",\"this.shape=[\"+f+\"]\",\"this.stride=[\"+d+\"]\",\"this.offset=d|0}\",\"var proto=\"+r+\".prototype\",\"proto.dtype='\"+t+\"'\",\"proto.dimension=\"+e),a.push(\"Object.defineProperty(proto,'size',{get:function \"+r+\"_size(){return \"+s.map(function(t){return\"this.shape[\"+t+\"]\"}).join(\"*\"),\"}})\"),1===e?a.push(\"proto.order=[0]\"):(a.push(\"Object.defineProperty(proto,'order',{get:\"),4>e?(a.push(\"function \"+r+\"_order(){\"),2===e?a.push(\"return (Math.abs(this.stride[0])>Math.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+\"]\"}),g=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(\",\")+\",\"+g.join(\",\"));for(var v=0;e>v;++v)a.push(\"if(typeof i\"+v+\"==='number'&&i\"+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;e>v;++v)a.push(\"if(typeof i\"+v+\"==='number'){d=i\"+v+\"|0;if(d<0){c+=b\"+v+\"*(a\"+v+\"-1);a\"+v+\"=ceil(-a\"+v+\"/d)}else{a\"+v+\"=ceil(a\"+v+\"/d)}b\"+v+\"*=d}\");a.push(\"return new \"+r+\"(this.data,\"+s.map(function(t){return\"a\"+t}).join(\",\")+\",\"+s.map(function(t){return\"b\"+t}).join(\",\")+\",c)}\");for(var m=new Array(e),y=new Array(e),v=0;e>v;++v)m[v]=\"a[i\"+v+\"]\",y[v]=\"b[i\"+v+\"]\";a.push(\"proto.transpose=function \"+r+\"_transpose(\"+u+\"){\"+u.map(function(t,e){return t+\"=(\"+t+\"===undefined?\"+e+\":\"+t+\"|0)\"}).join(\";\"),\"var a=this.shape,b=this.stride;return new \"+r+\"(this.data,\"+m.join(\",\")+\",\"+y.join(\",\")+\",this.offset)}\"),a.push(\"proto.pick=function \"+r+\"_pick(\"+u+\"){var a=[],b=[],c=this.offset\");for(var v=0;e>v;++v)a.push(\"if(typeof i\"+v+\"==='number'&&i\"+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;s>l;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var c=o(t),f=h[c];f.length<=s+1;)f.push(a(c,f.length-1));var i=f[s+1];return i(t,e,r,n)}var l=t(\"iota-array\"),u=t(\"is-buffer\"),c=\"undefined\"!=typeof Float64Array,h={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{\"iota-array\":190,\"is-buffer\":172}],190:[function(t,e,r){\"use strict\";function n(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=r;return e}e.exports=n},{}],191:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}],192:[function(t,e,r){\"use strict\";function n(t){for(var e=\"robustLinearSolve\"+t+\"d\",r=[\"function \",e,\"(A,b){return [\"],n=0;t>n;++n){r.push(\"det([\");for(var i=0;t>i;++i){i>0&&r.push(\",\"),r.push(\"[\");for(var a=0;t>a;++a)a>0&&r.push(\",\"),a===n?r.push(\"+b[\",i,\"]\"):r.push(\"+A[\",i,\"][\",a,\"]\");r.push(\"]\")}r.push(\"]),\")}r.push(\"det(A)]}return \",e);var o=new Function(\"det\",r.join(\"\"));return o(6>t?s[t]:s)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}function o(){for(;u.length<l;)u.push(n(u.length));for(var t=[],r=[\"function dispatchLinearSolve(A,b){switch(A.length){\"],i=0;l>i;++i)t.push(\"s\"+i),r.push(\"case \",i,\":return s\",i,\"(A,b);\");r.push(\"}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve\"),t.push(\"CACHE\",\"g\",r.join(\"\"));var a=Function.apply(void 0,t);e.exports=a.apply(void 0,u.concat([u,n]));for(var i=0;l>i;++i)e.exports[i]=u[i]}var s=t(\"robust-determinant\"),l=6,u=[i,a];o()},{\"robust-determinant\":194}],193:[function(t,e,r){\"use strict\";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=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;e>i;++i){var a=t[i],o=r;r=a+o;var s=r-a,l=o-s;l&&(t[u++]=l)}return t[u++]=r,t.length=u,t}e.exports=n},{}],194:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;t>r;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=[\"m[\",r,\"][\",n,\"]\"].join(\"\")}return e}function a(t){return 1&t?\"-\":\"\"}function o(t){if(1===t.length)return t[0];if(2===t.length)return[\"sum(\",t[0],\",\",t[1],\")\"].join(\"\");var e=t.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;r<t.length;++r)e.push([\"scale(\",s(n(t,r)),\",\",a(r),t[0][r],\")\"].join(\"\"));return o(e)}function l(t){var e=new Function(\"sum\",\"scale\",\"prod\",\"compress\",[\"function robustDeterminant\",t,\"(m){return compress(\",s(i(t)),\")};return robustDeterminant\",t].join(\"\"));return e(h,f,c,d)}function u(){for(;g.length<p;)g.push(l(g.length));for(var t=[],r=[\"function robustDeterminant(m){switch(m.length){\"],n=0;p>n;++n)t.push(\"det\"+n),r.push(\"case \",n,\":return det\",n,\"(m);\");r.push(\"}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant\"),t.push(\"CACHE\",\"gen\",r.join(\"\"));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,g.concat([g,l]));for(var n=0;n<g.length;++n)e.exports[n]=g[n]}var c=t(\"two-product\"),h=t(\"robust-sum\"),f=t(\"robust-scale\"),d=t(\"robust-compress\"),p=6,g=[function(){return[0]},function(t){return[t[0][0]]}];u()},{\"robust-compress\":193,\"robust-scale\":196,\"robust-sum\":198,\"two-product\":215}],195:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;t>r;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=[\"m\",n,\"[\",t-r-1,\"]\"].join(\"\")}return e}function a(t){return 1&t?\"-\":\"\"}function o(t){if(1===t.length)return t[0];if(2===t.length)return[\"sum(\",t[0],\",\",t[1],\")\"].join(\"\");var e=t.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;r<t.length;++r)e.push([\"scale(\",o(s(n(t,r))),\",\",a(r),t[0][r],\")\"].join(\"\"));return e}function l(t){for(var e=[],r=[],a=i(t),l=[],u=0;t>u;++u)0===(1&u)?e.push.apply(e,s(n(a,u))):r.push.apply(r,s(n(a,u))),l.push(\"m\"+u);var c=o(e),g=o(r),v=\"orientation\"+t+\"Exact\",m=[\"function \",v,\"(\",l.join(),\"){var p=\",c,\",n=\",g,\",d=sub(p,n);return d[d.length-1];};return \",v].join(\"\"),y=new Function(\"sum\",\"prod\",\"scale\",\"sub\",m);return y(f,h,d,p)}function u(t){var e=_[t.length];return e||(e=_[t.length]=l(t.length)),e.apply(void 0,t)}function c(){for(;_.length<=g;)_.push(l(_.length));for(var t=[],r=[\"slow\"],n=0;g>=n;++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;g>=n;++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;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation\"),r.push(i.join(\"\"));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[u].concat(_));for(var n=0;g>=n;++n)e.exports[n]=_[n]}var h=t(\"two-product\"),f=t(\"robust-sum\"),d=t(\"robust-scale\"),p=t(\"robust-subtract\"),g=5,v=1.1102230246251565e-16,m=(3+16*v)*v,y=(7+56*v)*v,b=l(3),x=l(4),_=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(0>=a)return o;n=i+a}else{if(!(0>i))return o;if(a>=0)return o;n=-(i+a)}var s=m*n;return o>=s||-s>=o?o:b(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,g=o*s,v=i*u,m=i*l,b=a*s,_=c*(d-p)+h*(g-v)+f*(m-b),w=(Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(g)+Math.abs(v))*Math.abs(h)+(Math.abs(m)+Math.abs(b))*Math.abs(f),k=y*w;return _>k||-_>k?_:x(t,e,r,n)}];c()},{\"robust-scale\":196,\"robust-subtract\":197,\"robust-sum\":198,\"two-product\":215}],196:[function(t,e,r){\"use strict\";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;r>c;++c){i(t[c],e,l);var h=s[1];a(h,l[0],s),s[0]&&(o[u++]=s[0]);var f=l[1],d=s[1],p=f+d,g=p-f,v=d-g;s[1]=p,v&&(o[u++]=v)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}var i=t(\"two-product\"),a=t(\"two-sum\");e.exports=n},{\"two-product\":215,\"two-sum\":216}],197:[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),g=-e[h],v=f(g);v>p?(o=d,c+=1,r>c&&(d=t[c],p=f(d))):(o=g,h+=1,i>h&&(g=-e[h],v=f(g))),r>c&&v>p||h>=i?(a=d,c+=1,r>c&&(d=t[c],p=f(d))):(a=g,h+=1,i>h&&(g=-e[h],v=f(g)));for(var m,y,b,x,_,w=a+o,k=w-a,A=o-k,M=A,L=w;r>c&&i>h;)v>p?(a=d,c+=1,r>c&&(d=t[c],p=f(d))):(a=g,h+=1,i>h&&(g=-e[h],v=f(g))),o=M,w=a+o,k=w-a,A=o-k,A&&(l[u++]=A),m=L+w,y=m-L,b=m-y,x=w-y,_=L-b,M=_+x,L=m;for(;r>c;)a=d,o=M,w=a+o,k=w-a,A=o-k,A&&(l[u++]=A),m=L+w,y=m-L,b=m-y,x=w-y,_=L-b,M=_+x,L=m,c+=1,r>c&&(d=t[c]);for(;i>h;)a=g,o=M,w=a+o,k=w-a,A=o-k,A&&(l[u++]=A),m=L+w,y=m-L,b=m-y,x=w-y,_=L-b,M=_+x,L=m,h+=1,i>h&&(g=-e[h]);return M&&(l[u++]=M),L&&(l[u++]=L),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],198:[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),g=e[h],v=f(g);v>p?(o=d,c+=1,r>c&&(d=t[c],p=f(d))):(o=g,h+=1,i>h&&(g=e[h],v=f(g))),r>c&&v>p||h>=i?(a=d,c+=1,r>c&&(d=t[c],p=f(d))):(a=g,h+=1,i>h&&(g=e[h],v=f(g)));for(var m,y,b,x,_,w=a+o,k=w-a,A=o-k,M=A,L=w;r>c&&i>h;)v>p?(a=d,c+=1,r>c&&(d=t[c],p=f(d))):(a=g,h+=1,i>h&&(g=e[h],v=f(g))),o=M,w=a+o,k=w-a,A=o-k,A&&(l[u++]=A),m=L+w,y=m-L,b=m-y,x=w-y,_=L-b,M=_+x,L=m;for(;r>c;)a=d,o=M,w=a+o,k=w-a,A=o-k,A&&(l[u++]=A),m=L+w,y=m-L,b=m-y,x=w-y,_=L-b,M=_+x,L=m,c+=1,r>c&&(d=t[c]);for(;i>h;)a=g,o=M,w=a+o,k=w-a,A=o-k,A&&(l[u++]=A),m=L+w,y=m-L,b=m-y,x=w-y,_=L-b,M=_+x,L=m,h+=1,i>h&&(g=e[h]);return M&&(l[u++]=M),L&&(l[u++]=L),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],199:[function(t,e,r){\"use strict\";function n(t){return t.split(\"\").map(function(t){return t in i?i[t]:\"\"}).join(\"\")}e.exports=n;var i={\" \":\" \",0:\"\\u2070\",1:\"\\xb9\",2:\"\\xb2\",3:\"\\xb3\",4:\"\\u2074\",5:\"\\u2075\",6:\"\\u2076\",7:\"\\u2077\",8:\"\\u2078\",9:\"\\u2079\",\"+\":\"\\u207a\",\"-\":\"\\u207b\",a:\"\\u1d43\",b:\"\\u1d47\",c:\"\\u1d9c\",d:\"\\u1d48\",e:\"\\u1d49\",f:\"\\u1da0\",g:\"\\u1d4d\",h:\"\\u02b0\",i:\"\\u2071\",j:\"\\u02b2\",k:\"\\u1d4f\",l:\"\\u02e1\",m:\"\\u1d50\",n:\"\\u207f\",o:\"\\u1d52\",p:\"\\u1d56\",r:\"\\u02b3\",s:\"\\u02e2\",t:\"\\u1d57\",u:\"\\u1d58\",v:\"\\u1d5b\",w:\"\\u02b7\",x:\"\\u02e3\",y:\"\\u02b8\",z:\"\\u1dbb\"}},{}],200:[function(t,e,r){\"use strict\";function n(t){return\"a\"+t}function i(t){return\"d\"+t}function a(t,e){return\"c\"+t+\"_\"+e}function o(t){return\"s\"+t}function s(t,e){return\"t\"+t+\"_\"+e}function l(t){return\"o\"+t}function u(t){return\"x\"+t}function c(t){return\"p\"+t}function h(t,e){return\"d\"+t+\"_\"+e}function f(t){return\"i\"+t}function d(t,e){return\"u\"+t+\"_\"+e}function p(t){return\"b\"+t}function g(t){return\"y\"+t}function v(t){return\"e\"+t}function m(t){return\"v\"+t}function y(t,e,r){for(var n=0,i=0;t>i;++i)e&1<<i&&(n|=1<<r[i]);return n}function b(t,e,r,b,x,E){function C(t,e){F.push(\"for(\",f(x[t]),\"=\",e,\";\",f(x[t]),\"<\",o(x[t]),\";\",\"++\",f(x[t]),\"){\")}function S(t){for(var e=0;I>e;++e)F.push(c(e),\"+=\",d(e,x[t]),\";\");F.push(\"}\")}function z(t){for(var e=t-1;e>=0;--e)C(e,0);for(var r=[],e=0;I>e;++e)E[e]?r.push(i(e)+\".get(\"+c(e)+\")\"):r.push(i(e)+\"[\"+c(e)+\"]\");for(var e=0;b>e;++e)r.push(u(e));F.push(k,\"[\",L,\"++]=phase(\",r.join(),\");\");for(var e=0;t>e;++e)S(e);for(var n=0;I>n;++n)F.push(c(n),\"+=\",d(n,x[t]),\";\")}function P(t){for(var e=0;I>e;++e)E[e]?F.push(a(e,0),\"=\",i(e),\".get(\",c(e),\");\"):F.push(a(e,0),\"=\",i(e),\"[\",c(e),\"];\");for(var r=[],e=0;I>e;++e)r.push(a(e,0));for(var e=0;b>e;++e)r.push(u(e));F.push(p(0),\"=\",k,\"[\",L,\"]=phase(\",r.join(),\");\");for(var n=1;1<<D>n;++n)F.push(p(n),\"=\",k,\"[\",L,\"+\",v(n),\"];\");for(var o=[],n=1;1<<D>n;++n)o.push(\"(\"+p(0)+\"!==\"+p(n)+\")\");F.push(\"if(\",o.join(\"||\"),\"){\");for(var s=[],e=0;D>e;++e)s.push(f(e));for(var e=0;I>e;++e){s.push(a(e,0));for(var n=1;1<<D>n;++n)E[e]?F.push(a(e,n),\"=\",i(e),\".get(\",c(e),\"+\",h(e,n),\");\"):F.push(a(e,n),\"=\",i(e),\"[\",c(e),\"+\",h(e,n),\"];\"),s.push(a(e,n))}for(var e=0;1<<D>e;++e)s.push(p(e));for(var e=0;b>e;++e)s.push(u(e));F.push(\"vertex(\",s.join(),\");\",m(0),\"=\",w,\"[\",L,\"]=\",A,\"++;\");for(var l=(1<<D)-1,d=p(l),n=0;D>n;++n)if(0===(t&~(1<<n))){for(var g=l^1<<n,y=p(g),x=[],_=g;_>0;_=_-1&g)x.push(w+\"[\"+L+\"+\"+v(_)+\"]\");x.push(m(0));for(var _=0;I>_;++_)1&n?x.push(a(_,l),a(_,g)):x.push(a(_,g),a(_,l));1&n?x.push(d,y):x.push(y,d);for(var _=0;b>_;++_)x.push(u(_));F.push(\"if(\",d,\"!==\",y,\"){\",\"face(\",x.join(),\")}\")}F.push(\"}\",L,\"+=1;\")}function j(){for(var t=1;1<<D>t;++t)F.push(T,\"=\",v(t),\";\",v(t),\"=\",g(t),\";\",g(t),\"=\",T,\";\")}function O(t,e){if(0>t)return void P(e);z(t),F.push(\"if(\",o(x[t]),\">0){\",f(x[t]),\"=1;\"),O(t-1,e|1<<x[t]);for(var r=0;I>r;++r)F.push(c(r),\"+=\",d(r,x[t]),\";\");t===D-1&&(F.push(L,\"=0;\"),j()),C(t,2),O(t-1,e),t===D-1&&(F.push(\"if(\",f(x[D-1]),\"&1){\",L,\"=0;}\"),j()),S(t),F.push(\"}\")}var I=E.length,D=x.length;if(2>D)throw new Error(\"ndarray-extract-contour: Dimension must be at least 2\");for(var R=\"extractContour\"+x.join(\"_\"),F=[],N=[],B=[],U=0;I>U;++U)B.push(n(U));for(var U=0;b>U;++U)B.push(u(U));for(var U=0;D>U;++U)N.push(o(U)+\"=\"+n(0)+\".shape[\"+U+\"]|0\");for(var U=0;I>U;++U){N.push(i(U)+\"=\"+n(U)+\".data\",l(U)+\"=\"+n(U)+\".offset|0\");for(var V=0;D>V;++V)N.push(s(U,V)+\"=\"+n(U)+\".stride[\"+V+\"]|0\")}for(var U=0;I>U;++U){N.push(c(U)+\"=\"+l(U)),N.push(a(U,0));for(var V=1;1<<D>V;++V){for(var q=[],H=0;D>H;++H)V&1<<H&&q.push(\"-\"+s(U,H));N.push(h(U,V)+\"=(\"+q.join(\"\")+\")|0\"),N.push(a(U,V)+\"=0\")}}for(var U=0;I>U;++U)for(var V=0;D>V;++V){var G=[s(U,x[V])];V>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;D>U;++U)N.push(f(U)+\"=0\");N.push(A+\"=0\");for(var Y=[\"2\"],U=D-2;U>=0;--U)Y.push(o(x[U]));N.push(M+\"=(\"+Y.join(\"*\")+\")|0\",k+\"=mallocUint32(\"+M+\")\",w+\"=mallocUint32(\"+M+\")\",L+\"=0\"),N.push(p(0)+\"=0\");for(var V=1;1<<D>V;++V){for(var W=[],X=[],H=0;D>H;++H)V&1<<H&&(0===X.length?W.push(\"1\"):W.unshift(X.join(\"*\"))),X.push(o(x[H]));var Z=\"\";W[0].indexOf(o(x[D-2]))<0&&(Z=\"-\");var Q=y(D,V,x);N.push(v(Q)+\"=(-\"+W.join(\"-\")+\")|0\",g(Q)+\"=(\"+Z+W.join(\"-\")+\")|0\",p(Q)+\"=0\")}N.push(m(0)+\"=0\",T+\"=0\"),O(D-1,0),F.push(\"freeUint32(\",w,\");freeUint32(\",k,\");\");var $=[\"'use strict';\",\"function \",R,\"(\",B.join(),\"){\",\"var \",N.join(),\";\",F.join(\"\"),\"}\",\"return \",R].join(\"\"),K=new Function(\"vertex\",\"face\",\"phase\",\"mallocUint32\",\"freeUint32\",$);return K(t,e,r,_.mallocUint32,_.freeUint32)}function x(t){function e(t){throw new Error(\"ndarray-extract-contour: \"+t)}\"object\"!=typeof t&&e(\"Must specify arguments\");var r=t.order;Array.isArray(r)||e(\"Must specify order\");var n=t.arrayArguments||1;1>n&&e(\"Must have at least one array argument\");var i=t.scalarArguments||0;0>i&&e(\"Scalar arg count must be > 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;n>s;++s)a.indexOf(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\",k=\"P\",A=\"N\",M=\"Q\",L=\"X\",T=\"T\"},{\"typedarray-pool\":217}],201:[function(t,e,r){function n(t){if(0>t)return Number(\"0/0\");for(var e=s[0],r=s.length-1;r>0;--r)e+=s[r]/(t+r);var n=t+o+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=7,a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],o=607/128,s=[.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 l(t){if(.5>t)return Math.PI/(Math.sin(Math.PI*t)*l(1-t));if(t>100)return Math.exp(n(t));t-=1;for(var e=a[0],r=1;i+2>r;r++)e+=a[r]/(t+r);var o=t+i+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,t+.5)*Math.exp(-o)*e},e.exports.log=n},{}],202:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(i>e){for(var r=1,n=0;e>n;++n)for(var o=0;n>o;++o)if(t[n]<t[o])r=-r;else if(t[n]===t[o])return 0;return r}for(var s=a.mallocUint8(e),n=0;e>n;++n)s[n]=0;for(var r=1,n=0;e>n;++n)if(!s[n]){var l=1;s[n]=1;for(var o=t[n];o!==n;o=t[o]){if(s[o])return a.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return a.freeUint8(s),r}e.exports=n;var i=32,a=t(\"typedarray-pool\")},{\"typedarray-pool\":217}],203:[function(t,e,r){\"use strict\";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),u=0;for(o(t,l),i=0;e>i;++i)s[i]=t[i];for(i=e-1;i>0;--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?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;t>a;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--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\":204,\"typedarray-pool\":217}],204:[function(t,e,r){\"use strict\";function n(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}e.exports=n},{}],205:[function(t,e,r){\"use strict\";function n(t){if(0>t)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),r=[],n=0;e>n;++n){for(var s=i.unrank(t,n),l=[0],u=0,c=0;c<s.length;++c)u+=1<<s[c],l.push(u);a(s)<1&&(l[0]=u,l[t]=0),r.push(l)}return r}e.exports=n;var i=t(\"permutation-rank\"),a=t(\"permutation-parity\"),o=t(\"gamma\")},{gamma:201,\"permutation-parity\":202,\"permutation-rank\":203}],206:[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\":207}],207:[function(t,e,r){arguments[4][49][0].apply(r,arguments)},{\"./lib/thunk.js\":209,dup:49}],208:[function(t,e,r){arguments[4][50][0].apply(r,arguments)},{dup:50,uniq:218}],209:[function(t,e,r){arguments[4][51][0].apply(r,arguments)},{\"./compile.js\":208,dup:51}],210:[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\":206}],211:[function(t,e,r){\"use strict\";function n(t,e){var r=t.length,n=[\"'use strict';\"],i=\"surfaceNets\"+t.join(\"_\")+\"d\"+e;n.push(\"var contour=genContour({\",\"order:[\",t.join(),\"],\",\"scalarArguments: 3,\",\"phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },\"),\"generic\"===e&&n.push(\"getters:[0],\");for(var a=[],l=[],u=0;r>u;++u)a.push(\"d\"+u),l.push(\"d\"+u);for(var u=0;1<<r>u;++u)a.push(\"v\"+u),l.push(\"v\"+u);for(var u=0;1<<r>u;++u)a.push(\"p\"+u),l.push(\"p\"+u);a.push(\"a\",\"b\",\"c\"),l.push(\"a\",\"c\"),n.push(\"vertex:function vertexFunc(\",a.join(),\"){\");for(var c=[],u=0;1<<r>u;++u)c.push(\"(p\"+u+\"<<\"+u+\")\");n.push(\"var m=(\",c.join(\"+\"),\")|0;if(m===0||m===\",(1<<(1<<r))-1,\"){return}\");var h=[],f=[];128>=1<<(1<<r)?(n.push(\"switch(m){\"),f=n):n.push(\"switch(m>>>7){\");for(var u=0;1<<(1<<r)>u;++u){if(1<<(1<<r)>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),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;r>b;++b)p[b]=[],g[b]=[],v[b]=0,m[b]=0;for(var b=0;1<<r>b;++b)for(var x=0;r>x;++x){var _=b^1<<x;if(!(_>b)&&!(u&1<<_)!=!(u&1<<b)){var w=1;u&1<<_?g[x].push(\"v\"+_+\"-v\"+b):(g[x].push(\"v\"+b+\"-v\"+_),w=-w),0>w?(p[x].push(\"-v\"+b+\"-v\"+_),v[x]+=2):(p[x].push(\"v\"+b+\"+v\"+_),v[x]-=2),y+=1;for(var k=0;r>k;++k)k!==x&&(_&1<<k?m[k]+=1:m[k]-=1)}}for(var A=[],x=0;r>x;++x)if(0===p[x].length)A.push(\"d\"+x+\"-0.5\");else{var M=\"\";v[x]<0?M=v[x]+\"*c\":v[x]>0&&(M=\"+\"+v[x]+\"*c\");var L=.5*(p[x].length/y),T=.5+.5*(m[x]/y);A.push(\"d\"+x+\"-\"+T+\"-\"+L+\"*(\"+p[x].join(\"+\")+M+\")/(\"+g[x].join(\"+\")+\")\")}f.push(\"a.push([\",A.join(),\"]);\",\"break;\")}n.push(\"}},\"),h.length>0&&f.push(\"}}\");for(var E=[],u=0;1<<r-1>u;++u)E.push(\"v\"+u);E.push(\"c0\",\"c1\",\"p0\",\"p1\",\"a\",\"b\",\"c\"),n.push(\"cell:function cellFunc(\",E.join(),\"){\");var C=s(r-1);n.push(\"if(p0){b.push(\",C.map(function(t){return\"[\"+t.map(function(t){return\"v\"+t})+\"]\"}).join(),\")}else{b.push(\",C.map(function(t){var e=t.slice();return e.reverse(),\"[\"+e.map(function(t){return\"v\"+t})+\"]\"}).join(),\")}}});function \",i,\"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return \",i,\";\");for(var u=0;u<h.length;++u)n.push(h[u].join(\"\"));var S=new Function(\"genContour\",n.join(\"\"));return S(o)}function i(t,e){for(var r=l(t,e),n=r.length,i=new Array(n),a=new Array(n),o=0;n>o;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+\"-\"+t.dtype,a=u[r],e=+e||0;return a||(a=u[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t(\"ndarray-extract-contour\"),s=t(\"triangulate-hypercube\"),l=t(\"zero-crossings\"),u={}},{\"ndarray-extract-contour\":200,\"triangulate-hypercube\":205,\"zero-crossings\":210}],212:[function(t,e,r){(function(r){\"use strict\";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o<e.length;++o)for(var s=e[o],l=0;3>l;++l){var u=r[s[l]];n[i++]=u[0],n[i++]=u[1]+1.4,a=Math.max(u[0],a)}return{data:n,shape:a}}function i(t,e){var r=s[t];r||(r=s[t]={\" \":{data:new Float32Array(0),shape:.2}});var o=r[e];if(!o)if(e.length<=1||!/\\d/.test(e))o=r[e]=n(a(e,{triangles:!0,font:t,textAlign:\"left\",textBaseline:\"alphabetic\"}));else{for(var l=e.split(/(\\d|\\s)/),u=new Array(l.length),c=0,h=0,f=0;f<l.length;++f)u[f]=i(t,l[f]),c+=u[f].data.length,h+=u[f].shape,f>0&&(h+=.02);for(var d=new Float32Array(c),p=0,g=-.5*h,f=0;f<u.length;++f){for(var v=u[f].data,m=0;m<v.length;m+=2)d[p++]=v[m]+g,d[p++]=v[m+1];g+=u[f].shape+.02}o=r[e]={data:d,shape:h}}return o}e.exports=i;var a=t(\"vectorize-text\"),o=window||r.global||{},s=o.__TEXT_CACHE||{};o.__TEXT_CACHE={}}).call(this,t(\"_process\"))},{_process:38,\"vectorize-text\":219}],213:[function(e,r,n){!function(){function e(t,r){if(t=t?t:\"\",r=r||{},t instanceof e)return t;if(!(this instanceof e))return new e(t,r);var i=n(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=U(100*this._a)/100,this._format=r.format||i.format,this._gradientType=r.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=i.ok,this._tc_id=N++}function n(t){var e={r:0,g:0,b:0},r=1,n=!1,a=!1;return\"string\"==typeof t&&(t=I(t)),\"object\"==typeof t&&(t.hasOwnProperty(\"r\")&&t.hasOwnProperty(\"g\")&&t.hasOwnProperty(\"b\")?(e=i(t.r,t.g,t.b),n=!0,a=\"%\"===String(t.r).substr(-1)?\"prgb\":\"rgb\"):t.hasOwnProperty(\"h\")&&t.hasOwnProperty(\"s\")&&t.hasOwnProperty(\"v\")?(t.s=P(t.s),t.v=P(t.v),e=l(t.h,t.s,t.v),n=!0,a=\"hsv\"):t.hasOwnProperty(\"h\")&&t.hasOwnProperty(\"s\")&&t.hasOwnProperty(\"l\")&&(t.s=P(t.s),t.l=P(t.l),e=o(t.h,t.s,t.l),n=!0,a=\"hsl\"),t.hasOwnProperty(\"a\")&&(r=t.a)),r=M(r),{ok:n,format:t.format||a,r:V(255,q(e.r,0)),g:V(255,q(e.g,0)),b:V(255,q(e.b,0)),a:r}}function i(t,e,r){return{r:255*L(t,255),g:255*L(e,255),b:255*L(r,255)}}function a(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=q(t,e,r),o=V(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function o(t,e,r){function n(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(e-t)*r:.5>r?e:2/3>r?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)i=a=o=r;else{var s=.5>r?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 s(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=q(t,e,r),o=V(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+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function l(t,e,r){t=6*L(t,360),e=L(e,100),r=L(r,100);var n=B.floor(t),i=t-n,a=r*(1-e),o=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,u=[r,o,a,a,s,r][l],c=[s,r,r,o,a,a][l],h=[a,a,s,r,r,o][l];return{r:255*u,g:255*c,b:255*h}}function u(t,e,r,n){var i=[z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(\"\")}function c(t,e,r,n){var i=[z(j(n)),z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return i.join(\"\")}function h(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s-=r/100,n.s=T(n.s),e(n)}function f(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s+=r/100,n.s=T(n.s),e(n)}function d(t){return e(t).desaturate(100)}function p(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l+=r/100,n.l=T(n.l),e(n)}function g(t,r){r=0===r?0:r||10;var n=e(t).toRgb();return n.r=q(0,V(255,n.r-U(255*-(r/100)))),n.g=q(0,V(255,n.g-U(255*-(r/100)))),n.b=q(0,V(255,n.b-U(255*-(r/100)))),e(n)}function v(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l-=r/100,n.l=T(n.l),e(n)}function m(t,r){var n=e(t).toHsl(),i=(U(n.h)+r)%360;return n.h=0>i?360+i:i,e(n)}function y(t){var r=e(t).toHsl();return r.h=(r.h+180)%360,e(r)}function b(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({\n",
"h:(n+120)%360,s:r.s,l:r.l}),e({h:(n+240)%360,s:r.s,l:r.l})]}function x(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+90)%360,s:r.s,l:r.l}),e({h:(n+180)%360,s:r.s,l:r.l}),e({h:(n+270)%360,s:r.s,l:r.l})]}function _(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+72)%360,s:r.s,l:r.l}),e({h:(n+216)%360,s:r.s,l:r.l})]}function w(t,r,n){r=r||6,n=n||30;var i=e(t).toHsl(),a=360/n,o=[e(t)];for(i.h=(i.h-(a*r>>1)+720)%360;--r;)i.h=(i.h+a)%360,o.push(e(i));return o}function k(t,r){r=r||6;for(var n=e(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/r;r--;)s.push(e({h:i,s:a,v:o})),o=(o+l)%1;return s}function A(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function M(t){return t=parseFloat(t),(isNaN(t)||0>t||t>1)&&(t=1),t}function L(t,e){C(t)&&(t=\"100%\");var r=S(t);return t=V(e,q(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),B.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function T(t){return V(1,q(0,t))}function E(t){return parseInt(t,16)}function C(t){return\"string\"==typeof t&&-1!=t.indexOf(\".\")&&1===parseFloat(t)}function S(t){return\"string\"==typeof t&&-1!=t.indexOf(\"%\")}function z(t){return 1==t.length?\"0\"+t:\"\"+t}function P(t){return 1>=t&&(t=100*t+\"%\"),t}function j(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return E(t)/255}function I(t){t=t.replace(R,\"\").replace(F,\"\").toLowerCase();var e=!1;if(G[t])t=G[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))?{a:O(r[1]),r:E(r[2]),g:E(r[3]),b:E(r[4]),format:e?\"name\":\"hex8\"}:(r=W.hex6.exec(t))?{r:E(r[1]),g:E(r[2]),b:E(r[3]),format:e?\"name\":\"hex\"}:(r=W.hex3.exec(t))?{r:E(r[1]+\"\"+r[1]),g:E(r[2]+\"\"+r[2]),b:E(r[3]+\"\"+r[3]),format:e?\"name\":\"hex\"}:!1}function D(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 R=/^[\\s,#]+/,F=/\\s+$/,N=0,B=Math,U=B.round,V=B.min,q=B.max,H=B.random;e.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,e,r,n,i,a,o=this.toRgb();return t=o.r/255,e=o.g/255,r=o.b/255,n=.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4),i=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),a=.03928>=r?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*i+.0722*a},setAlpha:function(t){return this._a=M(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),r=U(100*t.s),n=U(100*t.v);return 1==this._a?\"hsv(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsva(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.l);return 1==this._a?\"hsl(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsla(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return\"#\"+this.toHex(t)},toHex8:function(){return c(this._r,this._g,this._b,this._a)},toHex8String:function(){return\"#\"+this.toHex8()},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*L(this._r,255))+\"%\",g:U(100*L(this._g,255))+\"%\",b:U(100*L(this._b,255))+\"%\",a:this._a}},toPercentageRgbString:function(){return 1==this._a?\"rgb(\"+U(100*L(this._r,255))+\"%, \"+U(100*L(this._g,255))+\"%, \"+U(100*L(this._b,255))+\"%)\":\"rgba(\"+U(100*L(this._r,255))+\"%, \"+U(100*L(this._g,255))+\"%, \"+U(100*L(this._b,255))+\"%, \"+this._roundA+\")\"},toName:function(){return 0===this._a?\"transparent\":this._a<1?!1:Y[u(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r=\"#\"+c(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?\"GradientType = 1, \":\"\";if(t){var a=e(t);n=a.toHex8String()}return\"progid:DXImageTransform.Microsoft.gradient(\"+i+\"startColorstr=\"+r+\",endColorstr=\"+n+\")\"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&(\"hex\"===t||\"hex6\"===t||\"hex3\"===t||\"name\"===t);return i?\"name\"===t&&0===this._a?this.toName():this.toRgbString():(\"rgb\"===t&&(r=this.toRgbString()),\"prgb\"===t&&(r=this.toPercentageRgbString()),(\"hex\"===t||\"hex6\"===t)&&(r=this.toHexString()),\"hex3\"===t&&(r=this.toHexString(!0)),\"hex8\"===t&&(r=this.toHex8String()),\"name\"===t&&(r=this.toName()),\"hsl\"===t&&(r=this.toHslString()),\"hsv\"===t&&(r=this.toHsvString()),r||this.toHexString())},_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(p,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(f,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},e.fromRatio=function(t,r){if(\"object\"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(\"a\"===i?n[i]=t[i]:n[i]=P(t[i]));t=n}return e(t,r)},e.equals=function(t,r){return t&&r?e(t).toRgbString()==e(r).toRgbString():!1},e.random=function(){return e.fromRatio({r:H(),g:H(),b:H()})},e.mix=function(t,r,n){n=0===n?0:n||50;var i,a=e(t).toRgb(),o=e(r).toRgb(),s=n/100,l=2*s-1,u=o.a-a.a;i=l*u==-1?l:(l+u)/(1+l*u),i=(i+1)/2;var c=1-i,h={r:o.r*i+a.r*c,g:o.g*i+a.g*c,b:o.b*i+a.b*c,a:o.a*s+a.a*(1-s)};return e(h)},e.readability=function(t,r){var n=e(t),i=e(r);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},e.isReadable=function(t,r,n){var i,a,o=e.readability(t,r);switch(a=!1,i=D(n),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},e.mostReadable=function(t,r,n){var i,a,o,s,l=null,u=0;n=n||{},a=n.includeFallbackColors,o=n.level,s=n.size;for(var c=0;c<r.length;c++)i=e.readability(t,r[c]),i>u&&(u=i,l=e(r[c]));return e.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,e.mostReadable(t,[\"#fff\",\"#000\"],n))};var G=e.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=e.hexNames=A(G),W=function(){var t=\"[-\\\\+]?\\\\d+%?\",e=\"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\",r=\"(?:\"+e+\")|(?:\"+t+\")\",n=\"[\\\\s|\\\\(]+(\"+r+\")[,|\\\\s]+(\"+r+\")[,|\\\\s]+(\"+r+\")\\\\s*\\\\)?\",i=\"[\\\\s|\\\\(]+(\"+r+\")[,|\\\\s]+(\"+r+\")[,|\\\\s]+(\"+r+\")[,|\\\\s]+(\"+r+\")\\\\s*\\\\)?\";return{rgb:new RegExp(\"rgb\"+n),rgba:new RegExp(\"rgba\"+i),hsl:new RegExp(\"hsl\"+n),hsla:new RegExp(\"hsla\"+i),hsv:new RegExp(\"hsv\"+n),hsva:new RegExp(\"hsva\"+i),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})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();\"undefined\"!=typeof r&&r.exports?r.exports=e:\"function\"==typeof t&&t.amd?t(function(){return e}):window.tinycolor=e}()},{}],214:[function(e,r,i){!function(){function e(t,e){function r(e){var r,n=t.arcs[0>e?~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],0>e?[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[0>t?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[0>r?~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[0>t?~t:t]||s.push([t])}),s}function i(t,r,n){function i(t){var e=0>t?~t:t;(c[e]||(c[e]=[])).push({i:t,g:u})}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function s(t){\"GeometryCollection\"===t.type?t.geometries.forEach(s):t.type in h&&(u=t,h[t.type](t.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:a,MultiLineString:o,Polygon:o,MultiPolygon:function(t){t.forEach(o)}};s(r),c.forEach(arguments.length<3?function(t){l.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&l.push(t[0].i)})}else for(var f=0,d=t.arcs.length;d>f;++f)l.push(f);return{type:\"MultiLineString\",arcs:e(t,l)}}function a(t,r){function i(t){t.forEach(function(e){e.forEach(function(e){(o[e=0>e?~e:e]||(o[e]=[])).push(t)})}),s.push(t)}function a(e){return d(l(t,{type:\"Polygon\",arcs:[e]}).coordinates[0])>0}var o={},s=[],u=[];return r.forEach(function(t){\"Polygon\"===t.type?i(t.arcs):\"MultiPolygon\"===t.type&&t.arcs.forEach(i)}),s.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,u.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){o[0>t?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),s.forEach(function(t){delete t._}),{type:\"MultiPolygon\",arcs:u.map(function(r){var i=[];if(r.forEach(function(t){t.forEach(function(t){t.forEach(function(t){o[0>t?~t:t].length<2&&i.push(t)})})}),i=e(t,i),(n=i.length)>1)for(var s,l=a(r[0][0]),u=0;u<n;++u)if(l===a(i[u])){s=i[0],i[0]=i[u],i[u]=s;break}return i})}}function o(t,e){return\"GeometryCollection\"===e.type?{type:\"FeatureCollection\",features:e.geometries.map(function(e){return s(t,e)})}:s(t,e)}function s(t,e){var r={type:\"Feature\",id:e.id,properties:e.properties||{},geometry:l(t,e)};return null==e.id&&delete r.id,r}function l(t,e){function r(t,e){e.length&&e.pop();for(var r,n=c[0>t?~t:t],i=0,a=n.length;a>i;++i)e.push(r=n[i].slice()),l(r,i);0>t&&u(e,a)}function n(t){return t=t.slice(),l(t,0),t}function i(t){for(var e=[],n=0,i=t.length;i>n;++n)r(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0].slice());return e}function o(t){return t.map(a)}function s(t){var e=t.type;return\"GeometryCollection\"===e?{type:e,geometries:t.geometries.map(s)}:e in h?{type:e,coordinates:h[e](t)}:null}var l=m(t.transform),c=t.arcs,h={Point:function(t){return n(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(n)},LineString:function(t){return i(t.arcs)},MultiLineString:function(t){return t.arcs.map(i)},Polygon:function(t){return o(t.arcs)},MultiPolygon:function(t){return t.arcs.map(o)}};return s(e)}function u(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r}function c(t,e){for(var r=0,n=t.length;n>r;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r}function h(t){function e(t,e){t.forEach(function(t){0>t&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){\"GeometryCollection\"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var s in i)for(var l=i[s],u=l.length,h=0;u>h;++h)for(var f=h+1;u>f;++f){var d,p=l[h],g=l[f];(d=a[p])[s=c(d,g)]!==g&&d.splice(s,0,g),(d=a[g])[s=c(d,p)]!==p&&d.splice(s,0,p)}return a}function f(t,e){function r(t){a.remove(t),t[1][2]=e(t),a.push(t)}var n=m(t.transform),i=y(t.transform),a=v();return e||(e=p),t.arcs.forEach(function(t){for(var o,s,l=[],u=0,c=0,h=t.length;h>c;++c)s=t[c],n(t[c]=[s[0],s[1],1/0],c);for(var c=1,h=t.length-1;h>c;++c)o=t.slice(c-1,c+2),o[1][2]=e(o),l.push(o),a.push(o);for(var c=0,h=l.length;h>c;++c)o=l[c],o.previous=l[c-1],o.next=l[c+1];for(;o=a.pop();){var f=o.previous,d=o.next;o[1][2]<u?o[1][2]=u:u=o[1][2],f&&(f.next=d,f[2]=o[2],r(f)),d&&(d.previous=f,d[0]=o[0],r(d))}t.forEach(i)}),t}function d(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return.5*a}function p(t){var e=t[0],r=t[1],n=t[2];return Math.abs((e[0]-n[0])*(r[1]-e[1])-(e[0]-r[0])*(n[1]-e[1]))}function g(t,e){return t[1][2]-e[1][2]}function v(){function t(t,e){for(;e>0;){var r=(e+1>>1)-1,i=n[r];if(g(t,i)>=0)break;n[i._=e]=i,n[t._=e=r]=t}}function e(t,e){for(;;){var r=e+1<<1,a=r-1,o=e,s=n[o];if(i>a&&g(n[a],s)<0&&(s=n[o=a]),i>r&&g(n[r],s)<0&&(s=n[o=r]),o===e)break;n[s._=e]=s,n[t._=e=o]=t}}var r={},n=[],i=0;return r.push=function(e){return t(n[e._=i]=e,i++),i},r.pop=function(){if(!(0>=i)){var t,r=n[0];return--i>0&&(t=n[i],e(n[t._=0]=t,0)),r}},r.remove=function(r){var a,o=r._;if(n[o]===r)return o!==--i&&(a=n[i],(g(a,r)<0?t:e)(n[a._=o]=a,o)),o},r}function m(t){if(!t)return b;var e,r,n=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=r=0),t[0]=(e+=t[0])*n+a,t[1]=(r+=t[1])*i+o}}function y(t){if(!t)return b;var e,r,n=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=r=0);var l=(t[0]-a)/n|0,u=(t[1]-o)/i|0;t[0]=l-e,t[1]=u-r,e=l,r=u}}function b(){}var x={version:\"1.6.19\",mesh:function(t){return l(t,i.apply(this,arguments))},meshArcs:i,merge:function(t){return l(t,a.apply(this,arguments))},mergeArcs:a,feature:o,neighbors:h,presimplify:f};\"function\"==typeof t&&t.amd?t(x):\"object\"==typeof r&&r.exports?r.exports=x:this.topojson=x}()},{}],215:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t*e,a=i*t,o=a-t,s=a-o,l=t-s,u=i*e,c=u-e,h=u-c,f=e-h,d=n-s*h,p=d-l*h,g=p-s*f,v=l*f-g;return r?(r[0]=v,r[1]=n,r):[v,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],216:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t+e,i=n-t,a=n-i,o=e-i,s=t-a;return r?(r[0]=s+o,r[1]=n,r):[s+o,n]}e.exports=n},{}],217:[function(t,e,r){(function(e,n){\"use strict\";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function a(t){i(t.buffer)}function o(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?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 g(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function m(t){t=y.nextPow2(t);var e=y.log2(t),r=k[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,k=_.BUFFER;r.free=function(t){if(n.isBuffer(t))k[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){k[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 g(t);case\"buffer\":return m(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=g,r.mallocDataView=v,r.mallocBuffer=m,r.clearCache=function(){for(var t=0;32>t;++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,k[t].length=0}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{},t(\"buffer\").Buffer)},{\"bit-twiddle\":33,buffer:34,dup:55}],218:[function(t,e,r){arguments[4][52][0].apply(r,arguments)},{dup:52}],219:[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\":220}],220:[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;s>l;++l)for(var u=t[l],c=0;2>c;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case\"center\":h=-.5*(a[0]+o[0]);break;case\"right\":case\"end\":h=-o[0];break;case\"left\":case\"start\":h=-a[0];break;default:throw new Error(\"vectorize-text: Unrecognized textAlign: '\"+n+\"'\")}var f=0;switch(i){case\"hanging\":case\"top\":f=-a[1];break;case\"middle\":f=-.5*(a[1]+o[1]);break;case\"alphabetic\":case\"ideographic\":f=-3*r;break;case\"bottom\":f=-o[1];break;default:throw new Error(\"vectorize-text: Unrecoginized textBaseline: '\"+i+\"'\")}var d=1/r;return\"lineHeight\"in e?d*=+e.lineHeight:\"width\"in e?d=e.width/(o[0]-a[0]):\"height\"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+h),d*(t[1]+f)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error(\"vectorize-text: String too long (sorry, this will get fixed later)\");var a=3*n;t.height<a&&(t.height=a),e.fillStyle=\"#000\",e.fillRect(0,0,t.width,t.height),e.fillStyle=\"#fff\",e.fillText(r,n,2*n);var o=e.getImageData(0,0,i,a),s=c(o.data,[a,i,4]);return s.pick(-1,-1,0).transpose(1,0)}function a(t,e){var r=u(t,128);return e?h(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function o(t,e,r,i){var o=a(t,i),s=n(o.positions,e,r),l=o.edges,u=\"ccw\"===e.orientation;if(f(s,l),e.polygons||e.polygon||e.polyline){for(var c=p(l,s),h=new Array(c.length),g=0;g<c.length;++g){for(var v=c[g],m=new Array(v.length),y=0;y<v.length;++y){for(var b=v[y],x=new Array(b.length),_=0;_<b.length;++_)x[_]=s[b[_]].slice();u&&x.reverse(),m[y]=x}h[g]=m}return h}return e.triangles||e.triangulate||e.triangle?{cells:d(s,l,{delaunay:!1,exterior:!1,interior:!0}),positions:s}:{edges:l,positions:s}}function s(t,e,r){try{return o(t,e,r,!0)}catch(n){}try{return o(t,e,r,!1)}catch(n){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function l(t,e,r,n){var a=n.size||64,o=n.font||\"normal\";r.font=a+\"px \"+o,r.textAlign=\"start\",r.textBaseline=\"alphabetic\",r.direction=\"ltr\";var l=i(e,r,t,a);return s(l,n,a)}e.exports=l,e.exports.processPixels=s;var u=t(\"surface-nets\"),c=t(\"ndarray\"),h=t(\"simplify-planar-graph\"),f=t(\"clean-pslg\"),d=t(\"cdt2d\"),p=t(\"planar-graph-to-polyline\")},{cdt2d:221,\"clean-pslg\":228,ndarray:189,\"planar-graph-to-polyline\":274,\"simplify-planar-graph\":278,\"surface-nets\":211}],221:[function(t,e,r){\"use strict\";function n(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function i(t,e){return t[0]-e[0]||t[1]-e[1]}function a(t){return t.map(n).sort(i)}function o(t,e,r){return e in t?t[e]:r}function s(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var n=!!o(r,\"delaunay\",!0),i=!!o(r,\"interior\",!0),s=!!o(r,\"exterior\",!0),f=!!o(r,\"infinity\",!1);if(!i&&!s||0===t.length)return[];var d=l(t,e);if(n||i!==s||f){for(var p=u(t.length,a(e)),g=0;g<d.length;++g){var v=d[g];p.addTriangle(v[0],v[1],v[2])}return n&&c(t,p),s?i?f?h(p,0,f):p.cells():h(p,1,f):h(p,-1)}return d}var l=t(\"./lib/monotone\"),u=t(\"./lib/triangulation\"),c=t(\"./lib/delaunay\"),h=t(\"./lib/filter\");e.exports=s},{\"./lib/delaunay\":222,\"./lib/filter\":223,\"./lib/monotone\":224,\"./lib/triangulation\":225}],222:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,o){var s=e.opposite(n,i);if(!(0>s)){if(n>i){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;i>s;++s)for(var l=o[s],u=1;u<l.length;u+=2){var c=l[u];if(!(s>c||e.isConstraint(s,c))){for(var h=l[u-1],f=-1,d=1;d<l.length;d+=2)if(l[d-1]===c){f=l[d];break}0>f||a(t[s],t[c],t[h],t[f])<0&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),h=-1,f=-1,l=o[s],p=1;p<l.length;p+=2){var g=l[p-1],v=l[p];g===c?f=v:v===c&&(h=g)}0>h||0>f||a(t[s],t[c],t[h],t[f])>=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\":226,\"robust-in-sphere\":227}],223:[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;a>o;++o){var s=r[o],l=s[0],u=s[1],c=s[2];c>u?l>u&&(s[0]=u,s[1]=c,s[2]=l):l>c&&(s[0]=c,s[1]=l,s[2]=u)}r.sort(i);for(var h=new Array(a),o=0;o<h.length;++o)h[o]=0;var f=[],d=[],p=new Array(3*a),g=new Array(3*a),v=null;e&&(v=[]);for(var m=new n(r,p,g,h,f,d,v),o=0;a>o;++o)for(var s=r[o],y=0;3>y;++y){var l=s[y],u=s[(y+1)%3],b=p[3*o+y]=m.locate(u,l,t.opposite(u,l)),x=g[3*o+y]=t.isConstraint(l,u);0>b&&(x?d.push(o):(f.push(o),h[o]=1),e&&v.push([u,l,-1]))}return m}function o(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}function s(t,e,r){var n=a(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,u=n.flags,c=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;for(var p=(c[d],0);3>p;++p){var g=f[3*d+p];g>=0&&0===u[g]&&(h[3*d+p]?l.push(g):(s.push(g),u[g]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var m=o(c,u,e);return r?m.concat(n.boundary):m}var l=t(\"binary-search-bounds\");e.exports=s;var u=n.prototype;u.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return n>r?e>r&&(a=r,o=n,s=e):e>n&&(a=n,o=e,s=r),0>a?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{\"binary-search-bounds\":226}],224:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r?r:t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx}function o(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=f.lt(e,n,o),s=f.gt(e,n,o),l=a;s>l;++l){for(var u=e[l],c=u.lowerIds,h=c.length;h>1&&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]<e.a[0]?d(t.a,t.b,e.a):d(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?d(t.a,t.b,e.b):d(e.b,e.a,t.b),r||t.idx-e.idx)}function u(t,e,r){var i=f.le(t,r,l),a=t[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],t.splice(i+1,0,new n(r.a,r.b,r.idx,[s],o))}function c(t,e,r){var n=r.a;r.a=r.b,r.b=n;var i=f.eq(t,r,l),a=t[i],o=t[i-1];o.upperIds=a.upperIds,t.splice(i,1)}function h(t,e){for(var r=t.length,o=e.length,l=[],h=0;r>h;++h)l.push(new i(t[h],null,p,h));for(var h=0;o>h;++h){var f=e[h],d=t[f[0]],m=t[f[1]];d[0]<m[0]?l.push(new i(d,m,v,h),new i(m,d,g,h)):d[0]>m[0]&&l.push(new i(m,d,v,h),new i(d,m,g,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],k=w.type;k===p?s(x,b,t,w.a,w.idx):k===v?u(b,t,w):c(b,t,w)}return x}var f=t(\"binary-search-bounds\"),d=t(\"robust-orientation\")[3],p=0,g=1,v=2;e.exports=h},{\"binary-search-bounds\":226,\"robust-orientation\":195}],225:[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;i>n;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;t>i;++i)r[i]=[];return new n(r,e)}var o=t(\"binary-search-bounds\");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=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;i>n;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{\"binary-search-bounds\":226}],226:[function(t,e,r){arguments[4][105][0].apply(r,arguments)},{dup:105}],227:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;t>r;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=[\"m\",n,\"[\",t-r-2,\"]\"].join(\"\")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return[\"sum(\",t[0],\",\",t[1],\")\"].join(\"\");var e=t.length>>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 t&!0?\"-\":\"\"}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;r<t.length;++r)e.push([\"scale(\",a(l(n(t,r))),\",\",s(r),t[0][r],\")\"].join(\"\"));return e}function u(t,e){for(var r=[],n=0;e-2>n;++n)r.push([\"prod(m\",t,\"[\",n,\"],m\",t,\"[\",n,\"])\"].join(\"\"));return a(r)}function c(t){for(var e=[],r=[],o=i(t),s=0;t>s;++s)o[0][s]=\"1\",o[t-1][s]=\"w\"+s;for(var s=0;t>s;++s)0===(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var c=a(e),h=a(r),f=\"exactInSphere\"+t,d=[],s=0;t>s;++s)d.push(\"m\"+s);for(var p=[\"function \",f,\"(\",d.join(),\"){\"],s=0;t>s;++s){p.push(\"var w\",s,\"=\",u(s,t),\";\");for(var g=0;t>g;++g)g!==s&&p.push(\"var w\",s,\"m\",g,\"=scale(w\",s,\",m\",g,\"[0]);\")}p.push(\"var p=\",c,\",n=\",h,\",d=diff(p,n);return d[d.length-1];}return \",f);var x=new Function(\"sum\",\"diff\",\"prod\",\"scale\",p.join(\"\"));return x(m,y,v,b)}function h(){return 0}function f(){return 0}function d(){return 0}function p(t){var e=_[t.length];return e||(e=_[t.length]=c(t.length)),e.apply(void 0,t)}function g(){for(;_.length<=x;)_.push(c(_.length));for(var t=[],r=[\"slow\"],n=0;x>=n;++n)t.push(\"a\"+n),r.push(\"o\"+n);for(var i=[\"function testInSphere(\",t.join(),\"){switch(arguments.length){case 0:case 1:return 0;\"],n=2;x>=n;++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;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere\"),r.push(i.join(\"\"));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[p].concat(_));for(var n=0;x>=n;++n)e.exports[n]=_[n]}var v=t(\"two-product\"),m=t(\"robust-sum\"),y=t(\"robust-subtract\"),b=t(\"robust-scale\"),x=6,_=[h,f,d];g()},{\"robust-scale\":196,\"robust-subtract\":197,\"robust-sum\":198,\"two-product\":215}],228:[function(t,e,r){\"use strict\";function n(t){var e=x(t),r=b(y(e),t);return 0>r?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}function i(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){\n",
"var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[Math.min(a[0],o[0]),Math.min(a[1],o[1]),Math.max(a[0],o[0]),Math.max(a[1],o[1])]}return r}function a(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[n[0],n[1],n[0],n[1]]}return e}function o(t,e,r){var n=[];return v(r,function(r,i){var a=e[r],o=e[i];if(a[0]!==o[0]&&a[0]!==o[1]&&a[1]!==o[0]&&a[1]!==o[1]){var s=t[a[0]],l=t[a[1]],u=t[o[0]],c=t[o[1]];m(s,l,u,c)&&n.push([r,i])}}),n}function s(t,e,r,n){var i=[];return v(r,n,function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var o=t[n],s=t[a[0]],l=t[a[1]];m(s,l,o,o)&&i.push([r,n])}}),i}function l(t,e,r,n,i){function a(e){if(e>=t.length)return o[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var o=[],s=0;s<r.length;++s){var l=r[s],u=l[0],c=l[1],h=e[u],f=e[c],d=k(_(t[h[0]]),_(t[h[1]]),_(t[f[0]]),_(t[f[1]]));if(d){var p=o.length+t.length;o.push(d),n.push([u,p],[c,p])}}n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=a(t[1]),n=a(e[1]);return b(r[0],n[0])||b(r[1],n[1])});for(var s=n.length-1;s>=0;--s){var g=n[s],u=g[0],v=e[u],m=v[0],x=v[1],w=t[m],A=t[x];if((w[0]-A[0]||w[1]-A[1])<0){var M=m;m=x,x=M}v[0]=m;var L,T=v[1]=g[1];for(i&&(L=v[2]);s>0&&n[s-1][0]===u;){var g=n[--s],E=g[1];i?e.push([T,E,L]):e.push([T,E]),T=E}i?e.push([T,x,L]):e.push([T,x])}return o}function u(t,e,r){for(var i=t.length+e.length,a=new g(i),o=r,s=0;s<e.length;++s){var l=e[s],u=n(l[0]),c=n(l[1]);o.push([u[0],c[0],u[1],c[1]]),t.push([x(l[0]),x(l[1])])}v(o,function(t,e){a.link(t,e)});for(var h=0,f=!0,d=new Array(i),s=0;i>s;++s){var p=a.find(s);p===s?(d[s]=h,t[h++]=t[s]):(f=!1,d[s]=-1)}if(t.length=h,f)return null;for(var s=0;i>s;++s)d[s]<0&&(d[s]=d[a.find(s)]);return d}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function h(t,e){var r=t[0]-e[0]||t[1]-e[1];return r?r:t[2]<e[2]?-1:t[2]>e[2]?1:0}function f(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=t[n],a=e[i[0]],o=e[i[1]];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}else for(var n=0;n<t.length;++n){var i=t[n],a=i[0],o=i[1];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}r?t.sort(h):t.sort(c);for(var s=1,n=1;n<t.length;++n){var l=t[n-1],u=t[n];(u[0]!==l[0]||u[1]!==l[1]||r&&u[2]!==l[2])&&(t[s++]=u)}t.length=s}}function d(t,e,r){var n=i(t,e),c=o(t,e,n),h=a(t),d=s(t,e,n,h),p=l(t,e,c,d,r),g=u(t,p,h);return f(e,g,r),g?!0:c.length>0||d.length>0}function p(t,e,r){var n,i=!1;if(r){n=e;for(var a=new Array(e.length),o=0;o<e.length;++o){var s=e[o];a[o]=[s[0],s[1],r[o]]}e=a}for(;d(t,e,!!r);)i=!0;if(r&&i){n.length=0,r.length=0;for(var o=0;o<e.length;++o){var s=e[o];n.push([s[0],s[1]]),r.push(s[2])}}return i}e.exports=p;var g=t(\"union-find\"),v=t(\"box-intersect\"),m=(t(\"compare-cell\"),t(\"robust-segment-intersect\")),y=t(\"big-rat\"),b=t(\"big-rat/cmp\"),x=t(\"big-rat/to-float\"),_=t(\"rat-vec\"),w=t(\"nextafter\"),k=t(\"./lib/rat-seg-intersect\")},{\"./lib/rat-seg-intersect\":229,\"big-rat\":233,\"big-rat/cmp\":231,\"big-rat/to-float\":246,\"box-intersect\":247,\"compare-cell\":41,nextafter:255,\"rat-vec\":257,\"robust-segment-intersect\":260,\"union-find\":261}],229:[function(t,e,r){\"use strict\";function n(t,e){return s(a(t[0],e[1]),a(t[1],e[0]))}function i(t,e,r,i){var a=u(e,t),s=u(i,r),f=n(a,s);if(0===l(f))return null;var d=u(t,r),p=n(s,d),g=o(p,f);return c(t,h(a,g))}e.exports=i;var a=t(\"big-rat/mul\"),o=t(\"big-rat/div\"),s=t(\"big-rat/sub\"),l=t(\"big-rat/sign\"),u=t(\"rat-vec/sub\"),c=t(\"rat-vec/add\"),h=t(\"rat-vec/muls\");t(\"big-rat/to-float\")},{\"big-rat/div\":232,\"big-rat/mul\":242,\"big-rat/sign\":244,\"big-rat/sub\":245,\"big-rat/to-float\":246,\"rat-vec/add\":256,\"rat-vec/muls\":258,\"rat-vec/sub\":259}],230:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":240}],231:[function(t,e,r){\"use strict\";function n(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}e.exports=n},{}],232:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]),t[1].mul(e[0]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":240}],233:[function(t,e,r){\"use strict\";function n(t,e){if(i(t))return e?u(t,n(e)):[t[0].clone(),t[1].clone()];var r,c,h=0;if(a(t))r=t.clone();else if(\"string\"==typeof t)r=s(t);else{if(0===t)return[o(0),o(1)];if(t===Math.floor(t))r=o(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;r=o(t)}}if(i(e))r.mul(e[1]),c=e[0].clone();else if(a(e))c=e.clone();else if(\"string\"==typeof e)c=s(e);else if(e)if(e===Math.floor(e))c=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h+=256;c=o(e)}else c=o(1);return h>0?r=r.shln(h):0>h&&(c=c.shln(-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\":232,\"./is-rat\":234,\"./lib/is-bn\":238,\"./lib/num-to-bn\":239,\"./lib/rationalize\":240,\"./lib/str-to-bn\":241}],234:[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\":238}],235:[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\":243}],236:[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 n=0,i=0;e>i;i++){var a=r[i];n+=a*Math.pow(67108864,i)}return t.sign?-n:n}e.exports=n},{}],237:[function(t,e,r){\"use strict\";function n(t){var e=a(i.lo(t));if(32>e)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t(\"double-bits\"),a=t(\"bit-twiddle\").countTrailingZeros;e.exports=n},{\"bit-twiddle\":33,\"double-bits\":254}],238:[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\":243}],239:[function(t,e,r){\"use strict\";function n(t){var e=a.exponent(t);return 52>e?new i(t):new i(t*Math.pow(2,52-e)).shln(e-52)}var i=t(\"bn.js\"),a=t(\"double-bits\");e.exports=n},{\"bn.js\":243,\"double-bits\":254}],240:[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)];0>n&&(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\":235,\"./num-to-bn\":239}],241:[function(t,e,r){\"use strict\";function n(t){return new i(t)}var i=t(\"bn.js\");e.exports=n},{\"bn.js\":243}],242:[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\":240}],243:[function(t,e,r){!function(t,e){\"use strict\";function r(t,e){if(!t)throw new Error(e||\"Assertion failed\")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&\"object\"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,(\"le\"===e||\"be\"===e)&&(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||\"be\")))}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;i>a;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&54>=o?o-49+10:o>=17&&22>=o?o-17+10:15&o}return n}function o(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;a>o;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,\"k256\",\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\")}function u(){s.call(this,\"p224\",\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\")}function c(){s.call(this,\"p192\",\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\")}function h(){s.call(this,\"25519\",\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\")}function f(t){if(\"string\"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function d(t){f.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(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.sign=!0,this.minv=this.minv.mod(this.r)}\"object\"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.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&&36>=e),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.sign=!0),this.strip(),\"le\"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){0>t&&(this.sign=!0,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),\"le\"===n&&this._initArray(this.toArray(),e,n)},i.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<this.length;i++)this.words[i]=0;var a=0;if(\"be\"===n)for(var i=t.length-1,o=0;i>=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}else if(\"le\"===n)for(var i=0,o=0;i<t.length;i+=3){var s=t[i]|t[i+1]<<8|t[i+2]<<16;this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;for(var n=0,r=t.length-6,i=0;r>=e;r-=6){var o=a(t,r,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=a(t,e,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303}this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,s=a%n,l=Math.min(a,a-s)+r,u=0,c=r;l>c;c+=n)u=o(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){for(var h=1,u=o(t,c,t.length,e),c=0;s>c;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.sign=this.sign,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?\"<BN-R: \":\"<BN: \")+this.toString(16)+\">\"};var p=[\"\",\"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\"],g=[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],v=[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];i.prototype.toString=function(t,e){if(t=t||10,16===t||\"hex\"===t){for(var n=\"\",i=0,e=0|e||1,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,n=0!==a||o!==this.length-1?p[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!==0;)n=\"0\"+n;return this.sign&&(n=\"-\"+n),n}if(t===(0|t)&&t>=2&&36>=t){var u=g[t],c=v[t],n=\"\",h=this.clone();for(h.sign=!1;0!==h.cmpn(0);){var f=h.modn(c).toString(t);h=h.idivn(c),n=0!==h.cmpn(0)?p[u-f.length]+f+n:f+n}return 0===this.cmpn(0)&&(n=\"0\"+n),this.sign&&(n=\"-\"+n),n}r(!1,\"Base should be between 2 and 36\")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if(\"le\"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=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},i.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},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},i.prototype.ior=function(t){for(this.sign=this.sign||t.sign;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r(\"number\"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var e=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var e=this.isub(t);return t.sign=!0,e._normSign()}var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++){var e=r.words[a]+n.words[a]+i;this.words[a]=67108863&e,i=e>>>26}for(;0!==i&&a<r.length;a++){var e=r.words[a]+i;this.words[a]=67108863&e,i=e>>>26}if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},i.prototype.add=function(t){if(t.sign&&!this.sign){t.sign=!1;var e=this.sub(t);return t.sign=!0,e}if(!t.sign&&this.sign){this.sign=!1;var e=t.sub(this);return this.sign=!0,e}return this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,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<i.length;o++){var e=n.words[o]-i.words[o]+a;a=e>>26,this.words[o]=67108863&e}for(;0!==a&&o<n.length;o++){var e=n.words[o]+a;a=e>>26,this.words[o]=67108863&e}if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.sign=!0),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)},i.prototype._smallMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0;n<e.length-1;n++){for(var i=r>>>26,a=67108863&r,o=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);o>=s;s++){var l=n-s,u=0|this.words[l],c=0|t.words[s],h=u*c,f=67108863&h;i=i+(h/67108864|0)|0,f=f+a|0,a=67108863&f,i=i+(f>>>26)|0}e.words[n]=a,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i<e.length-1;i++){var a=n;n=0;for(var o=67108863&r,s=Math.min(i,t.length-1),l=Math.max(0,i-this.length+1);s>=l;l++){var u=i-l,c=0|this.words[u],h=0|t.words[l],f=c*h,d=67108863&f;a=a+(f/67108864|0)|0,d=d+o|0,o=67108863&d,a=a+(d>>>26)|0,n+=a>>>26,a&=67108863}e.words[i]=o,r=a,a=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,a=0,o=Math.min(n,r-1),s=Math.max(0,n-e+1);o>=s;s++){var l=n-s,u=this.words[l],c=t.words[s],h=u*c,f=67108863&h;i+=h/67108864|0,f+=a,a=67108863&f,i+=f>>>26}this.words[n]=a,this.words[n+1]+=i,i=0}for(var i=0,l=1;l<this.length;l++){var d=this.words[l]+i;this.words[l]=67108863&d,i=d>>>26}return this.strip()},i.prototype.imuln=function(t){r(\"number\"==typeof t);for(var e=0,n=0;n<this.length;n++){var i=this.words[n]*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r(\"number\"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var a=0,o=0;o<this.length;o++){var s=this.words[o]&i,l=this.words[o]-s<<e;this.words[o]=l|a,a=s>>>26-e}a&&(this.words[o]=a,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;n>o;o++)this.words[o]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r(\"number\"==typeof t&&t>=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<<a,l=n;if(i-=o,i=Math.max(0,i),l){for(var u=0;o>u;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o){this.length-=o;for(var u=0;u<this.length;u++)this.words[u]=this.words[u+o]}else this.words[0]=0,this.length=1;for(var c=0,u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=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(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r(\"number\"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return!1;var a=this.words[n];return!!(a&i)},i.prototype.imaskn=function(t){r(\"number\"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,\"imaskn works only with positive numbers\"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r(\"number\"==typeof t),0>t?this.isubn(-t):this.sign?1===this.length&&this.words[0]<t?(this.words[0]=t-this.words[0],this.sign=!1,this):(this.sign=!1,this.isubn(t),this.sign=!0,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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},i.prototype.isubn=function(t){if(r(\"number\"==typeof t),0>t)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.sign=!1,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,a=t.length+n;if(this.words.length<a){for(var o=new Array(a),i=0;i<this.length;i++)o[i]=this.words[i];this.words=o}else i=this.length;for(this.length=Math.max(this.length,a);i<this.length;i++)this.words[i]=0;for(var s=0,i=0;i<t.length;i++){var l=this.words[i+n]+s,u=t.words[i]*e;l-=67108863&u,s=(l>>26)-(u/67108864|0),this.words[i+n]=67108863&l}for(;i<this.length-n;i++){var l=this.words[i+n]+s;s=l>>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(-1===s),s=0;for(var i=0;i<this.length;i++){var l=-this.words[i]+s;s=l>>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),a=t,o=a.words[a.length-1],s=this._countBits(o);r=26-s,0!==r&&(a=a.shln(r),n.ishln(r),o=a.words[a.length-1]);var l,u=n.length-a.length;if(\"mod\"!==e){l=new i(null),l.length=u+1,l.words=new Array(l.length);for(var c=0;c<l.length;c++)l.words[c]=0}var h=n.clone()._ishlnsubmul(a,1,u);h.sign||(n=h,l&&(l.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*n.words[a.length+f]+n.words[a.length+f-1];for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,f);n.sign;)d--,n.sign=!1,n._ishlnsubmul(a,1,f),0!==n.cmpn(0)&&(n.sign=!n.sign);l&&(l.words[f]=d)}return l&&l.strip(),n.strip(),\"div\"!==e&&0!==r&&n.ishrn(r),{div:l?l:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,a,o=this.neg().divmod(t,e);return\"mod\"!==e&&(n=o.div.neg()),\"div\"!==e&&(a=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:a}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return\"mod\"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?\"div\"===e?{div:this.divn(t.words[0]),mod:null}:\"mod\"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,\"div\").div},i.prototype.mod=function(t){return this.divmod(t,\"mod\").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),a=r.cmp(n);return 0>a||1===i&&0===a?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(67108863>=t);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(67108863>=t);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++u;for(var c=n.clone(),h=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(h).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(c).ishrn(1),l.isub(h).ishrn(1));e.cmp(n)>=0?(e.isub(n),a.isub(s),o.isub(l)):(n.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:n.ishln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o)):(n.isub(e),o.isub(a))}return 0===e.cmpn(1)?a:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=e.cmp(r);if(0>i){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r(\"number\"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n){for(var a=this.length;n+1>a;a++)this.words[a]=0;return this.words[n]|=i,this.length=n+1,this}for(var o=i,a=n;0!==o&&a<this.length;a++){var s=this.words[a];s+=o,o=s>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.cmpn=function(t){var e=0>t;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:t>n?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){i>n?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new f(t)},i.prototype.toRed=function(t){return r(!this.red,\"Already a number in reduction context\"),r(!this.sign,\"red works only with positives\"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,\"fromRed works only with numbers in reduction context\"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,\"Already a number in reduction context\"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,\"redAdd works only with red numbers\"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,\"redIAdd works only with red numbers\"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,\"redSub works only with red numbers\"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,\"redISub works only with red numbers\"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,\"redShl works only with red numbers\"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,\"redSqr works only with red numbers\"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,\"redISqr works only with red numbers\"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,\"redSqrt works only with red numbers\"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,\"redInvm works only with red numbers\"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,\"redNeg works only with red numbers\"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,\"redPow(normalNum)\"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;n>i;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];e.words[e.length++]=a&r;for(var i=10;i<t.length;i++){var o=t.words[i];t.words[i-10]=(o&r)<<4|a>>>22,a=o}t.words[i-10]=a>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n<t.length;n++){var i=t.words[n];e=64*i,r+=977*i,e+=r/67108864|0,r&=67108863,t.words[n]=r,r=e}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(u,s),n(c,s),n(h,s),h.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*t.words[r]+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function y(t){if(m[t])return m[t];var y;if(\"k256\"===t)y=new l;else if(\"p224\"===t)y=new u;else if(\"p192\"===t)y=new c;else{if(\"p25519\"!==t)throw new Error(\"Unknown prime \"+t);y=new h}return m[t]=y,y},f.prototype._verify1=function(t){r(!t.sign,\"red works only with positives\"),r(t.red,\"red works only with red numbers\")},f.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,\"red works only with positives\"),r(t.red&&t.red===e.red,\"red works only with red numbers\")},f.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},f.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},f.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)},f.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},f.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)},f.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},f.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},f.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},f.prototype.isqr=function(t){return this.imul(t,t)},f.prototype.sqr=function(t){return this.mul(t,t)},f.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),a=this.pow(t,n);return a}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.ishrn(1);r(0!==o.cmpn(0));var l=new i(1).toRed(this),u=l.redNeg(),c=this.m.subn(1).ishrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,o),a=this.pow(t,o.addn(1).ishrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(l);){for(var g=d,v=0;0!==g.cmp(l);v++)g=g.redSqr();r(p>v);var m=this.pow(f,new i(1).ishln(p-v-1));a=a.redMul(m),f=m.redSqr(),d=d.redMul(f),p=v}return a},f.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},f.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var a=t,o=0;o<r.length&&0===r[o];o++,a=this.sqr(a));if(++o<r.length)for(var n=this.sqr(a);o<r.length;o++,n=this.sqr(n))0!==r[o]&&(a=this.mul(a,n));return a},f.prototype.convertTo=function(t){var e=t.mod(this.m);return e===t?e.clone():e;\n",
"},f.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new d(t)},n(d,f),d.prototype.convertTo=function(t){return this.imod(t.shln(this.shift))},d.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},d.prototype.imul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))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).ishrn(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)},d.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).ishrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},d.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}(\"undefined\"==typeof e||e,this)},{}],244:[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\":235}],245:[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\":240}],246:[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.divmod(r),o=n.div,s=i(o),l=n.mod;if(0===l.cmpn(0))return s;if(s){var u=a(s)+4,c=i(l.shln(u).divRound(r));return 0>s&&(c=-c),s+c*Math.pow(2,-u)}var h=r.bitLength()-l.bitLength()+53,c=i(l.shln(h).divRound(r));return 1023>h?c*Math.pow(2,-h):(c*=Math.pow(2,-1023),c*Math.pow(2,1023-h))}var i=t(\"./lib/bn-to-num\"),a=t(\"./lib/ctz\");e.exports=n},{\"./lib/bn-to-num\":236,\"./lib/ctz\":237}],247:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0;t>r;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;l>s;++s){var u=t[s];if(!n(e,u)){for(var c=0;2*e>c;++c)r[a++]=u[c];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(0>=a||0>=o)){var s=t[0].length>>>1;if(!(0>=s)){var l,u=h.mallocDouble(2*s*a),c=h.mallocInt32(a);if(a=i(t,s,u,c),a>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),g=h.mallocInt32(o);o=i(e,s,p,g),o>0&&(f.init(a+o),l=1===s?f.sweepBipartite(s,r,0,a,u,c,0,o,p,g):d(s,r,n,a,u,c,o,p,g),h.free(p),h.free(g))}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\":249,\"./lib/sweep\":253,\"typedarray-pool\":217}],248:[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];\",k=\"for(var j=\"+g+\",\"+b+\"=\"+u+\"*\"+g+\";j<\"+v+\";++j,\"+b+\"+=\"+u+\"){var y0=\"+m+\"[\"+o+\"+\"+b+\"],\"+(r?\"y1=\"+m+\"[\"+o+\"+\"+b+\"+\"+a+\"],\":\"\")+\"yi=\"+y+\"[j];\";return t?i.push(l,_,\":\",k):i.push(k,_,\":\",l),r?i.push(\"if(y1<x0||x1<y0)continue;\"):e?i.push(\"if(y0<=x0||x1<y0)continue;\"):i.push(\"if(y0<x0||x1<y0)continue;\"),i.push(\"for(var k=\"+o+\"+1;k<\"+a+\";++k){var r0=\"+f+\"[k+\"+p+\"],r1=\"+f+\"[k+\"+a+\"+\"+p+\"],b0=\"+m+\"[k+\"+b+\"],b1=\"+m+\"[k+\"+a+\"+\"+b+\"];if(r1<b0||b1<r0)continue \"+_+\";}var \"+x+\"=\"+s+\"(\"),e?i.push(\"yi,xi\"):i.push(\"xi,yi\"),i.push(\");if(\"+x+\"!==void 0)return \"+x+\";}}}\"),{name:n,code:i.join(\"\")}}function i(t){function e(e,r){var a=n(e,r,t);i.push(a.code),o.push(\"return \"+a.name+\"(\"+w.join()+\");\")}var r=\"bruteForce\"+(t?\"Full\":\"Partial\"),i=[],a=w.slice();t||a.splice(3,0,l);var o=[\"function \"+r+\"(\"+a.join()+\"){\"];o.push(\"if(\"+h+\"-\"+c+\">\"+v+\"-\"+g+\"){\"),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(\"\"),u=new Function(s);return u()}var a=\"d\",o=\"ax\",s=\"vv\",l=\"fp\",u=\"es\",c=\"rs\",h=\"re\",f=\"rb\",d=\"ri\",p=\"rp\",g=\"bs\",v=\"be\",m=\"bb\",y=\"bi\",b=\"bp\",x=\"rv\",_=\"Q\",w=[a,o,s,c,h,f,d,g,v,m,y];r.partial=i(!1),r.full=i(!0)},{}],249:[function(t,e,r){\"use strict\";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(M*r);E.length<n&&(l.free(E),E=l.mallocInt32(n));var i=u.nextPow2(L*r);i>C&&(l.free(C),C=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=M*t;E[u]=e,E[u+1]=r,E[u+2]=n,E[u+3]=i,E[u+4]=a,E[u+5]=o;var c=L*t;C[c]=s,C[c+1]=l}function a(t,e,r,n,i,a,o,s,l,u,c){var h=2*t,f=l*h,d=u[f+e];t:for(var p=i,g=i*h;a>p;++p,g+=h){var v=o[g+e],m=o[g+e+t];if(!(v>d||d>m||n&&d===v)){for(var y=s[p],b=e+1;t>b;++b){var v=o[g+b],m=o[g+b+t],x=u[f+b],_=u[f+b+t];if(x>m||v>_)continue t}var w;if(w=n?r(c,y):r(y,c),void 0!==w)return w}}}function o(t,e,r,n,i,a,o,s,l,u){var c=2*t,h=s*c,f=l[h+e];t:for(var d=n,p=n*c;i>d;++d,p+=c){var g=o[d];if(g!==u){var v=a[p+e],m=a[p+e+t];if(!(v>f||f>m)){for(var y=e+1;t>y;++y){var v=a[p+y],m=a[p+y+t],b=l[h+y],x=l[h+y+t];if(b>m||v>x)continue t}var _=r(g,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,g,T){n(t,s+c);var S,z=0,P=2*t;for(i(z++,0,0,s,0,c,r?16:0,-(1/0),1/0),r||i(z++,0,0,c,0,s,1,-(1/0),1/0);z>0;){z-=1;var j=z*M,O=E[j],I=E[j+1],D=E[j+2],R=E[j+3],F=E[j+4],N=E[j+5],B=z*L,U=C[B],V=C[B+1],q=1&N,H=!!(16&N),G=l,Y=u,W=g,X=T;if(q&&(G=g,Y=T,W=l,X=u),!(2&N&&(D=_(t,O,I,D,G,Y,V),I>=D)||4&N&&(I=w(t,O,I,D,G,Y,U),I>=D))){var Z=D-I,Q=F-R;if(H){if(y>t*Z*(Z+Q)){if(S=d.scanComplete(t,O,e,I,D,G,Y,R,F,W,X),void 0!==S)return S;continue}}else{if(t*Math.min(Z,Q)<v){if(S=h(t,O,e,q,I,D,G,Y,R,F,W,X),void 0!==S)return S;continue}if(m>t*Z*Q){if(S=d.scanBipartite(t,O,e,q,I,D,G,Y,R,F,W,X),void 0!==S)return S;continue}}var $=b(t,O,I,D,G,Y,U,V);if($>I)if(v>t*($-I)){if(S=f(t,O+1,e,I,$,G,Y,R,F,W,X),void 0!==S)return S}else if(O===t-2){if(S=q?d.sweepBipartite(t,e,R,F,W,X,I,$,G,Y):d.sweepBipartite(t,e,I,$,G,Y,R,F,W,X),void 0!==S)return S}else i(z++,O+1,I,$,R,F,q,-(1/0),1/0),i(z++,O+1,R,F,I,$,1^q,-(1/0),1/0);if(D>$){var K=p(t,O,R,F,W,X),J=W[P*K+O],tt=x(t,O,K,F,W,X,J);if(F>tt&&i(z++,O,$,D,tt,F,(4|q)+(H?16:0),J,V),K>R&&i(z++,O,$,D,R,K,(2|q)+(H?16:0),U,J),K+1===tt){if(S=H?o(t,O,e,$,D,G,Y,K,W,X[K]):a(t,O,e,q,$,D,G,Y,K,W,X[K]),void 0!==S)return S}else if(tt>K){var et;if(H){if(et=k(t,O,$,D,G,Y,J),et>$){var rt=x(t,O,$,et,G,Y,J);if(O===t-2){if(rt>$&&(S=d.sweepComplete(t,e,$,rt,G,Y,K,tt,W,X),void 0!==S))return S;if(et>rt&&(S=d.sweepBipartite(t,e,rt,et,G,Y,K,tt,W,X),void 0!==S))return S}else rt>$&&i(z++,O+1,$,rt,K,tt,16,-(1/0),1/0),et>rt&&(i(z++,O+1,rt,et,K,tt,0,-(1/0),1/0),i(z++,O+1,K,tt,rt,et,1,-(1/0),1/0))}}else et=q?A(t,O,$,D,G,Y,J):k(t,O,$,D,G,Y,J),et>$&&(O===t-2?S=q?d.sweepBipartite(t,e,K,tt,W,X,$,et,G,Y):d.sweepBipartite(t,e,$,et,G,Y,K,tt,W,X):(i(z++,O+1,$,et,K,tt,q,-(1/0),1/0),i(z++,O+1,K,tt,$,et,1^q,-(1/0),1/0)))}}}}}e.exports=s;var l=t(\"typedarray-pool\"),u=t(\"bit-twiddle\"),c=t(\"./brute\"),h=c.partial,f=c.full,d=t(\"./sweep\"),p=t(\"./median\"),g=t(\"./partition\"),v=128,m=1<<22,y=1<<22,b=g(\"!(lo>=p0)&&!(p1>=hi)\",[\"p0\",\"p1\"]),x=g(\"lo===p0\",[\"p0\"]),_=g(\"lo<p0\",[\"p0\"]),w=g(\"hi<=p0\",[\"p0\"]),k=g(\"lo<=p0&&p0<=hi\",[\"p0\"]),A=g(\"lo<p0&&p0<=hi\",[\"p0\"]),M=6,L=2,T=1024,E=l.mallocInt32(T),C=l.mallocDouble(T)},{\"./brute\":248,\"./median\":250,\"./partition\":251,\"./sweep\":253,\"bit-twiddle\":33,\"typedarray-pool\":217}],250:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;n>l;++l,s+=o)for(var u=i[s],c=l,h=o*(l-1);c>r&&i[h+e]>u;--c,h-=o){for(var f=h,d=h+o,p=0;o>p;++p,++f,++d){var g=i[f];i[f]=i[d],i[d]=g}var v=a[c];a[c]=a[c-1],a[c-1]=v}}function i(t,e,r,i,a,l){if(r+1>=i)return r;for(var u=r,c=i,h=i+r>>>1,f=2*t,d=h,p=a[f*h+e];c>u;){if(s>c-u){n(t,e,u,c,a,l),p=a[f*h+e];break}var g=c-u,v=Math.random()*g+u|0,m=a[f*v+e],y=Math.random()*g+u|0,b=a[f*y+e],x=Math.random()*g+u|0,_=a[f*x+e];b>=m?_>=b?(d=y,p=b):m>=_?(d=v,p=m):(d=x,p=_):b>=_?(d=y,p=b):_>=m?(d=v,p=m):(d=x,p=_);for(var w=f*(c-1),k=f*d,A=0;f>A;++A,++w,++k){var M=a[w];a[w]=a[k],a[k]=M}var L=l[c-1];l[c-1]=l[d],l[d]=L,d=o(t,e,u,c-1,a,l,p);for(var w=f*(c-1),k=f*d,A=0;f>A;++A,++w,++k){var M=a[w];a[w]=a[k],a[k]=M}var L=l[c-1];if(l[c-1]=l[d],l[d]=L,d>h){for(c=d-1;c>u&&a[f*(c-1)+e]===p;)c-=1;c+=1}else{if(!(h>d))break;for(u=d+1;c>u&&a[f*u+e]===p;)u+=1}}return o(t,e,r,h,a,l,a[f*h+e])}e.exports=i;var a=t(\"./partition\"),o=a(\"lo<p0\",[\"p0\"]),s=8},{\"./partition\":251}],251:[function(t,e,r){\"use strict\";function n(t,e){var r=\"abcdef\".split(\"\").concat(e),n=[];return t.indexOf(\"lo\")>=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\"},{}],252:[function(t,e,r){\"use strict\";function n(t,e){4*f>=e?i(0,e-1,t):h(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;e>=i;++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(a>u)break;if(u===a&&o>c)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function u(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return i>n?!1:n===i?r[t+1]>r[e+1]:!0}function c(t,e,r,n){t*=2;var i=n[t];return e>i?!0:i===e?n[t+1]<r:!1}function h(t,e,r){var n=(e-t+1)/6|0,d=t+n,p=e-n,g=t+e>>1,v=g-n,m=g+n,y=d,b=v,x=g,_=m,w=p,k=t+1,A=e-1,M=0;u(y,b,r)&&(M=y,y=b,b=M),u(_,w,r)&&(M=_,_=w,w=M),u(y,x,r)&&(M=y,y=x,x=M),u(b,x,r)&&(M=b,b=x,x=M),u(y,_,r)&&(M=y,y=_,_=M),u(x,_,r)&&(M=x,x=_,_=M),u(b,w,r)&&(M=b,b=w,w=M),u(b,x,r)&&(M=b,b=x,x=M),u(_,w,r)&&(M=_,_=w,w=M);for(var L=r[2*b],T=r[2*b+1],E=r[2*_],C=r[2*_+1],S=2*y,z=2*x,P=2*w,j=2*d,O=2*g,I=2*p,D=0;2>D;++D){var R=r[S+D],F=r[z+D],N=r[P+D];r[j+D]=R,r[O+D]=F,r[I+D]=N}o(v,t,r),o(m,e,r);for(var B=k;A>=B;++B)if(c(B,L,T,r))B!==k&&a(B,k,r),++k;else if(!c(B,E,C,r))for(;;){if(c(A,E,C,r)){c(A,L,T,r)?(s(B,k,A,r),++k,--A):(a(B,A,r),--A);break}if(--A<B)break}l(t,k-1,L,T,r),l(e,A+1,E,C,r),f>=k-2-t?i(t,k-2,r):h(t,k-2,r),f>=e-(A+2)?i(A+2,e,r):h(A+2,e,r),f>=A-k?i(k,A,r):h(k,A,r)}e.exports=n;var f=32},{}],253:[function(t,e,r){\"use strict\";function n(t){var e=h.nextPow2(t);g.length<e&&(c.free(g),g=c.mallocInt32(e)),v.length<e&&(c.free(v),v=c.mallocInt32(e)),m.length<e&&(c.free(m),m=c.mallocInt32(e)),y.length<e&&(c.free(y),y=c.mallocInt32(e)),b.length<e&&(c.free(b),b=c.mallocInt32(e)),x.length<e&&(c.free(x),x=c.mallocInt32(e));var r=8*e;_.length<r&&(c.free(_),_=c.mallocDouble(r))}function i(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function a(t,e,r,n){t[r]=n,e[n]=r}function o(t,e,r,n,o,s,l,u,c,h){for(var p=0,b=2*t,x=t-1,w=b-1,k=r;n>k;++k){var A=s[k],M=b*k;_[p++]=o[M+x],_[p++]=-(A+1),_[p++]=o[M+w],_[p++]=A}for(var k=l;u>k;++k){var A=h[k]+d,L=b*k;_[p++]=c[L+x],_[p++]=-A,_[p++]=c[L+w],_[p++]=A}var T=p>>>1;f(_,T);for(var E=0,C=0,k=0;T>k;++k){var S=0|_[2*k+1];if(S>=d)S=S-d|0,i(m,y,C--,S);else if(S>=0)i(g,v,E--,S);else if(-d>=S){S=-S-d|0;for(var z=0;E>z;++z){var P=e(g[z],S);if(void 0!==P)return P}a(m,y,C++,S)}else{S=-S-1|0;for(var z=0;C>z;++z){var P=e(S,m[z]);if(void 0!==P)return P}a(g,v,E++,S)}}}function s(t,e,r,n,o,s,l,u,c,h){for(var d=0,p=2*t,w=t-1,k=p-1,A=r;n>A;++A){var M=s[A]+1<<1,L=p*A;_[d++]=o[L+w],_[d++]=-M,_[d++]=o[L+k],_[d++]=M}for(var A=l;u>A;++A){var M=h[A]+1<<1,T=p*A;_[d++]=c[T+w],_[d++]=1|-M,_[d++]=c[T+k],_[d++]=1|M}var E=d>>>1;f(_,E);for(var C=0,S=0,z=0,A=0;E>A;++A){var P=0|_[2*A+1],j=1&P;if(E-1>A&&P>>1===_[2*A+3]>>1&&(j=2,A+=1),0>P){for(var O=-(P>>1)-1,I=0;z>I;++I){var D=e(b[I],O);if(void 0!==D)return D}if(0!==j)for(var I=0;C>I;++I){var D=e(g[I],O);if(void 0!==D)return D}if(1!==j)for(var I=0;S>I;++I){var D=e(m[I],O);if(void 0!==D)return D}0===j?a(g,v,C++,O):1===j?a(m,y,S++,O):2===j&&a(b,x,z++,O)}else{var O=(P>>1)-1;0===j?i(g,v,C--,O):1===j?i(m,y,S--,O):2===j&&i(b,x,z--,O)}}}function l(t,e,r,n,o,s,l,u,c,h,p,m){var y=0,b=2*t,x=e,w=e+t,k=1,A=1;n?A=d:k=d;for(var M=o;s>M;++M){var L=M+k,T=b*M;_[y++]=l[T+x],_[y++]=-L,_[y++]=l[T+w],_[y++]=L}for(var M=c;h>M;++M){var L=M+A,E=b*M;_[y++]=p[E+x],_[y++]=-L}var C=y>>>1;f(_,C);for(var S=0,M=0;C>M;++M){var z=0|_[2*M+1];if(0>z){var L=-z,P=!1;if(L>=d?(P=!n,L-=d):(P=!!n,L-=1),P)a(g,v,S++,L);else{var j=m[L],O=b*L,I=p[O+e+1],D=p[O+e+1+t];t:for(var R=0;S>R;++R){var F=g[R],N=b*F;if(!(D<l[N+e+1]||l[N+e+1+t]<I)){for(var B=e+2;t>B;++B)if(p[O+B+t]<l[N+B]||l[N+B+t]<p[O+B])continue t;var U,V=u[F];if(U=n?r(j,V):r(V,j),void 0!==U)return U}}}}else i(g,v,S--,z-k)}}function u(t,e,r,n,i,a,o,s,l,u,c){for(var h=0,p=2*t,v=e,m=e+t,y=n;i>y;++y){var b=y+d,x=p*y;_[h++]=a[x+v],_[h++]=-b,_[h++]=a[x+m],_[h++]=b}for(var y=s;l>y;++y){var b=y+1,w=p*y;_[h++]=u[w+v],_[h++]=-b}var k=h>>>1;f(_,k);for(var A=0,y=0;k>y;++y){var M=0|_[2*y+1];if(0>M){var b=-M;if(b>=d)g[A++]=b-d;else{b-=1;var L=c[b],T=p*b,E=u[T+e+1],C=u[T+e+1+t];t:for(var S=0;A>S;++S){var z=g[S],P=o[z];if(P===L)break;var j=p*z;if(!(C<a[j+e+1]||a[j+e+1+t]<E)){for(var O=e+2;t>O;++O)if(u[T+O+t]<a[j+O]||a[j+O+t]<u[T+O])continue t;var I=r(P,L);if(void 0!==I)return I}}}}else{for(var b=M-d,S=A-1;S>=0;--S)if(g[S]===b){for(var O=S+1;A>O;++O)g[O-1]=g[O];break}--A}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t(\"typedarray-pool\"),h=t(\"bit-twiddle\"),f=t(\"./sort\"),d=1<<28,p=1024,g=c.mallocInt32(p),v=c.mallocInt32(p),m=c.mallocInt32(p),y=c.mallocInt32(p),b=c.mallocInt32(p),x=c.mallocInt32(p),_=c.mallocDouble(8*p)},{\"./sort\":252,\"bit-twiddle\":33,\"typedarray-pool\":217}],254:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,f[0]}function n(t){return f[0]=t,d[0]}function i(t){return f[0]=t,d[1]}function a(t,e){return d[1]=t,d[0]=e,f[0]}function o(t){return f[0]=t,d[1]}function s(t){return f[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var h=!1;if(\"undefined\"!=typeof Float64Array){var f=new Float64Array(1),d=new Uint32Array(f.buffer);f[0]=1,h=!0,1072693248===d[1]?(e.exports=function(t){return f[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return f[0]=t,[d[1],d[0]]},e.exports.pack=a,e.exports.lo=o,e.exports.hi=s):h=!1}if(!h){var p=new t(8);e.exports=function(t){return p.writeDoubleLE(t,0,!0),[p.readUInt32LE(0,!0),p.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){var r=e.exports.hi(t);return(r<<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){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t(\"buffer\").Buffer)},{buffer:34}],255:[function(t,e,r){\"use strict\";function n(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return 0>e?-a:a;var r=i.hi(t),n=i.lo(t);return e>t==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\":254}],256:[function(t,e,r){\"use strict\";function n(t,e){for(var r=t.length,n=new Array(r),a=0;r>a;++a)n[a]=i(t[a],e[a]);return n}var i=t(\"big-rat/add\");e.exports=n},{\"big-rat/add\":230}],257:[function(t,e,r){\"use strict\";function n(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=i(t[r]);return e}e.exports=n;var i=t(\"big-rat\")},{\"big-rat\":233}],258:[function(t,e,r){\"use strict\";function n(t,e){for(var r=i(e),n=t.length,o=new Array(n),s=0;n>s;++s)o[s]=a(t[s],r);return o}var i=t(\"big-rat\"),a=t(\"big-rat/mul\");e.exports=n},{\"big-rat\":233,\"big-rat/mul\":242}],259:[function(t,e,r){\"use strict\";function n(t,e){for(var r=t.length,n=new Array(r),a=0;r>a;++a)n[a]=i(t[a],e[a]);return n}var i=t(\"big-rat/sub\");e.exports=n},{\"big-rat/sub\":245}],260:[function(t,e,r){\"use strict\";function n(t,e,r,n){for(var i=0;2>i;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c),f=Math.max(u,c);if(s>f||h>l)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||0>o&&0>s)return!1;var l=a(r,t,e),u=a(i,t,e);return l>0&&u>0||0>l&&0>u?!1:0===o&&0===s&&0===l&&0===u?n(t,e,r,i):!0}e.exports=i;var a=t(\"robust-orientation\")[3]},{\"robust-orientation\":195}],261:[function(t,e,r){arguments[4][170][0].apply(r,arguments)},{dup:170}],262:[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;s<e.length;++s){var l=r[s].length;a[s]=l,n[s]=!0,1>=l&&o.push(s)}for(;o.length>0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s<c.length;++s){var h=c[s];0===--a[h]&&o.push(h)}}for(var f=new Array(e.length),d=[],s=0;s<e.length;++s)if(n[s]){var u=d.length;f[s]=u,d.push(e[s])}else f[s]=-1;for(var p=[],s=0;s<t.length;++s){var g=t[s];n[g[0]]&&n[g[1]]&&p.push([f[g[0]],f[g[1]]])}return[p,d]}e.exports=n;var i=t(\"edges-to-adjacency-list\")},{\"edges-to-adjacency-list\":263}],263:[function(t,e,r){\"use strict\";function n(t,e){var r=t.length;if(\"number\"!=typeof e){e=0;for(var n=0;r>n;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=(0|e)+1}e=0|e;for(var o=new Array(e),n=0;e>n;++n)o[n]=[];for(var n=0;r>n;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;e>s;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t(\"uniq\")},{uniq:218}],264:[function(t,e,r){\"use strict\";function n(t,e){function r(t,e){var r=u[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,s,l,c=0;2>c;++c)if(u[c][n].length>0){o=u[c][n][0],l=c;break}s=o[1^l];for(var h=0;2>h;++h)for(var f=u[h][n],d=0;d<f.length;++d){var p=f[d],g=p[1^h],v=i(e[t],e[n],e[s],e[g]);v>0&&(o=p,s=g,l=h)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=u[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(u[0][t].length+u[1][t].length===0)break;var c=s[s.length-1],h=t,f=s[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;s.push(t),l=n(c,h)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,u=[new Array(s),new Array(s)],c=0;s>c;++c)u[0][c]=[],u[1][c]=[];for(var c=0;l>c;++c){var h=t[c];u[0][h[0]].push(h),u[1][h[1]].push(h)}for(var f=[],c=0;s>c;++c)u[0][c].length+u[1][c].length===0&&f.push([c]);for(var c=0;s>c;++c)for(var d=0;2>d;++d){for(var p=[];u[d][c].length>0;){var g=(u[0][c].length,a(c,d));o(p,g)?p.push.apply(p,g):(p.length>0&&f.push(p),p=g)}p.length>0&&f.push(p)}return f}e.exports=n;var i=t(\"compare-angle\")},{\"compare-angle\":265}],265:[function(t,e,r){\"use strict\";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),c=u(l(n,a),l(i,o));return c[c.length-1]>=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),h=n(t,e,i);return c===h?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 f=a(t,e,r);if(f>0)return s>0&&a(t,e,i)>0?1:-1;if(0>f)return s>0||a(t,e,i)>0?1:-1;var d=a(t,e,i);return d>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\":195,\"robust-product\":266,\"robust-sum\":198,signum:267,\"two-sum\":216}],266:[function(t,e,r){\"use strict\";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var n=0;n<t.length;++n)r=i(r,a(e,t[n]));else for(var n=0;n<e.length;++n)r=i(r,a(t,e[n]));return r}var i=t(\"robust-sum\"),a=t(\"robust-scale\");e.exports=n},{\"robust-scale\":196,\"robust-sum\":198}],267:[function(t,e,r){\"use strict\";e.exports=function(t){return 0>t?-1:t>0?1:0}},{}],268:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],269:[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 0>n?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function u(t,e,r){for(var n=t.length-1;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<t.length;++r){var n=e(t[r]);if(n)return n}}function h(t,e){return t-e}function f(t,e){var r=t[0]-e[0];return r?r:t[1]-e[1]}function d(t,e){var r=t[1]-e[1];return r?r:t[0]-e[0]}function p(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(h);for(var i=e[e.length>>1],a=[],o=[],s=[],r=0;r<t.length;++r){var l=t[r];l[1]<i?a.push(l):i<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(f),c.sort(d),new n(i,p(a),p(o),u,c)}function g(t){this.root=t}function v(t){return new g(t&&0!==t.length?p(t):null)}var m=t(\"binary-search-bounds\"),y=0,b=1,x=2;e.exports=v;var _=n.prototype;_.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},_.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(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=m.ge(this.leftPoints,t,f),n=m.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return y;var r=this.right?this.right.count:0;if(4*r>3*(e-1))return s(this,t);var n=this.left.remove(t);return n===x?(this.left=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var a=this.left?this.left.count:0;if(4*a>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===x?(this.right=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?x:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var o=this,l=this.left;l.right;)o=l,l=l.right;if(o===this)l.right=this.right;else{var u=this.left,n=this.right;o.count-=l.count,o.right=l.left,l.left=u,l.right=n}i(this,l),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 u=m.ge(this.leftPoints,t,f);u<this.leftPoints.length&&this.leftPoints[u][0]===t[0];++u)if(this.leftPoints[u]===t){this.count-=1,this.leftPoints.splice(u,1);for(var n=m.ge(this.rightPoints,t,d);n<this.rightPoints.length&&this.rightPoints[n][1]===t[1];++n)if(this.rightPoints[n]===t)return this.rightPoints.splice(n,1),b}return y},_.queryPoint=function(t,e){if(t<this.mid){if(this.left){var r=this.left.queryPoint(t,e);if(r)return r}return l(this.leftPoints,t,e)}if(t>this.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)},_.queryInterval=function(t,e,r){if(t<this.mid&&this.left){var n=this.left.queryInterval(t,e,r);if(n)return n}if(e>this.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return e<this.mid?l(this.leftPoints,e,r):t>this.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var w=g.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===x&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){return this.root?this.root.queryPoint(t,e):void 0},w.queryInterval=function(t,e,r){return e>=t&&this.root?this.root.queryInterval(t,e,r):void 0},Object.defineProperty(w,\"count\",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,\"intervals\",{get:function(){return this.root?this.root.intervals([]):[]}})},{\"binary-search-bounds\":268}],270:[function(t,e,r){\"use strict\";function n(t,e){var r,n;if(e[0][0]<e[1][0])r=e[0],n=e[1];else{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 s>o?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]<t[1][1]?(u=t[0],c=t[1]):(u=t[1],c=t[0]);var h=a(n,r,u);return h?h:(h=a(n,r,c),h?h:c-n)}function i(t,e){var r,i;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]<t[1][0])o=t[0],s=t[1];else{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(0>l){if(0>=u)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),0>l){if(0>=u)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\":195}],271:[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?r:e.right?l(t,e.right):void 0}function u(t,e,r,n){var i=e(t,n.key);if(0>=i){if(n.left){var a=u(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}return n.right?u(t,e,r,n.right):void 0}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(0>=o){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}return s>0&&i.right?c(t,e,r,n,i.right):void 0}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=m);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=m,r._color=m,s._color=m,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=m,n._color=m,e._color=m,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===m){if(r._color===v)return r._color=m,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+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if(n=r.left,n.left&&n.left._color===v){if(n=r.left=i(n),s=n.left=i(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=m,r._color=m,s._color=m,o(r),o(n),l>1){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=m,n._color=m,e._color=m,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===m){if(r._color===v)return r._color=m,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+1<t.length?t[l+1]=e:t.push(e),l+=2}}}function p(t,e){return e>t?-1:t>e?1:0}function g(t){return new s(t||p,null)}e.exports=g;var v=0,m=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=0>=c?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===m||i._color===m)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=m,f.right=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var g=l[h-3];g.left===d?g.left=f:g.right=f}break}f._color=m,d.right=a(m,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=m,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var g=l[h-3];g.left===d?g.left=i:g.right=i}break}f._color=m,d.right=a(m,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=m,f.left=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var g=l[h-3];g.right===d?g.right=f:g.left=f}break}f._color=m,d.left=a(m,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=m,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var g=l[h-3];g.right===d?g.right=i:g.left=i}break}f._color=m,d.left=a(m,p),d._color=v,h-=1}}return l[0]._color=m,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(0>t)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new h(this,r);if(t-=1,!e.right)break;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),0>=a&&(i=n.length),r=0>=a?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),0>a&&(i=n.length),r=0>a?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=0>=a?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=0>a?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=0>=i?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=0>=n?r.left:r.right}};var b=h.prototype;Object.defineProperty(b,\"valid\",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,\"node\",{\n",
"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;i<e.length;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?f(r,r.left):r.right&&f(r,r.right),r._color=m;for(var i=0;i<e.length-1;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(var i=0;i<e.length;++i)e[i]._count--;var u=e[e.length-2];return d(e),u.left===r?u.left=null:u.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(b,\"key\",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(b,\"value\",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},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}})},{}],272:[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]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=h(n,i,e);if(0>s)t=t.left;else if(s>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;e>a;++a){var l=t[a],u=l[0][0]<l[1][0];i[2*a]=new s(l[0][0],l,u,a),i[2*a+1]=new s(l[1][0],l,!u,a)}i.sort(function(t,e){var r=t.x-e.x;return r?r:(r=t.create-e.create,r?r:Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))});for(var h=c(f),d=[],p=[],g=[],a=0;r>a;){for(var v=i[a].x,m=[];r>a;){var y=i[a];if(y.x!==v)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(m.push(new o(y.segment[0][1],y.index,!0,!0)),m.push(new o(y.segment[1][1],y.index,!1,!1))):(m.push(new o(y.segment[1][1],y.index,!0,!1)),m.push(new o(y.segment[0][1],y.index,!1,!0)))):h=y.create?h.insert(y.segment,y.index):h.remove(y.segment)}d.push(h.root),p.push(v),g.push(m)}return new n(d,p,g)}e.exports=l;var u=t(\"binary-search-bounds\"),c=t(\"functional-red-black-tree\"),h=t(\"robust-orientation\"),f=t(\"./lib/order-segments\"),d=n.prototype;d.castUp=function(t){var e=u.le(this.coordinates,t[0]);if(0>e)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){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){var d=l[c];if(t[1]===d.y){if(d.closed)return d.index;for(;c<l.length-1&&l[c+1].y===t[1];)if(c+=1,d=l[c],d.closed)return d.index;if(d.y===t[1]&&!d.start){if(c+=1,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\":270,\"binary-search-bounds\":268,\"functional-red-black-tree\":271,\"robust-orientation\":195}],273:[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):!1}}function a(t){for(var e={},r=0;r<t.length;++r){var n=t[r],a=n[0][0],o=n[0][1],s=n[1][1],l=[Math.min(o,s),Math.max(o,s)];a in e?e[a].push(l):e[a]=[l]}for(var u={},c=Object.keys(e),r=0;r<c.length;++r){var h=e[c[r]];u[c[r]]=d(h)}return i(u)}function o(t,e){return function(r){var n=p.le(e,r[0]);if(0>n)return 1;var i=t[n];if(!i){if(!(n>0&&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]<o[1][0])if(0>s)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(0>s))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;e>i;++i)for(var c=t[i],h=c.length,d=h-1,p=0;h>p;d=p++){var g=c[d],v=c[p];g[0]===v[0]?n.push([g,v]):r.push([g,v])}if(0===r.length)return 0===n.length?s:l(a(n));var m=f(r),y=o(m.slabs,m.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t(\"robust-orientation\")[3],f=t(\"slab-decomposition\"),d=t(\"interval-tree-1d\"),p=t(\"binary-search-bounds\")},{\"binary-search-bounds\":268,\"interval-tree-1d\":269,\"robust-orientation\":195,\"slab-decomposition\":272}],274:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;r>i;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),h=u(o[0],a[1]),f=u(o[0],o[1]);n=c(n,c(c(s,l),c(h,f)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;e>r;++r)if(!O[t[r]])return!1;return!0}var d=f(t,e);t=d[0],e=d[1];for(var p=e.length,g=(t.length,o(t,e.length)),v=0;p>v;++v)if(g[v].length%2===1)throw new Error(\"planar-graph-to-polyline: graph must be manifold\");var m=s(t,e);m=m.filter(r);for(var y=m.length,b=new Array(y),x=new Array(y),v=0;y>v;++v){b[v]=v;var _=new Array(y),w=m[v].map(function(t){return e[t]}),k=l([w]),A=0;t:for(var M=0;y>M;++M)if(_[M]=0,v!==M){for(var L=m[M],T=L.length,E=0;T>E;++E){var C=k(e[L[E]]);if(0!==C){0>C&&(_[M]=1,A+=1);continue t}}_[M]=1,A+=1}x[v]=[A,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;y>v;++v)for(var _=x[v],S=_[1],z=_[2],M=0;y>M;++M)z[M]&&(b[M]=S);for(var P=i(y),v=0;y>v;++v)P[v].push(b[v]),P[b[v]].push(v);for(var j={},O=n(p,!1),v=0;y>v;++v)for(var L=m[v],T=L.length,M=0;T>M;++M){var I=L[M],D=L[(M+1)%T],R=Math.min(I,D)+\":\"+Math.max(I,D);if(R in j){var F=j[R];P[F].push(v),P[v].push(F),O[I]=O[D]=!0}else j[R]=v}for(var N=[],B=n(y,-1),v=0;y>v;++v)b[v]!==v||a(m[v])?B[v]=-1:(N.push(v),B[v]=0);for(var d=[];N.length>0;){var U=N.pop(),V=P[U];h(V,function(t,e){return t-e});var q,H=V.length,G=B[U];if(0===G){var L=m[U];q=[L]}for(var v=0;H>v;++v){var Y=V[v];if(!(B[Y]>=0)&&(B[Y]=1^G,N.push(Y),0===G)){var L=m[Y];a(L)||(L.reverse(),q.push(L))}}0===G&&d.push(q)}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\":262,\"edges-to-adjacency-list\":263,\"planar-dual\":264,\"point-in-big-polygon\":273,\"robust-sum\":198,\"two-product\":215,uniq:218}],275:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],276:[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;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],277:[function(t,e,r){arguments[4][171][0].apply(r,arguments)},{\"bit-twiddle\":275,dup:171,\"union-find\":276}],278:[function(t,e,r){\"use strict\";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=m[t],i=y[t];return 0>r||0>i?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=M[t],n=M[e];M[t]=n,M[e]=r,L[r]=e,L[n]=t}function s(t){return b[M[t]]}function l(t){return 1&t?t-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(E>n){var l=s(n);r>l&&(o=n,r=l)}if(E>i){var u=s(i);r>u&&(o=i)}if(o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(n>e){a(t,r),t=r;continue}}return t}}function h(){if(E>0){var t=M[0];return a(0,E-1),E-=1,u(0),t}return-1}function f(t,e){var r=M[t];return b[r]===e?t:(b[r]=-(1/0),c(t),h(),b[r]=e,E+=1,c(E-1))}function d(t){if(!x[t]){x[t]=!0;var e=m[t],r=y[t];m[r]>=0&&(m[r]=e),y[e]>=0&&(y[e]=r),L[e]>=0&&f(L[e],i(e)),L[r]>=0&&f(L[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||0>i||i===n)break;if(n=i,i=t[n],!x[n]||0>i||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 g=e.length,v=t.length,m=new Array(g),y=new Array(g),b=new Array(g),x=new Array(g),_=0;g>_;++_)m[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;v>_;++_){var w=t[_];if(2!==w.length)throw new Error(\"Input must be a graph\");var k=w[1],A=w[0];-1!==y[A]?y[A]=-2:y[A]=k,-1!==m[k]?m[k]=-2:m[k]=A}for(var M=[],L=new Array(g),_=0;g>_;++_){var T=b[_]=i(_);1/0>T?(L[_]=M.length,M.push(_)):L[_]=-1}for(var E=M.length,_=E>>1;_>=0;--_)u(_);for(;;){var C=h();if(0>C||b[C]>r)break;d(C)}for(var S=[],_=0;g>_;++_)x[_]||(L[_]=S.length,S.push(e[_].slice()));var z=(S.length,[]);return t.forEach(function(t){var e=p(m,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=L[e],i=L[r];n!==i&&z.push([n,i])}}),o.unique(o.normalize(z)),{positions:S,edges:z}}e.exports=i;var a=t(\"robust-orientation\"),o=t(\"simplicial-complex\")},{\"robust-orientation\":195,\"simplicial-complex\":277}],279:[function(t,e,r){e.exports=[\"\",{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}]},{}],280:[function(t,e,r){var n=t(\"../../plotly\"),i=t(\"./arrow_paths\"),a=t(\"../../plots/font_attributes\"),o=t(\"../../lib/extend\").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:\"string\"},textangle:{valType:\"angle\",dflt:0},font:o({},a,{}),opacity:{valType:\"number\",min:0,max:1,dflt:1},align:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"center\"},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:i.length,dflt:1},arrowsize:{valType:\"number\",min:.3,dflt:1},arrowwidth:{valType:\"number\",min:.1},ax:{valType:\"number\",dflt:-10},ay:{valType:\"number\",dflt:-30},xref:{valType:\"enumerated\",values:[\"paper\",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString()]},x:{valType:\"number\"},xanchor:{valType:\"enumerated\",values:[\"auto\",\"left\",\"center\",\"right\"],dflt:\"auto\"},yref:{valType:\"enumerated\",values:[\"paper\",n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},y:{valType:\"number\"},yanchor:{valType:\"enumerated\",values:[\"auto\",\"top\",\"middle\",\"bottom\"],dflt:\"auto\"},_deprecated:{ref:{valType:\"string\"}}}},{\"../../lib/extend\":310,\"../../plotly\":330,\"../../plots/font_attributes\":336,\"./arrow_paths\":279}],281:[function(t,e,r){\"use strict\";function n(t,e){function r(e,r){return o.Lib.coerce(t,n,u.layoutAttributes,e,r)}var n={};r(\"opacity\"),r(\"align\"),r(\"bgcolor\");var i=r(\"bordercolor\"),a=o.Color.opacity(i);r(\"borderpad\");var s=r(\"borderwidth\"),l=r(\"showarrow\");l&&(r(\"arrowcolor\",a?n.bordercolor:o.Color.defaultLine),r(\"arrowhead\"),r(\"arrowsize\"),r(\"arrowwidth\",2*(a&&s||1)),r(\"ax\"),r(\"ay\"),o.Lib.noneOrAll(t,n,[\"ax\",\"ay\"])),r(\"text\",l?\"&nbsp;\":\"new text\"),r(\"textangle\"),o.Lib.coerceFont(r,\"font\",e.font);for(var c=[\"x\",\"y\"],h=0;2>h;h++){var f=c[h],d={_fullLayout:e},p=o.Axes.coerceRef(t,n,d,f),g=.5;if(\"paper\"!==p){var v=o.Axes.getFromId(d,p);if(g=v.range[0]+g*(v.range[1]-v.range[0]),-1!==[\"date\",\"category\"].indexOf(v.type)&&\"string\"==typeof t[f]){var m;\"date\"===v.type?(m=o.Lib.dateTime2ms(t[f]),m!==!1&&(t[f]=m)):(v._categories||[]).length&&(m=v._categories.indexOf(t[f]),-1!==m&&(t[f]=m))}}r(f,g),l||r(f+\"anchor\")}return o.Lib.noneOrAll(t,n,[\"x\",\"y\"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=o.Axes.getFromId(t,e.xref),n=o.Axes.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,a=e._xshift||0,s=(e._ysize||0)/2,l=e._yshift||0,u=i-a,c=i+a,h=s-l,f=s+l;if(e.showarrow){var d=3*e.arrowsize*e.arrowwidth;u=Math.max(u,d),c=Math.max(c,d),h=Math.max(h,d),f=Math.max(f,d)}r&&r.autorange&&o.Axes.expand(r,[r.l2c(e.x)],{ppadplus:c,ppadminus:u}),n&&n.autorange&&o.Axes.expand(n,[n.l2c(e.y)],{ppadplus:f,ppadminus:h})}})}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,d=s-a,p=l*d-c*h;if(0===p)return null;var g=(u*d-c*f)/p,v=(u*h-l*f)/p;return 0>v||v>1||0>g||g>1?null:{x:t+l*g,y:e+h*g}}var o=t(\"../../plotly\"),s=t(\"d3\"),l=t(\"fast-isnumeric\"),u=e.exports={};u.ARROWPATHS=t(\"./arrow_paths\"),u.layoutAttributes=t(\"./attributes\"),u.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],a=0;a<r.length;a++)i.push(n(r[a]||{},e))},u.drawAll=function(t){var e=t._fullLayout;e._infolayer.selectAll(\".annotation\").remove();for(var r=0;r<e.annotations.length;r++)u.draw(t,r);return o.Plots.previousPromises(t)},u.add=function(t){var e=t._fullLayout.annotations.length;o.relayout(t,\"annotations[\"+e+\"]\",\"add\")},u.draw=function(t,e,r,i){function c(t){return t.call(o.Drawing.font,Y).attr({\"text-anchor\":{left:\"start\",right:\"end\"}[O.align]||\"middle\"}),o.util.convertToTspans(t,h),t}function h(){function r(t,e){return\"auto\"===e&&(e=1/3>t?\"left\":t>2/3?\"right\":\"center\"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}W.selectAll(\"tspan.line\").attr({y:0,x:0});var n=U.select(\".annotation-math-group\"),i=!n.empty(),l=o.Drawing.bBox((i?n:W).node()),c=l.width,h=l.height,f=Math.round(c+2*H),d=Math.round(h+2*H);O._w=c,O._h=h;var g=!1;if([\"x\",\"y\"].forEach(function(e){var n,i=o.Axes.getFromId(t,O[e+\"ref\"]||e),a=(F+(\"x\"===e?0:90))*Math.PI/180,s=f*Math.abs(Math.cos(a))+d*Math.abs(Math.sin(a)),l=O[e+\"anchor\"];if(i){if(!i.autorange&&(O[e]-i.range[0])*(O[e]-i.range[1])>0)return void(g=!0);R[e]=i._offset+i.l2p(O[e]),n=.5}else n=O[e],\"y\"===e&&(n=1-n),R[e]=\"x\"===e?w.l+w.w*n:w.t+w.h*n;var u=0;u=O.showarrow?O[\"a\"+e]:s*r(n,l),R[e]+=u,O[\"_\"+e+\"type\"]=i&&i.type,O[\"_\"+e+\"size\"]=s,O[\"_\"+e+\"shift\"]=u}),g)return void U.remove();var v,m;O.showarrow&&(v=o.Lib.constrain(R.x-O.ax,1,p.width-1),m=o.Lib.constrain(R.y-O.ay,1,p.height-1)),R.x=o.Lib.constrain(R.x,1,p.width-1),R.y=o.Lib.constrain(R.y,1,p.height-1);var y=H-l.top,b=H-l.left;i?n.select(\"svg\").attr({x:H-1,y:H}):(W.attr({x:b,y:y}),W.selectAll(\"tspan.line\").attr({y:y,x:b})),G.call(o.Drawing.setRect,V/2,V/2,f-V,d-V),U.call(o.Drawing.setRect,Math.round(R.x-f/2),Math.round(R.y-d/2),f,d);var x=\"annotations[\"+e+\"]\",_=function(r,n){s.select(t).selectAll('.annotation-arrow-g[data-index=\"'+e+'\"]').remove();var i=R.x+r,l=R.y+n,c=o.Lib.rotationXYMatrix(F,i,l),h=o.Lib.apply2DTransform(c),f=o.Lib.apply2DTransform2(c),d=G.attr(\"width\")/2,p=G.attr(\"height\")/2,g=[[i-d,l-p,i-d,l+p],[i-d,l+p,i+d,l+p],[i+d,l+p,i+d,l-p],[i+d,l-p,i-d,l-p]].map(f);if(!g.reduce(function(t,e){return t^!!a(v,m,v+1e6,m+1e6,e[0],e[1],e[2],e[3])},!1)){g.forEach(function(t){var e=a(i,l,v,m,t[0],t[1],t[2],t[3]);e&&(i=e.x,l=e.y)});var y=O.arrowwidth,b=O.arrowcolor,_=N.append(\"g\").style({opacity:o.Color.opacity(b)}).classed(\"annotation-arrow-g\",!0).attr(\"data-index\",String(e)),k=_.append(\"path\").attr(\"d\",\"M\"+i+\",\"+l+\"L\"+v+\",\"+m).style(\"stroke-width\",y+\"px\").call(o.Color.stroke,o.Color.rgb(b));u.arrowhead(k,O.arrowhead,\"end\",O.arrowsize);var A=_.append(\"path\").classed(\"annotation\",!0).classed(\"anndrag\",!0).attr({\"data-index\":String(e),d:\"M3,3H-3V-3H3ZM0,0L\"+(i-v)+\",\"+(l-m),transform:\"translate(\"+v+\",\"+m+\")\"}).style(\"stroke-width\",y+6+\"px\").call(o.Color.stroke,\"rgba(0,0,0,0)\").call(o.Color.fill,\"rgba(0,0,0,0)\");if(t._context.editable){var M,L,T;o.Fx.dragElement({element:A.node(),prepFn:function(){L=Number(U.attr(\"x\")),T=Number(U.attr(\"y\")),M={},I&&I.autorange&&(M[I._name+\".autorange\"]=!0),D&&D.autorange&&(M[D._name+\".autorange\"]=!0)},moveFn:function(t,e){_.attr(\"transform\",\"translate(\"+t+\",\"+e+\")\");var r=h(L,T),n=r[0]+t,i=r[1]+e;U.call(o.Drawing.setPosition,n,i),M[x+\".x\"]=I?O.x+t/I._m:(v+t-w.l)/w.w,M[x+\".y\"]=D?O.y+e/D._m:1-(m+e-w.t)/w.h,B.attr({transform:\"rotate(\"+F+\",\"+n+\",\"+i+\")\"})},doneFn:function(e){if(e){o.relayout(t,M);var r=document.querySelector(\".js-notes-box-panel\");r&&r.redraw(r.selectedObj)}}})}}};O.showarrow&&_(0,0);var k=o.Lib.rotationXYMatrix(F,R.x,R.y),A=o.Lib.apply2DTransform(k);if(t._context.editable){var M,L,T;o.Fx.dragElement({element:U.node(),prepFn:function(){M=Number(U.attr(\"x\")),L=Number(U.attr(\"y\")),T={}},moveFn:function(t,e){U.call(o.Drawing.setPosition,M+t,L+e);var r=\"pointer\";if(O.showarrow)T[x+\".ax\"]=O.ax+t,T[x+\".ay\"]=O.ay+e,_(t,e);else{if(I)T[x+\".x\"]=O.x+t/I._m;else{var n=O._xsize/w.w,i=O.x+O._xshift/w.w-n/2;T[x+\".x\"]=o.Fx.dragAlign(i+t/w.w,n,0,1,O.xanchor)}if(D)T[x+\".y\"]=O.y+e/D._m;else{var a=O._ysize/w.h,s=O.y-O._yshift/w.h-a/2;T[x+\".y\"]=o.Fx.dragAlign(s-e/w.h,a,0,1,O.yanchor)}I&&D||(r=o.Fx.dragCursors(I?.5:T[x+\".x\"],D?.5:T[x+\".y\"],O.xanchor,O.yanchor))}var l=A(M,L),u=l[0]+t,c=l[1]+e;U.call(o.Drawing.setPosition,u,c),B.attr({transform:\"rotate(\"+F+\",\"+u+\",\"+c+\")\"}),o.Fx.setCursor(U,r)},doneFn:function(e){if(o.Fx.setCursor(U),e){o.relayout(t,T);var r=document.querySelector(\".js-notes-box-panel\");r&&r.redraw(r.selectedObj)}}})}}var f,d=t.layout,p=t._fullLayout;if(!l(e)||-1===e){if(!e&&Array.isArray(i))return d.annotations=i,u.supplyLayoutDefaults(d,p),void u.drawAll(t);if(\"remove\"===i)return delete d.annotations,p.annotations=[],void u.drawAll(t);if(r&&\"add\"!==i){for(f=0;f<p.annotations.length;f++)u.draw(t,f,r,i);return}e=p.annotations.length,p.annotations.push({})}if(!r&&i){if(\"remove\"===i){for(p._infolayer.selectAll('.annotation[data-index=\"'+e+'\"]').remove(),p.annotations.splice(e,1),d.annotations.splice(e,1),f=e;f<p.annotations.length;f++)p._infolayer.selectAll('.annotation[data-index=\"'+(f+1)+'\"]').attr(\"data-index\",String(f)),u.draw(t,f);return}if(\"add\"===i||o.Lib.isPlainObject(i)){p.annotations.splice(e,0,{});var g=o.Lib.isPlainObject(i)?o.Lib.extendFlat({},i):{text:\"New text\"};for(d.annotations?d.annotations.splice(e,0,g):d.annotations=[g],f=p.annotations.length-1;f>e;f--)p._infolayer.selectAll('.annotation[data-index=\"'+(f-1)+'\"]').attr(\"data-index\",String(f)),u.draw(t,f)}}p._infolayer.selectAll('.annotation[data-index=\"'+e+'\"]').remove();var v=d.annotations[e],m=p.annotations[e];if(v){var y={xref:v.xref,yref:v.yref},b={};\"string\"==typeof r&&r?b[r]=i:o.Lib.isPlainObject(r)&&(b=r);var x=Object.keys(b);for(f=0;f<x.length;f++){var _=x[f];o.Lib.nestedProperty(v,_).set(b[_])}var w=p._size,k=[\"x\",\"y\"];for(f=0;2>f;f++){var A=k[f];if(void 0===b[A]&&void 0!==v[A]){var M=o.Axes.getFromId(t,o.Axes.coerceRef(y,{},t,A)),L=o.Axes.getFromId(t,o.Axes.coerceRef(v,{},t,A)),T=v[A],E=m[\"_\"+A+\"type\"];if(void 0!==b[A+\"ref\"]){var C=\"auto\"===v[A+\"anchor\"],S=\"x\"===A?w.w:w.h,z=(m[\"_\"+A+\"size\"]||0)/(2*S);if(M&&L)T=(T-M.range[0])/(M.range[1]-M.range[0]),T=L.range[0]+T*(L.range[1]-L.range[0]);else if(M){if(T=(T-M.range[0])/(M.range[1]-M.range[0]),T=M.domain[0]+T*(M.domain[1]-M.domain[0]),C){var P=T+z,j=T-z;2/3>T+j?T=j:T+P>4/3&&(T=P)}}else L&&(C&&(1/3>T?T+=z:T>2/3&&(T-=z)),T=(T-L.domain[0])/(L.domain[1]-L.domain[0]),T=L.range[0]+T*(L.range[1]-L.range[0]))}L&&L===M&&E&&(\"log\"===E&&\"log\"!==L.type?T=Math.pow(10,T):\"log\"!==E&&\"log\"===L.type&&(T=T>0?Math.log(T)/Math.LN10:void 0)),v[A]=T}}var O=n(v,p);p.annotations[e]=O;var I=o.Axes.getFromId(t,O.xref),D=o.Axes.getFromId(t,O.yref),R={x:0,y:0},F=+O.textangle||0,N=p._infolayer.append(\"g\").classed(\"annotation\",!0).attr(\"data-index\",String(e)).style(\"opacity\",O.opacity).on(\"click\",function(){t._dragging=!1,t.emit(\"plotly_clickannotation\",{index:e,annotation:v,fullAnnotation:O})}),B=N.append(\"g\").classed(\"annotation-text-g\",!0).attr(\"data-index\",String(e)),U=B.append(\"svg\").call(o.Drawing.setPosition,0,0),V=O.borderwidth,q=O.borderpad,H=V+q,G=U.append(\"rect\").attr(\"class\",\"bg\").style(\"stroke-width\",V+\"px\").call(o.Color.stroke,O.bordercolor).call(o.Color.fill,O.bgcolor),Y=O.font,W=U.append(\"text\").classed(\"annotation\",!0).attr(\"data-unformatted\",O.text).text(O.text);t._context.editable?W.call(o.util.makeEditable,U).call(c).on(\"edit\",function(r){O.text=r,this.attr({\"data-unformatted\":O.text}),this.call(c);var n={};n[\"annotations[\"+e+\"].text\"]=O.text,I&&I.autorange&&(n[I._name+\".autorange\"]=!0),D&&D.autorange&&(n[D._name+\".autorange\"]=!0),o.relayout(t,n)}):W.call(c),B.attr({transform:\"rotate(\"+F+\",\"+R.x+\",\"+R.y+\")\"}).call(o.Drawing.setPosition,R.x,R.y)}},u.arrowhead=function(t,e,r,n){l(n)||(n=1);var i=t.node(),a=u.ARROWPATHS[e||0];if(a){\"string\"==typeof r&&r||(r=\"end\");var c,h,f,d,p=(o.Drawing.getPx(t,\"stroke-width\")||1)*n,g=t.style(\"stroke\")||o.Color.defaultLine,v=t.style(\"stroke-opacity\")||1,m=r.indexOf(\"start\")>=0,y=r.indexOf(\"end\")>=0,b=a.backoff*p;if(\"line\"===i.nodeName){if(c={x:+t.attr(\"x1\"),y:+t.attr(\"y1\")},h={x:+t.attr(\"x2\"),y:+t.attr(\"y2\")},f=Math.atan2(c.y-h.y,c.x-h.x),d=f+Math.PI,b){var x=b*Math.cos(f),_=b*Math.sin(f);m&&(c.x-=x,c.y-=_,t.attr({x1:c.x,y1:c.y})),y&&(h.x+=x,h.y+=_,t.attr({x2:h.x,y2:h.y}))}}else if(\"path\"===i.nodeName){var w=i.getTotalLength(),k=\"\";if(m){var A=i.getPointAtLength(0),M=i.getPointAtLength(.1);f=Math.atan2(A.y-M.y,A.x-M.x),c=i.getPointAtLength(Math.min(b,w)),b&&(k=\"0px,\"+b+\"px,\")}if(y){var L=i.getPointAtLength(w),T=i.getPointAtLength(w-.1);if(d=Math.atan2(L.y-T.y,L.x-T.x),h=i.getPointAtLength(Math.max(0,w-b)),b){var E=k?2*b:b;k+=w-E+\"px,\"+w+\"px\"}}else k&&(k+=w+\"px\");k&&t.style(\"stroke-dasharray\",k)}var C=function(r,n){e>5&&(n=0),s.select(i.parentElement).append(\"path\").attr({\"class\":t.attr(\"class\"),d:a.path,transform:\"translate(\"+r.x+\",\"+r.y+\")rotate(\"+180*n/Math.PI+\")scale(\"+p+\")\"}).style({fill:g,opacity:v,\"stroke-width\":0})};m&&C(c,f),y&&C(h,d)}},u.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var a=o.Axes.list(t).filter(function(t){return t.autorange&&n[t._id]});if(a.length)return o.Lib.syncOrAsync([u.drawAll,i],t)}}},{\"../../plotly\":330,\"./arrow_paths\":279,\"./attributes\":280,d3:53,\"fast-isnumeric\":58}],282:[function(t,e,r){r.defaults=[\"#1f77b4\",\"#ff7f0e\",\"#2ca02c\",\"#d62728\",\"#9467bd\",\"#8c564b\",\"#e377c2\",\"#7f7f7f\",\"#bcbd22\",\"#17becf\"],r.defaultLine=\"#444\",r.lightLine=\"#eee\",r.background=\"#fff\"},{}],283:[function(t,e,r){\"use strict\";function n(t){if(a(t)||\"string\"!=typeof t)return t;var e=t.trim();if(\"rgb\"!==e.substr(0,3))return t;var r=e.match(/^rgba?\\s*\\(([^()]*)\\)$/);if(!r)return t;var n=r[1].trim().split(/\\s*[\\s,]\\s*/),i=\"a\"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=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,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,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||o.background).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},s={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(s).toRgbString()},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;e<s.length;e++)if(i=s[e],a=t[i],\"color\"===i.substr(i.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=n(a[r]);else t[i]=n(a);else if(\"colorscale\"===i.substr(i.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=n(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&\"object\"==typeof l)for(r=0;r<a.length;r++)o.clean(a[r])}else a&&\"object\"==typeof a&&o.clean(a)}}},{\"./attributes\":282,\"fast-isnumeric\":58,tinycolor2:213}],284:[function(t,e,r){var n=t(\"../../plots/cartesian/layout_attributes\"),i=t(\"../../plots/font_attributes\"),a=t(\"../../lib/extend\").extendFlat;e.exports={thicknessmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"pixels\"},thickness:{valType:\"number\",min:0,dflt:30},lenmode:{valType:\"enumerated\",values:[\"fraction\",\"pixels\"],dflt:\"fraction\"},len:{valType:\"number\",min:0,dflt:1},x:{valType:\"number\",dflt:1.02,min:-2,max:3},xanchor:{valType:\"enumerated\",values:[\"left\",\"center\",\"right\"],dflt:\"left\"},xpad:{valType:\"number\",min:0,dflt:10},y:{valType:\"number\",dflt:.5,min:-2,max:3},yanchor:{valType:\"enumerated\",values:[\"top\",\"middle\",\"bottom\"],dflt:\"middle\"},ypad:{valType:\"number\",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:\"number\",min:0,dflt:0},bgcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:a({},n.ticks,{dflt:\"\"}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:\"string\",dflt:\"Click to enter colorscale title\"},titlefont:a({},i,{}),titleside:{valType:\"enumerated\",values:[\"right\",\"top\",\"bottom\"],dflt:\"top\"}}},{\"../../lib/extend\":310,\"../../plots/cartesian/layout_attributes\":335,\"../../plots/font_attributes\":336}],285:[function(t,e,r){\"use strict\";var n=t(\"../../plotly\"),i=t(\"d3\"),a=t(\"fast-isnumeric\"),o=e.exports=function(t,e){function r(){function o(t,e){return n.Lib.coerce(I,D,n.Axes.layoutAttributes,t,e)}function s(){if(-1!==[\"top\",\"bottom\"].indexOf(a.titleside)){var e=V.select(\".cbtitle\"),r=e.select(\"text\"),o=[-a.outlinewidth/2,a.outlinewidth/2],s=e.select(\".h\"+D._id+\"title-math-group\").node(),l=15.6;if(r.node()&&(l=1.3*parseInt(r.style(\"font-size\"),10)),s?(H=n.Drawing.bBox(s).height,H>l&&(o[1]-=(H-l)/2)):r.node()&&!r.classed(\"js-placeholder\")&&(H=n.Drawing.bBox(e.node()).height),H){if(H+=5,\"top\"===a.titleside)D.domain[1]-=H/u._size.h,o[1]*=-1;else{D.domain[0]+=H/u._size.h;var c=Math.max(1,r.selectAll(\"tspan.line\").size());o[1]+=(1-c)*l}e.attr(\"transform\",\"translate(\"+o+\")\"),D.setScale()}}V.selectAll(\".cbfills,.cblines,.cbaxis\").attr(\"transform\",\"translate(0,\"+Math.round(u._size.h*(1-D.domain[1]))+\")\");var v=V.select(\".cbfills\").selectAll(\"rect.cbfill\").data(d);v.enter().append(\"rect\").classed(\"cbfill\",!0).style(\"stroke\",\"none\"),v.exit().remove(),v.each(function(t,e){var r=[0===e?h[0]:(d[e]+d[e-1])/2,e===d.length-1?h[1]:(d[e]+d[e+1])/2].map(D.c2p).map(Math.round);e!==d.length-1&&(r[1]+=r[1]>r[0]?1:-1),i.select(this).attr({x:S,width:Math.max(k,2),y:i.min(r),height:Math.max(i.max(r)-i.min(r),2)}).style(\"fill\",g(t))});var m=V.select(\".cblines\").selectAll(\"path.cbline\").data(a.line.color&&a.line.width?f:[]);return m.enter().append(\"path\").classed(\"cbline\",!0),m.exit().remove(),m.each(function(t){i.select(this).attr(\"d\",\"M\"+S+\",\"+(Math.round(D.c2p(t))+a.line.width/2%1)+\"h\"+k).call(n.Drawing.lineGroupStyle,a.line.width,p(t),a.line.dash)}),D._axislayer.selectAll(\"g.\"+D._id+\"tick,path\").remove(),D._pos=S+k+(a.outlinewidth||0)/2-(\"outside\"===a.ticks?1:0),D.side=\"right\",n.Axes.doTicks(t,D)}function l(){var r=k+a.outlinewidth/2+n.Drawing.bBox(D._axislayer.node()).width;if(x=q.select(\"text\"),x.node()&&!x.classed(\"js-placeholder\")){var i,o=q.select(\".h\"+D._id+\"title-math-group\").node();i=o&&-1!==[\"top\",\"bottom\"].indexOf(a.titleside)?n.Drawing.bBox(o).width:n.Drawing.bBox(q.node()).right-S-u._size.l,r=Math.max(r,i)}var s=2*a.xpad+r+a.borderwidth+a.outlinewidth/2,l=j-O;V.select(\".cbbg\").attr({x:S-a.xpad-(a.borderwidth+a.outlinewidth)/2,y:O-E,width:Math.max(s,2),height:Math.max(l+2*E,2)}).call(n.Color.fill,a.bgcolor).call(n.Color.stroke,a.bordercolor).style({\"stroke-width\":a.borderwidth}),V.selectAll(\".cboutline\").attr({x:S,y:O+a.ypad+(\"top\"===a.titleside?H:0),width:Math.max(k,2),height:Math.max(l-2*a.ypad-H,2)}).call(n.Color.stroke,a.outlinecolor).style({fill:\"None\",\"stroke-width\":a.outlinewidth});var c=({center:.5,right:1}[a.xanchor]||0)*s;V.attr(\"transform\",\"translate(\"+(u._size.l-c)+\",\"+u._size.t+\")\"),n.Plots.autoMargin(t,e,{x:a.x,y:a.y,l:s*({right:1,center:.5}[a.xanchor]||0),r:s*({left:1,center:.5}[a.xanchor]||0),t:l*({bottom:1,middle:.5}[a.yanchor]||0),b:l*({top:1,middle:.5}[a.yanchor]||0)})}var u=t._fullLayout;if(\"function\"!=typeof a.fillcolor&&\"function\"!=typeof a.line.color)return void u._infolayer.selectAll(\"g.\"+e).remove();var c,h=i.extent((\"function\"==typeof a.fillcolor?a.fillcolor:a.line.color).domain()),f=[],d=[],p=\"function\"==typeof a.line.color?a.line.color:function(){return a.line.color},g=\"function\"==typeof a.fillcolor?a.fillcolor:function(){return a.fillcolor},v=a.levels.end+a.levels.size/100,m=a.levels.size,y=1.001*h[0]-.001*h[1],b=1.001*h[1]-.001*h[0];for(c=a.levels.start;0>(c-v)*m;c+=m)c>y&&b>c&&f.push(c);if(\"function\"==typeof a.fillcolor)if(a.filllevels)for(v=a.filllevels.end+a.filllevels.size/100,m=a.filllevels.size,c=a.filllevels.start;0>(c-v)*m;c+=m)c>h[0]&&c<h[1]&&d.push(c);else d=f.map(function(t){\n",
"return t-a.levels.size/2}),d.push(d[d.length-1]+a.levels.size);else a.fillcolor&&\"string\"==typeof a.fillcolor&&(d=[0]);a.levels.size<0&&(f.reverse(),d.reverse());var x,_=u.height-u.margin.t-u.margin.b,w=u.width-u.margin.l-u.margin.r,k=Math.round(a.thickness*(\"fraction\"===a.thicknessmode?w:1)),A=k/u._size.w,M=Math.round(a.len*(\"fraction\"===a.lenmode?_:1)),L=M/u._size.h,T=a.xpad/u._size.w,E=(a.borderwidth+a.outlinewidth)/2,C=a.ypad/u._size.h,S=Math.round(a.x*u._size.w+a.xpad),z=a.x-A*({middle:.5,right:1}[a.xanchor]||0),P=a.y+L*(({top:-.5,bottom:.5}[a.yanchor]||0)-.5),j=Math.round(u._size.h*(1-P)),O=j-M,I={type:\"linear\",range:h,tickmode:a.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,showticklabels:a.showticklabels,tickfont:a.tickfont,tickangle:a.tickangle,tickformat:a.tickformat,exponentformat:a.exponentformat,showexponent:a.showexponent,showtickprefix:a.showtickprefix,tickprefix:a.tickprefix,showticksuffix:a.showticksuffix,ticksuffix:a.ticksuffix,title:a.title,titlefont:a.titlefont,anchor:\"free\",position:1},D={},R={letter:\"y\",font:u.font,noHover:!0};if(n.Axes.handleAxisDefaults(I,D,o,R),n.Axes.handleAxisPositioningDefaults(I,D,o,R),D._id=\"y\"+e,D._td=t,D.position=a.x+T+A,r.axis=D,-1!==[\"top\",\"bottom\"].indexOf(a.titleside)&&(D.titleside=a.titleside,D.titlex=a.x+T,D.titley=P+(\"top\"===a.titleside?L-C:C)),a.line.color&&\"auto\"===a.tickmode){D.tickmode=\"linear\",D.tick0=a.levels.start;var F=a.levels.size,N=n.Lib.constrain((j-O)/50,4,15)+1,B=(h[1]-h[0])/((a.nticks||N)*F);if(B>1){var U=Math.pow(10,Math.floor(Math.log(B)/Math.LN10));F*=U*n.Lib.roundUp(B/U,[2,5,10]),(Math.abs(a.levels.start)/a.levels.size+1e-6)%1<2e-6&&(D.tick0=0)}D.dtick=F}D.domain=[P+C,P+L-C],D.setScale();var V=u._infolayer.selectAll(\"g.\"+e).data([0]);V.enter().append(\"g\").classed(e,!0).each(function(){var t=i.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)}),V.attr(\"transform\",\"translate(\"+Math.round(u._size.l)+\",\"+Math.round(u._size.t)+\")\");var q=V.select(\".cbtitleunshift\").attr(\"transform\",\"translate(-\"+Math.round(u._size.l)+\",-\"+Math.round(u._size.t)+\")\");D._axislayer=V.select(\".cbaxis\");var H=0;-1!==[\"top\",\"bottom\"].indexOf(a.titleside)&&n.Titles.draw(t,D._id+\"title\");var G=n.Lib.syncOrAsync([n.Plots.previousPromises,s,n.Plots.previousPromises,l],t);if(G&&G.then&&(t._promises||[]).push(G),t._context.editable){var Y,W,X;n.Fx.dragElement({element:V.node(),prepFn:function(){Y=V.attr(\"transform\"),n.Fx.setCursor(V)},moveFn:function(e,r){var i=t._fullLayout._size;V.attr(\"transform\",Y+\" translate(\"+e+\",\"+r+\")\"),W=n.Fx.dragAlign(z+e/i.w,A,0,1,a.xanchor),X=n.Fx.dragAlign(P-r/i.h,L,0,1,a.yanchor);var o=n.Fx.dragCursors(W,X,a.xanchor,a.yanchor);n.Fx.setCursor(V,o)},doneFn:function(r){if(n.Fx.setCursor(V),r&&void 0!==W&&void 0!==X){var i,a=e.substr(2);t._fullData.some(function(t){return t.uid===a?(i=t.index,!0):void 0}),n.restyle(t,{\"colorbar.x\":W,\"colorbar.y\":X},i)}}})}return G}var a={};return Object.keys(o.attributes).forEach(function(t){a[t]=null}),a.fillcolor=null,a.line={color:null,width:null,dash:null},a.levels={start:null,end:null,size:null},a.filllevels=null,Object.keys(a).forEach(function(t){r[t]=function(e){return arguments.length?(a[t]=n.Lib.isPlainObject(a[t])?n.Lib.extendFlat(a[t],e):e,r):a[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){\"function\"==typeof r[e]&&r[e](t[e])}),r},r._opts=a,r};o.attributes=t(\"./attributes\"),o.supplyDefaults=function(t,e,r){function i(t,e){return n.Lib.coerce(s,a,o.attributes,t,e)}var a=e.colorbar={},s=t.colorbar||{},l=i(\"thicknessmode\");i(\"thickness\",\"fraction\"===l?30/(r.width-r.margin.l-r.margin.r):30);var u=i(\"lenmode\");i(\"len\",\"fraction\"===u?1:r.height-r.margin.t-r.margin.b),i(\"x\"),i(\"xanchor\"),i(\"xpad\"),i(\"y\"),i(\"yanchor\"),i(\"ypad\"),n.Lib.noneOrAll(s,a,[\"x\",\"y\"]),i(\"outlinecolor\"),i(\"outlinewidth\"),i(\"bordercolor\"),i(\"borderwidth\"),i(\"bgcolor\"),n.Axes.handleTickValueDefaults(s,a,i,\"linear\"),n.Axes.handleTickDefaults(s,a,i,\"linear\",{outerTicks:!1,font:r.font,noHover:!0}),i(\"title\"),n.Lib.coerceFont(i,\"titlefont\",r.font),i(\"titleside\")},o.traceColorbar=function(t,e){var r=e[0].trace,s=\"cb\"+r.uid,l=n.Colorscale.getScale(r.colorscale),u=r.zmin,c=r.zmax;if(a(u)||(u=n.Lib.aggNums(Math.min,null,r.z)),a(c)||(c=n.Lib.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll(\".\"+s).remove(),!r.showscale)return void n.Plots.autoMargin(t,s);var h=e[0].t.cb=o(t,s);h.fillcolor(i.scale.linear().domain(l.map(function(t){return u+t[0]*(c-u)})).range(l.map(function(t){return t[1]}))).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)(),n.Lib.markTime(\"done colorbar\")}},{\"../../plotly\":330,\"./attributes\":284,d3:53,\"fast-isnumeric\":58}],286:[function(t,e,r){e.exports={zauto:{valType:\"boolean\",dflt:!0},zmin:{valType:\"number\",dflt:null},zmax:{valType:\"number\",dflt:null},colorscale:{valType:\"colorscale\"},autocolorscale:{valType:\"boolean\",dflt:!0},reversescale:{valType:\"boolean\",dflt:!1},showscale:{valType:\"boolean\",dflt:!0},_deprecated:{scl:{valType:\"colorscale\"},reversescl:{valType:\"boolean\"}}}},{}],287:[function(t,e,r){\"use strict\";function n(t){var e,r=!0,n=0;if(Array.isArray(t)){if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var i=0;i<t.length;i++){if(e=t[i],2!==e.length||+e[0]<n||!o(e[1]).isValid()){r=!1;break}n=+e[0]}return r}return!1}var i=t(\"../../plotly\"),a=t(\"d3\"),o=t(\"tinycolor2\"),s=t(\"fast-isnumeric\"),l=e.exports={};l.scales=t(\"./scales\"),l.defaultScale=l.scales.RdBu,l.attributes=t(\"./attributes\"),l.isValidScale=function(t){return void 0!==l.scales[t]?!0:n(t)},l.getScale=function(t,e){function r(){try{t=l.scales[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=l.defaultScale),t?(\"string\"==typeof t&&(r(),\"string\"==typeof t&&r()),n(t)?t:e):e},l.flipScale=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n},l.hasColorscale=function(t,e){var r=e?i.Lib.nestedProperty(t,e).get()||{}:t,n=r.color,a=!1;if(Array.isArray(n))for(var o=0;o<n.length;o++)if(s(n[o])){a=!0;break}return\"object\"==typeof r&&null!==r&&(a||r.showscale===!0||s(r.cmin)&&s(r.cmax)||l.isValidScale(r.colorscale)||\"object\"==typeof r.colorbar&&null!==r.colorbar)},l.hasColorbar=function(t){return\"object\"==typeof t.colorbar&&null!==t.colorbar},l.handleDefaults=function(t,e,r,n,a){var o,u,c,h,f,d,p=a.prefix,g=a.cLetter,v=p.slice(0,p.length-1),m=p?i.Lib.nestedProperty(t,v).get()||{}:t,y=p?i.Lib.nestedProperty(e,v).get()||{}:e,b=m[g+\"min\"],x=m[g+\"max\"],_=m.colorscale;o=s(b)&&s(x)&&x>b,n(p+g+\"auto\",!o),n(p+g+\"min\"),n(p+g+\"max\"),void 0!==_&&(u=!l.isValidScale(_)),n(p+\"autocolorscale\",u),h=n(p+\"colorscale\"),f=n(p+\"reversescale\"),f&&(y.colorscale=l.flipScale(h)),\"marker.line.\"!==p&&(p&&(c=l.hasColorbar(m)),d=n(p+\"showscale\",c),d&&i.Colorbar.supplyDefaults(m,y,r))},l.calc=function(t,e,r,n){var a,o;r?(a=i.Lib.nestedProperty(t,r).get(),o=i.Lib.nestedProperty(t._input,r).get()):(a=t,o=t._input);var s=a[n+\"auto\"],u=a[n+\"min\"],c=a[n+\"max\"],h=a.colorscale;(s!==!1||void 0===u)&&(u=i.Lib.aggNums(Math.min,null,e)),(s!==!1||void 0===c)&&(c=i.Lib.aggNums(Math.max,null,e)),u===c&&(u-=.5,c+=.5),a[n+\"min\"]=u,a[n+\"max\"]=c,o[n+\"min\"]=u,o[n+\"max\"]=c,a.autocolorscale&&(h=0>u*c?l.scales.RdBu:u>=0?l.scales.Reds:l.scales.Blues,o.colorscale=h,a.reversescale&&(h=l.flipScale(h)),a.colorscale=h)},l.makeScaleFunction=function(t,e,r){for(var n,l=t.length,u=new Array(l),c=new Array(l),h=0;l>h;h++)n=t[h],u[h]=e+n[0]*(r-e),c[h]=n[1];var f=a.scale.linear().domain(u).interpolate(a.interpolateRgb).range(c);return function(t){return s(t)?f(t):o(t).isValid()?t:i.Color.defaultLine}}},{\"../../plotly\":330,\"./attributes\":286,\"./scales\":288,d3:53,\"fast-isnumeric\":58,tinycolor2:213}],288:[function(t,e,r){e.exports={Greys:[[0,\"rgb(0,0,0)\"],[1,\"rgb(255,255,255)\"]],YIGnBu:[[0,\"rgb(8, 29, 88)\"],[.125,\"rgb(37, 52, 148)\"],[.25,\"rgb(34, 94, 168)\"],[.375,\"rgb(29, 145, 192)\"],[.5,\"rgb(65, 182, 196)\"],[.625,\"rgb(127, 205, 187)\"],[.75,\"rgb(199, 233, 180)\"],[.875,\"rgb(237, 248, 217)\"],[1,\"rgb(255, 255, 217)\"]],Greens:[[0,\"rgb(0, 68, 27)\"],[.125,\"rgb(0, 109, 44)\"],[.25,\"rgb(35, 139, 69)\"],[.375,\"rgb(65, 171, 93)\"],[.5,\"rgb(116, 196, 118)\"],[.625,\"rgb(161, 217, 155)\"],[.75,\"rgb(199, 233, 192)\"],[.875,\"rgb(229, 245, 224)\"],[1,\"rgb(247, 252, 245)\"]],YIOrRd:[[0,\"rgb(128, 0, 38)\"],[.125,\"rgb(189, 0, 38)\"],[.25,\"rgb(227, 26, 28)\"],[.375,\"rgb(252, 78, 42)\"],[.5,\"rgb(253, 141, 60)\"],[.625,\"rgb(254, 178, 76)\"],[.75,\"rgb(254, 217, 118)\"],[.875,\"rgb(255, 237, 160)\"],[1,\"rgb(255, 255, 204)\"]],Bluered:[[0,\"rgb(0,0,255)\"],[1,\"rgb(255,0,0)\"]],RdBu:[[0,\"rgb(5, 10, 172)\"],[.35,\"rgb(106, 137, 247)\"],[.5,\"rgb(190,190,190)\"],[.6,\"rgb(220, 170, 132)\"],[.7,\"rgb(230, 145, 90)\"],[1,\"rgb(178, 10, 28)\"]],Reds:[[0,\"rgb(220, 220, 220)\"],[.2,\"rgb(245, 195, 157)\"],[.4,\"rgb(245, 160, 105)\"],[1,\"rgb(178, 10, 28)\"]],Blues:[[0,\"rgb(5, 10, 172)\"],[.35,\"rgb(40, 60, 190)\"],[.5,\"rgb(70, 100, 245)\"],[.6,\"rgb(90, 120, 245)\"],[.7,\"rgb(106, 137, 247)\"],[1,\"rgb(220, 220, 220)\"]],Picnic:[[0,\"rgb(0,0,255)\"],[.1,\"rgb(51,153,255)\"],[.2,\"rgb(102,204,255)\"],[.3,\"rgb(153,204,255)\"],[.4,\"rgb(204,204,255)\"],[.5,\"rgb(255,255,255)\"],[.6,\"rgb(255,204,255)\"],[.7,\"rgb(255,153,255)\"],[.8,\"rgb(255,102,204)\"],[.9,\"rgb(255,102,102)\"],[1,\"rgb(255,0,0)\"]],Rainbow:[[0,\"rgb(150,0,90)\"],[.125,\"rgb(0, 0, 200)\"],[.25,\"rgb(0, 25, 255)\"],[.375,\"rgb(0, 152, 255)\"],[.5,\"rgb(44, 255, 150)\"],[.625,\"rgb(151, 255, 0)\"],[.75,\"rgb(255, 234, 0)\"],[.875,\"rgb(255, 111, 0)\"],[1,\"rgb(255, 0, 0)\"]],Portland:[[0,\"rgb(12,51,131)\"],[.25,\"rgb(10,136,186)\"],[.5,\"rgb(242,211,56)\"],[.75,\"rgb(242,143,56)\"],[1,\"rgb(217,30,30)\"]],Jet:[[0,\"rgb(0,0,131)\"],[.125,\"rgb(0,60,170)\"],[.375,\"rgb(5,255,255)\"],[.625,\"rgb(255,255,0)\"],[.875,\"rgb(250,0,0)\"],[1,\"rgb(128,0,0)\"]],Hot:[[0,\"rgb(0,0,0)\"],[.3,\"rgb(230,0,0)\"],[.6,\"rgb(255,210,0)\"],[1,\"rgb(255,255,255)\"]],Blackbody:[[0,\"rgb(0,0,0)\"],[.2,\"rgb(230,0,0)\"],[.4,\"rgb(230,210,0)\"],[.7,\"rgb(255,255,255)\"],[1,\"rgb(160,200,255)\"]],Earth:[[0,\"rgb(0,0,130)\"],[.1,\"rgb(0,180,180)\"],[.2,\"rgb(40,210,40)\"],[.4,\"rgb(230,230,50)\"],[.6,\"rgb(120,70,20)\"],[1,\"rgb(255,255,255)\"]],Electric:[[0,\"rgb(0,0,0)\"],[.15,\"rgb(30,0,100)\"],[.4,\"rgb(120,0,100)\"],[.6,\"rgb(160,90,0)\"],[.8,\"rgb(230,200,0)\"],[1,\"rgb(255,250,220)\"]],Viridis:[[0,\"#440154\"],[.06274509803921569,\"#48186a\"],[.12549019607843137,\"#472d7b\"],[.18823529411764706,\"#424086\"],[.25098039215686274,\"#3b528b\"],[.3137254901960784,\"#33638d\"],[.3764705882352941,\"#2c728e\"],[.4392156862745098,\"#26828e\"],[.5019607843137255,\"#21918c\"],[.5647058823529412,\"#1fa088\"],[.6274509803921569,\"#28ae80\"],[.6901960784313725,\"#3fbc73\"],[.7529411764705882,\"#5ec962\"],[.8156862745098039,\"#84d44b\"],[.8784313725490196,\"#addc30\"],[.9411764705882353,\"#d8e219\"],[1,\"#fde725\"]]}},{}],289:[function(t,e,r){\"use strict\";function n(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,d/2),c=Math.pow(s*s+l*l,d/2),h=(c*c*i-u*u*s)*n,f=(c*c*o-u*u*l)*n,p=3*c*(u+c),g=3*u*(u+c);return[[a.round(e[0]+(p&&h/p),2),a.round(e[1]+(p&&f/p),2)],[a.round(e[0]-(g&&h/g),2),a.round(e[1]-(g&&f/g),2)]]}var i=t(\"../../plotly\"),a=t(\"d3\"),o=t(\"fast-isnumeric\"),s=e.exports={};s.font=function(t,e,r,n){e&&e.family&&(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(i.Color.fill,n)},s.setPosition=function(t,e,r){t.attr(\"x\",e).attr(\"y\",r)},s.setSize=function(t,e,r){t.attr(\"width\",e).attr(\"height\",r)},s.setRect=function(t,e,r,n,i){t.call(s.setPosition,e,r).call(s.setSize,n,i)},s.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),i=t.yp||r.c2p(t.y),s=a.select(this);o(n)&&o(i)?\"text\"===this.nodeName?s.attr(\"x\",n).attr(\"y\",i):s.attr(\"transform\",\"translate(\"+n+\",\"+i+\")\"):s.remove()})},s.getPx=function(t,e){return Number(t.style(e).replace(/px$/,\"\"))},s.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},s.lineGroupStyle=function(t,e,r,n){t.style(\"fill\",\"none\").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},l=e||o.width||0,u=n||o.dash||\"\";a.select(this).call(i.Color.stroke,r||o.color).call(s.dashLine,u,l)})},s.dashLine=function(t,e,r){var n=Math.max(r,3);\"solid\"===e?e=\"\":\"dot\"===e?e=n+\"px,\"+n+\"px\":\"dash\"===e?e=3*n+\"px,\"+3*n+\"px\":\"longdash\"===e?e=5*n+\"px,\"+5*n+\"px\":\"dashdot\"===e?e=3*n+\"px,\"+n+\"px,\"+n+\"px,\"+n+\"px\":\"longdashdot\"===e&&(e=5*n+\"px,\"+2*n+\"px,\"+n+\"px,\"+2*n+\"px\"),t.style({\"stroke-dasharray\":e,\"stroke-width\":r+\"px\"})},s.fillGroupStyle=function(t){t.style(\"stroke-width\",0).each(function(e){var r=a.select(this);try{r.call(i.Color.fill,e[0].trace.fillcolor)}catch(n){console.log(n,t),r.remove()}})};var l=t(\"./symbol_defs\");s.symbolNames=[],s.symbolFuncs=[],s.symbolNeedLines={},s.symbolNoDot={},s.symbolList=[],Object.keys(l).forEach(function(t){var e=l[t];s.symbolList=s.symbolList.concat([e.n,t,e.n+100,t+\"-open\"]),s.symbolNames[e.n]=t,s.symbolFuncs[e.n]=e.f,e.needLine&&(s.symbolNeedLines[e.n]=!0),e.noDot?s.symbolNoDot[e.n]=!0:s.symbolList=s.symbolList.concat([e.n+200,t+\"-dot\",e.n+300,t+\"-open-dot\"])});var u=s.symbolNames.length,c=\"M0,0.5L0.5,0L0,-0.5L-0.5,0Z\";s.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=s.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=u||t>=400?0:Math.floor(Math.max(t,0))},s.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(i.Plots.traceIs(e,\"symbols\")){var o=i.Scatter.getBubbleSizeFn(e);t.attr(\"d\",function(t){var n;n=\"various\"===t.ms||\"various\"===r.size?3:i.Scatter.isBubble(e)?o(t.ms):(r.size||6)/2,t.mrc=n;var a=s.symbolNumber(t.mx||r.symbol)||0,l=a%100;return t.om=a%200>=100,s.symbolFuncs[l](n)+(a>=200?c:\"\")}).style(\"opacity\",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},u=s.tryColorscale(r,l,\"\"),h=s.tryColorscale(r,l,\"line.\");t.each(function(t){var e,o,s;t.so?(s=n.outlierwidth,o=n.outliercolor,e=r.outliercolor):(s=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,o=\"mlc\"in t?t.mlcc=h(t.mlc):Array.isArray(n.color)?i.Color.defaultLine:n.color,e=\"mc\"in t?t.mcc=u(t.mc):Array.isArray(r.color)?i.Color.defaultLine:r.color||\"rgba(0,0,0,0)\");var l=a.select(this);t.om?l.call(i.Color.stroke,e).style({\"stroke-width\":(s||1)+\"px\",fill:\"none\"}):(l.style(\"stroke-width\",s+\"px\").call(i.Color.fill,e),s&&l.call(i.Color.stroke,o))})}},s.tryColorscale=function(t,e,r){var n=i.Lib.nestedProperty(t,r+\"color\").get(),a=i.Lib.nestedProperty(t,r+\"colorscale\").get(),s=i.Lib.nestedProperty(t,r+\"cauto\").get(),l=i.Lib.nestedProperty(t,r+\"cmin\"),u=i.Lib.nestedProperty(t,r+\"cmax\"),c=l.get(),h=u.get();return a&&Array.isArray(n)?(!s&&o(c)&&o(h)||(c=1/0,h=-(1/0),n.forEach(function(t){o(t)&&(c>t&&(c=+t),t>h&&(h=+t))}),c>h&&(c=0,h=1),l.set(c),u.set(h),i.Lib.nestedProperty(e,r+\"cmin\").set(c),i.Lib.nestedProperty(e,r+\"cmax\").set(h)),i.Colorscale.makeScaleFunction(a,c,h)):i.Lib.identity};var h={start:1,end:-1,middle:0,bottom:1,top:-1},f=1.3;s.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this);if(!t.tx&&!e.text)return void r.remove();var n=t.tp||e.textposition,l=-1!==n.indexOf(\"top\")?\"top\":-1!==n.indexOf(\"bottom\")?\"bottom\":\"middle\",u=-1!==n.indexOf(\"left\")?\"end\":-1!==n.indexOf(\"right\")?\"start\":\"middle\",c=t.ts||e.textfont.size,d=t.mrc?t.mrc/.8+1:0;c=o(c)&&c>0?c:0,r.call(s.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr(\"text-anchor\",u).text(t.tx||e.text).call(i.util.convertToTspans);var p=a.select(this.parentNode),g=r.selectAll(\"tspan.line\"),v=((g[0].length||1)-1)*f+1,m=h[u]*d,y=.75*c+h[l]*d+(h[l]-1)*v*c/2;p.attr(\"transform\",\"translate(\"+m+\",\"+y+\")\"),v>1&&g.attr({x:r.attr(\"x\"),y:r.attr(\"y\")})})};var d=.5;s.smoothopen=function(t,e){if(t.length<3)return\"M\"+t.join(\"L\");var r,i=\"M\"+t[0],a=[];for(r=1;r<t.length-1;r++)a.push(n(t[r-1],t[r],t[r+1],e));for(i+=\"Q\"+a[0][0]+\" \"+t[1],r=2;r<t.length-1;r++)i+=\"C\"+a[r-2][1]+\" \"+a[r-1][0]+\" \"+t[r];return i+=\"Q\"+a[t.length-3][1]+\" \"+t[t.length-1]},s.smoothclosed=function(t,e){if(t.length<3)return\"M\"+t.join(\"L\")+\"Z\";var r,i=\"M\"+t[0],a=t.length-1,o=[n(t[a],t[0],t[1],e)];for(r=1;a>r;r++)o.push(n(t[r-1],t[r],t[r+1],e));for(o.push(n(t[a-1],t[a],t[0],e)),r=1;a>=r;r++)i+=\"C\"+o[r-1][1]+\" \"+o[r][0]+\" \"+t[r];return i+=\"C\"+o[a][1]+\" \"+o[0][0]+\" \"+t[0]+\"Z\"};var p={hv:function(t,e){return\"H\"+a.round(e[0],2)+\"V\"+a.round(e[1],2)},vh:function(t,e){return\"V\"+a.round(e[1],2)+\"H\"+a.round(e[0],2)},hvh:function(t,e){return\"H\"+a.round((t[0]+e[0])/2,2)+\"V\"+a.round(e[1],2)+\"H\"+a.round(e[0],2)},vhv:function(t,e){return\"V\"+a.round((t[1]+e[1])/2,2)+\"H\"+a.round(e[0],2)+\"V\"+a.round(e[1],2)}},g=function(t,e){return\"L\"+a.round(e[0],2)+\",\"+a.round(e[1],2)};s.steps=function(t){var e=p[t]||g;return function(t){for(var r=\"M\"+a.round(t[0][0],2)+\",\"+a.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},s.makeTester=function(t){var e=a.select(\"body\").selectAll(\"#js-plotly-tester\").data([0]);e.enter().append(\"svg\").attr({id:\"js-plotly-tester\",xmlns:\"http://www.w3.org/2000/svg\",\"xmlns:xmlns:xlink\":\"http://www.w3.org/1999/xlink\"}).style({position:\"absolute\",left:\"-10000px\",top:\"-10000px\",width:\"9000px\",height:\"9000px\"});var r=e.selectAll(\".js-reference-point\").data([0]);r.enter().append(\"path\").classed(\"js-reference-point\",!0).attr(\"d\",\"M0,0H1V1H0Z\").style({\"stroke-width\":0,fill:\"black\"}),e.node()._cache||(e.node()._cache={}),t._tester=e,t._testref=r};var v=[],m=1e4;s.bBox=function(t){var e=t.attributes[\"data-bb\"];if(e&&e.value)return i.Lib.extendFlat({},v[e.value]);var r=a.select(\"#js-plotly-tester\"),n=r.node(),o=t.cloneNode(!0);n.appendChild(o),a.select(o).attr({x:0,y:0,transform:\"\"});var s=o.getBoundingClientRect(),l=r.select(\".js-reference-point\").node().getBoundingClientRect();n.removeChild(o);var u={height:s.height,width:s.width,left:s.left-l.left,top:s.top-l.top,right:s.right-l.left,bottom:s.bottom-l.top};return v.length>=m&&(a.selectAll(\"[data-bb]\").attr(\"data-bb\",null),v=[]),t.setAttribute(\"data-bb\",v.length),v.push(u),i.Lib.extendFlat({},u)},s.setClipUrl=function(t,e){if(!e)return void t.attr(\"clip-path\",null);var r=\"#\"+e,n=a.select(\"base\");n.size()&&n.attr(\"href\")&&(r=window.location.href+r),t.attr(\"clip-path\",\"url(\"+r+\")\")}},{\"../../plotly\":330,\"./symbol_defs\":290,d3:53,\"fast-isnumeric\":58}],290:[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),r=n.round(t/2,2),i=n.round(t,2);return\"M-\"+e+\",\"+r+\"H\"+e+\"L0,-\"+i+\"Z\"}},\"triangle-down\":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return\"M-\"+e+\",-\"+r+\"H\"+e+\"L0,\"+i+\"Z\"}},\"triangle-left\":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return\"M\"+r+\",-\"+e+\"V\"+e+\"L-\"+i+\",0Z\"}},\"triangle-right\":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return\"M-\"+r+\",-\"+e+\"V\"+e+\"L\"+i+\",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(t*-.309,2),o=n.round(.809*t,2);return\"M\"+e+\",\"+a+\"L\"+r+\",\"+o+\"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(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),h=n.round(.382*e,2);return\"M\"+r+\",\"+l+\"H\"+i+\"L\"+a+\",\"+u+\"L\"+o+\",\"+c+\"L0,\"+h+\"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:53}],291:[function(t,e,r){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\"}}}},{}],292:[function(t,e,r){\"use strict\";function n(t,e,r){return\"percent\"===t?Math.abs(e*r/100):\"constant\"===t?Math.abs(r):\"sqrt\"===t?Math.sqrt(Math.abs(e)):0}function i(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),s(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),s(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var a=t(\"../../plotly\"),o=t(\"d3\"),s=t(\"fast-isnumeric\"),l=e.exports={};l.attributes=t(\"./attributes\"),l.supplyDefaults=function(t,e,r,n){function i(t,e){return a.Lib.coerce(c,u,l.attributes,t,e)}var o=\"error_\"+n.axis,u=e[o]={},c=t[o]||{},h=i(\"visible\",\"array\"in c||\"value\"in c);if(h){var f=i(\"type\",\"array\"in c?\"data\":\"percent\"),d=!0;if(\"sqrt\"!==f&&(d=i(\"symmetric\",!((\"data\"===f?\"arrayminus\":\"valueminus\")in c))),\"data\"===f){var p=i(\"array\");if(p||(u.array=[]),i(\"traceref\"),!d){var g=i(\"arrayminus\");g||(u.arrayminus=[]),i(\"tracerefminus\")}}else(\"percent\"===f||\"constant\"===f)&&(i(\"value\"),d||i(\"valueminus\"));var v=\"copy_\"+n.inherit+\"style\";if(n.inherit){var m=e[\"error_\"+n.inherit];(m||{}).visible&&i(v,!(c.color||s(c.thickness)||s(c.width)))}n.inherit&&u[v]||(i(\"color\",r),i(\"thickness\"),i(\"width\",a.Plots.traceIs(e,\"gl3d\")?0:4))}},l.pushRef2GDC=function(t,e,r,n){function i(e){var r=t.data[e][l];r[\"tracerefminus\"===u?\"arrayminus\":\"array\"]=h}var a,o=!1,s=r.split(\".\"),l=s[0],u=s[1],c=l.charAt(l.length-1);\"type\"===u?(\"various\"===e&&(o=!0,e=0),a=Number(t.calcdata[Number(e)][0].trace[\"error_\"+c].traceref)||0):(\"traceref\"===u||\"tracerefminus\"===u)&&(\"various\"===e&&(o=!0),a=Number(n)||0);var h=t.data[a][c].map(Number);if(o)for(var f=0;f<t.data.length;f++)i(f);else i(Number(e))},l.calc=function(t){(t.calcdata||[]).forEach(function(e){var r=e[0].trace;if(a.Plots.traceIs(r,\"errorBarsOK\")){var i=r.error_x||{},o=r.error_y||{},l=a.Axes.getFromId(t,r.xaxis),u=a.Axes.getFromId(t,r.yaxis),c=i.visible&&-1!==[\"linear\",\"log\"].indexOf(l.type),h=o.visible&&-1!==[\"linear\",\"log\"].indexOf(u.type);if(c||h){var f=[],d=[];e.forEach(function(t,e){try{s(u.c2l(t.y))&&s(l.c2l(t.x))&&[{letter:\"x\",obj:i,visible:c,vals:f},{letter:\"y\",obj:o,visible:h,vals:d}].forEach(function(r){if(r.visible){var i,a,o=t[r.letter],l=r.obj;if(\"data\"===r.obj.type?(i=Number(l.array[e]),a=!l.symmetric&&\"arrayminus\"in l?Number(l.arrayminus[e]):i):(i=n(l.type,o,l.value),a=!l.symmetric&&\"valueminus\"in l?n(l.type,o,l.valueminus):i),s(i)&&s(a)){var u=t[r.letter+\"h\"]=o+i,c=t[r.letter+\"s\"]=o-a;r.vals.push(u,c)}}})}catch(r){console.log(r)}}),a.Axes.expand(u,d,{padded:!0}),a.Axes.expand(l,f,{padded:!0})}}})},l.calcFromTrace=function(t,e){for(var r=t.x||[],n=t.y,i=r.length||n.length,a=new Array(i),o=0;i>o;o++)a[o]={x:r[o],y:n[o]};return a[0].trace=t,l.calc({calcdata:[a],_fullLayout:e}),a},l.plot=function(t,e,r){var n=e.x(),l=e.y();e.plot.select(\".errorlayer\").selectAll(\"g.errorbars\").remove();var u;e.plot.select(\".errorlayer\").selectAll(\"g.errorbars\").data(r).enter().append(\"g\").attr(\"class\",\"errorbars\").each(function(t){var e=t[0].trace,r=e.error_x,c=e.error_y,h=a.Scatter.hasMarkers(e)&&e.marker.maxdisplayed>0;(c.visible||r.visible)&&o.select(this).selectAll(\"g\").data(a.Lib.identity).enter().append(\"g\").each(function(t){u=i(t,n,l);var e,a=o.select(this);if(!h||t.vis){if(c.visible&&s(u.x)&&s(u.yh)&&s(u.ys)){var f=c.width;e=\"M\"+(u.x-f)+\",\"+u.yh+\"h\"+2*f+\"m-\"+f+\",0V\"+u.ys,u.noYS||(e+=\"m-\"+f+\",0h\"+2*f),a.append(\"path\").classed(\"yerror\",!0).attr(\"d\",e)}if(r.visible&&s(u.y)&&s(u.xh)&&s(u.xs)){var d=(r.copy_ystyle?c:r).width;e=\"M\"+u.xh+\",\"+(u.y-d)+\"v\"+2*d+\"m0,-\"+d+\"H\"+u.xs,u.noXS||(e+=\"m0,-\"+d+\"v\"+2*d),a.append(\"path\").classed(\"xerror\",!0).attr(\"d\",e)}}})})},l.style=function(t){o.select(t).selectAll(\"g.errorbars\").each(function(t){var e=o.select(this),r=t[0].trace,n=r.error_y||{},i=r.error_x||{};e.selectAll(\"g path.yerror\").style(\"stroke-width\",n.thickness+\"px\").call(a.Color.stroke,n.color),i.copy_ystyle&&(i=n),e.selectAll(\"g path.xerror\").style(\"stroke-width\",i.thickness+\"px\").call(a.Color.stroke,i.color)})},l.hoverInfo=function(t,e,r){e.error_y.visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),e.error_x.visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{\"../../plotly\":330,\"./attributes\":291,d3:53,\"fast-isnumeric\":58}],293:[function(t,e,r){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,{}),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\":310,\"../../plots/font_attributes\":336,\"../color/attributes\":282}],294:[function(t,e,r){\"use strict\";function n(t){return t.visible&&o.Plots.traceIs(t,\"showLegend\")}function i(t){return-1!==(t.traceorder||\"\").indexOf(\"grouped\")}function a(t){return-1!==(t.traceorder||\"\").indexOf(\"reversed\")}var o=t(\"../../plotly\"),s=t(\"d3\"),l=e.exports={};l.layoutAttributes=t(\"./attributes\"),l.supplyLayoutDefaults=function(t,e,r){function s(t,e){return o.Lib.coerce(c,h,l.layoutAttributes,t,e)}for(var u,c=t.legend||{},h=e.legend={},f=0,d=\"normal\",p=0;p<r.length;p++)u=r[p],n(u)&&(f++,o.Plots.traceIs(u,\"pie\")&&f++),(o.Plots.traceIs(u,\"bar\")&&\"stack\"===e.barmode||-1!==[\"tonextx\",\"tonexty\"].indexOf(u.fill))&&(d=i({traceorder:d})?\"grouped+reversed\":\"reversed\"),void 0!==u.legendgroup&&\"\"!==u.legendgroup&&(d=a({traceorder:d})?\"reversed+grouped\":\"grouped\");var g=o.Lib.coerce(t,e,o.Plots.layoutAttributes,\"showlegend\",f>1);g!==!1&&(s(\"bgcolor\",e.paper_bgcolor),s(\"bordercolor\"),s(\"borderwidth\"),o.Lib.coerceFont(s,\"font\",e.font),s(\"traceorder\",d),i(e.legend)&&s(\"tracegroupgap\"),s(\"x\"),s(\"xanchor\"),s(\"y\"),s(\"yanchor\"),o.Lib.noneOrAll(c,h,[\"x\",\"y\"]))},l.lines=function(t){\n",
"var e=t[0].trace,r=e.visible&&e.fill&&\"none\"!==e.fill,n=o.Scatter.hasLines(e),i=s.select(this).select(\".legendfill\").selectAll(\"path\").data(r?[t]:[]);i.enter().append(\"path\").classed(\"js-fill\",!0),i.exit().remove(),i.attr(\"d\",\"M5,0h30v6h-30z\").call(o.Drawing.fillGroupStyle);var a=s.select(this).select(\".legendlines\").selectAll(\"path\").data(n?[t]:[]);a.enter().append(\"path\").classed(\"js-line\",!0).attr(\"d\",\"M5,0h30\"),a.exit().remove(),a.call(o.Drawing.lineGroupStyle)},l.points=function(t){function e(t,e,r){var n=o.Lib.nestedProperty(l,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(i<r[0])return r[0];if(i>r[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],l=a.trace,u=o.Scatter.hasMarkers(l),c=o.Scatter.hasText(l),h=o.Scatter.hasLines(l);if(u||c||h){var f={},d={};u&&(f.mc=e(\"marker.color\",r),f.mo=e(\"marker.opacity\",o.Lib.mean,[.2,1]),f.ms=e(\"marker.size\",o.Lib.mean,[2,16]),f.mlc=e(\"marker.line.color\",r),f.mlw=e(\"marker.line.width\",o.Lib.mean,[0,5]),d.marker={sizeref:1,sizemin:1,sizemode:\"diameter\"}),h&&(d.line={width:e(\"line.width\",r,[0,10])}),c&&(f.tx=\"Aa\",f.tp=e(\"textposition\",r),f.ts=10,f.tc=e(\"textfont.color\",r),f.tf=e(\"textfont.family\",r)),n=[o.Lib.minExtend(a,f)],i=o.Lib.minExtend(l,d)}var p=s.select(this).select(\"g.legendpoints\"),g=p.selectAll(\"path.scatterpts\").data(u?n:[]);g.enter().append(\"path\").classed(\"scatterpts\",!0).attr(\"transform\",\"translate(20,0)\"),g.exit().remove(),g.call(o.Drawing.pointStyle,i),u&&(n[0].mrc=3);var v=p.selectAll(\"g.pointtext\").data(c?n:[]);v.enter().append(\"g\").classed(\"pointtext\",!0).append(\"text\").attr(\"transform\",\"translate(20,0)\"),v.exit().remove(),v.selectAll(\"text\").call(o.Drawing.textPointStyle,i)},l.bars=function(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=s.select(this).select(\"g.legendpoints\").selectAll(\"path.legendbar\").data(o.Plots.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=(t.mlw+1||n.width+1)-1,i=s.select(this);i.style(\"stroke-width\",e+\"px\").call(o.Color.fill,t.mc||r.color),e&&i.call(o.Color.stroke,t.mlc||n.color)})},l.boxes=function(t){var e=t[0].trace,r=s.select(this).select(\"g.legendpoints\").selectAll(\"path.legendbox\").data(o.Plots.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(t){var r=(t.lw+1||e.line.width+1)-1,n=s.select(this);n.style(\"stroke-width\",r+\"px\").call(o.Color.fill,t.fc||e.fillcolor),r&&n.call(o.Color.stroke,t.lc||e.line.color)})},l.pie=function(t){var e=t[0].trace,r=s.select(this).select(\"g.legendpoints\").selectAll(\"path.legendpie\").data(o.Plots.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(o.Pie.styleOne,t[0],e)},l.style=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll(\"g.legendfill\").data([t]);r.enter().append(\"g\").classed(\"legendfill\",!0);var n=e.selectAll(\"g.legendlines\").data([t]);n.enter().append(\"g\").classed(\"legendlines\",!0);var i=e.selectAll(\"g.legendsymbols\").data([t]);i.enter().append(\"g\").classed(\"legendsymbols\",!0),i.style(\"opacity\",t[0].trace.opacity),i.selectAll(\"g.legendpoints\").data([t]).enter().append(\"g\").classed(\"legendpoints\",!0)}).each(l.bars).each(l.boxes).each(l.pie).each(l.lines).each(l.points)},l.texts=function(t,e,r,n,i){function a(t){o.util.convertToTspans(t,function(){e.firstRender&&l.repositionLegend(e,i)}),t.selectAll(\"tspan.line\").attr({x:t.attr(\"x\")})}var u=e._fullLayout,c=r[0].trace,h=o.Plots.traceIs(c,\"pie\"),f=c.index,d=h?r[0].label:c.name,p=s.select(t).selectAll(\"text.legendtext\").data([0]);p.enter().append(\"text\").classed(\"legendtext\",!0),p.attr({x:40,y:0}).style(\"text-anchor\",\"start\").call(o.Drawing.font,u.legend.font).text(d).attr({\"data-unformatted\":d}),e._context.editable&&!h?p.call(o.util.makeEditable).call(a).on(\"edit\",function(t){this.attr({\"data-unformatted\":t}),this.text(t).call(a),this.text()||(t=\" \"),o.restyle(e,\"name\",t,f)}):p.call(a)},l.getLegendData=function(t,e){function r(t,r){if(\"\"!==t&&i(e))-1===g.indexOf(t)?(g.push(t),v=!0,p[t]=[[r]]):p[t].push([r]);else{var n=\"~~i\"+y;g.push(n),p[n]=[[r]],y++}}var s,l,u,c,h,f,d,p={},g=[],v=!1,m={},y=0;for(h=0;h<t.length;h++)if(s=t[h],l=s[0],u=l.trace,c=u.legendgroup,n(u)&&u.showlegend)if(o.Plots.traceIs(u,\"pie\"))for(m[c]||(m[c]={}),f=0;f<s.length;f++)d=s[f].label,m[c][d]||(r(c,{label:d,color:s[f].color,i:s[f].i,trace:u}),m[c][d]=!0);else r(c,l);if(!g.length)return[];var b,x,_=g.length;if(v&&i(e))for(x=new Array(_),h=0;_>h;h++)b=p[g[h]],x[h]=a(e)?b.reverse():b;else{for(x=[new Array(_)],h=0;_>h;h++)b=p[g[h]][0],x[0][a(e)?_-h-1:h]=b;_=1}return e._lgroupsLength=_,x},l.draw=function(t){var e=t._fullLayout;if(e._infolayer&&t.calcdata){var r=e.legend,n=e.showlegend&&l.getLegendData(t.calcdata,r),a=e.hiddenlabels||[];if(!e.showlegend||!n.length)return e._infolayer.selectAll(\".legend\").remove(),void o.Plots.autoMargin(t,\"legend\");\"undefined\"==typeof t.firstRender?t.firstRender=!0:t.firstRender&&(t.firstRender=!1);var u=e._infolayer.selectAll(\"svg.legend\").data([0]);u.enter(0).append(\"svg\").attr(\"class\",\"legend\");var c=u.selectAll(\"rect.bg\").data([0]);c.enter(0).append(\"rect\").attr(\"class\",\"bg\"),c.call(o.Color.stroke,r.bordercolor).call(o.Color.fill,r.bgcolor).style(\"stroke-width\",r.borderwidth+\"px\");var h=u.selectAll(\"g.groups\").data(n);h.enter().append(\"g\").attr(\"class\",\"groups\"),h.exit().remove(),i(r)&&h.attr(\"transform\",function(t,e){return\"translate(0,\"+e*r.tracegroupgap+\")\"});var f=h.selectAll(\"g.traces\").data(o.Lib.identity);if(f.enter().append(\"g\").attr(\"class\",\"traces\"),f.exit().remove(),f.call(l.style).style(\"opacity\",function(t){var e=t[0].trace;return o.Plots.traceIs(e,\"pie\")?-1!==a.indexOf(t[0].label)?.5:1:\"legendonly\"===e.visible?.5:1}).each(function(e,r){l.texts(this,t,e,r,f);var n=s.select(this).selectAll(\"rect\").data([0]);n.enter().append(\"rect\").classed(\"legendtoggle\",!0).style(\"cursor\",\"pointer\").attr(\"pointer-events\",\"all\").call(o.Color.fill,\"rgba(0,0,0,0)\"),n.on(\"click\",function(){if(!t._dragged){var r,n,i=t._fullData,s=e[0].trace,l=s.legendgroup,u=[];if(o.Plots.traceIs(s,\"pie\")){var c=e[0].label,h=a.slice(),f=h.indexOf(c);-1===f?h.push(c):h.splice(f,1),o.relayout(t,\"hiddenlabels\",h)}else{if(\"\"===l)u=[s.index];else for(var d=0;d<i.length;d++)r=i[d],r.legendgroup===l&&u.push(r.index);n=s.visible===!0?\"legendonly\":!0,o.restyle(t,\"visible\",n,u)}}})}),l.repositionLegend(t,f),t._context.editable){var d,p,g,v,m,y;o.Fx.dragElement({element:u.node(),prepFn:function(){g=Number(u.attr(\"x\")),v=Number(u.attr(\"y\")),m=Number(u.attr(\"width\")),y=Number(u.attr(\"height\")),o.Fx.setCursor(u)},moveFn:function(e,n){var i=t._fullLayout._size;u.call(o.Drawing.setPosition,g+e,v+n),d=o.Fx.dragAlign(g+e,m,i.l,i.l+i.w,r.xanchor),p=o.Fx.dragAlign(v+n+y,-y,i.t+i.h,i.t,r.yanchor);var a=o.Fx.dragCursors(d,p,r.xanchor,r.yanchor);o.Fx.setCursor(u,a)},doneFn:function(e){o.Fx.setCursor(u),e&&void 0!==d&&void 0!==p&&o.relayout(t,{\"legend.x\":d,\"legend.y\":p})}})}}},l.repositionLegend=function(t,e){var r=t._fullLayout,n=r._size,a=r.legend,l=a.borderwidth,u=0,c=0;e.each(function(t){var e,r,n=t[0].trace,i=s.select(this),h=i.selectAll(\".legendtoggle\"),f=i.selectAll(\".legendtext\"),d=i.selectAll(\".legendtext>tspan\"),p=1.3*a.font.size,g=d[0].length||1,v=f.node()&&o.Drawing.bBox(f.node()).width,m=i.select(\"g[class*=math-group]\");if(!n.showlegend)return void i.remove();if(m.node()){var y=o.Drawing.bBox(m.node());p=y.height,v=y.width,m.attr(\"transform\",\"translate(0,\"+p/4+\")\")}else e=p*(.3+(1-g)/2),f.attr(\"y\",e),d.attr(\"y\",e);r=Math.max(p*g,16)+3,i.attr(\"transform\",\"translate(\"+l+\",\"+(5+l+c+r/2)+\")\"),h.attr({x:0,y:-r/2,height:r}),c+=r,u=Math.max(u,v||0)}),i(a)&&(c+=(a._lgroupsLength-1)*a.tracegroupgap),e.selectAll(\".legendtoggle\").attr(\"width\",(t._context.editable?0:u)+40),u+=45+2*l,c+=10+2*l;var h=n.l+n.w*a.x,f=n.t+n.h*(1-a.y),d=\"left\";\"right\"===a.xanchor||\"auto\"===a.xanchor&&a.x>=2/3?(h-=u,d=\"right\"):(\"center\"===a.xanchor||\"auto\"===a.xanchor&&a.x>1/3)&&(h-=u/2,d=\"center\");var p=\"top\";\"bottom\"===a.yanchor||\"auto\"===a.yanchor&&a.y<=1/3?(f-=c,p=\"bottom\"):(\"middle\"===a.yanchor||\"auto\"===a.yanchor&&a.y<2/3)&&(f-=c/2,p=\"middle\"),u=Math.ceil(u),c=Math.ceil(c),h=Math.round(h),f=Math.round(f),r._infolayer.selectAll(\"svg.legend\").call(o.Drawing.setRect,h,f,u,c),r._infolayer.selectAll(\"svg.legend .bg\").call(o.Drawing.setRect,l/2,l/2,u-l,c-l),o.Plots.autoMargin(t,\"legend\",{x:a.x,y:a.y,l:u*({right:1,center:.5}[d]||0),r:u*({left:1,center:.5}[d]||0),b:c*({top:1,middle:.5}[p]||0),t:c*({bottom:1,middle:.5}[p]||0)})}},{\"../../plotly\":330,\"./attributes\":293,d3:53}],295:[function(t,e,r){\"use strict\";function n(t){if(!(this instanceof n))return new n;var e=this;this._snapshotInProgress=!1,this.graphInfo=t.graphInfo,this.element=document.createElement(\"div\"),\"hover\"===this.graphInfo._context.displayModeBar?this.element.className=\"modebar modebar--hover\":this.element.className=\"modebar\",this.buttons=t.buttons,this.buttonElements=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=e.config()[t];if(!n)throw new Error(t+\" not specfied in modebar configuration\");var i=e.createButton(n);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)}),this.graphInfo._context.displaylogo&&this.element.appendChild(this.getLogo()),t.container.appendChild(this.element),this.updateActiveButton()}var i=t(\"../../plotly\"),a=t(\"d3\"),o=n.prototype;o.createGroup=function(){var t=document.createElement(\"div\");return t.className=\"modebar-group\",t},o.createButton=function(t){var e=this,r=document.createElement(\"a\");return r.setAttribute(\"rel\",\"tooltip\"),r.className=\"modebar-btn\",void 0!==t.attr&&r.setAttribute(\"data-attr\",t.attr),void 0!==t.val&&r.setAttribute(\"data-val\",t.val),r.setAttribute(\"data-title\",t.title),r.setAttribute(\"data-gravity\",t.gravity||\"n\"),r.addEventListener(\"click\",function(){t.click.apply(e,arguments)}),r.setAttribute(\"data-toggle\",t.toggle),t.toggle&&r.classList.add(\"active\"),r.appendChild(this.createIcon(i.Icons[t.icon])),r},o.createIcon=function(t){var e=i.Icons,r=e.ascent-e.descent,n=\"http://www.w3.org/2000/svg\",a=document.createElementNS(n,\"svg\"),o=document.createElementNS(n,\"path\");return a.setAttribute(\"height\",\"1em\"),a.setAttribute(\"width\",t.width/r+\"em\"),a.setAttribute(\"viewBox\",[0,0,t.width,r].join(\" \")),o.setAttribute(\"d\",t.path),o.setAttribute(\"transform\",\"matrix(1 0 0 -1 0 \"+e.ascent+\")\"),a.appendChild(o),a},o.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute(\"data-attr\"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute(\"data-val\")||!0,i=t.getAttribute(\"data-attr\"),o=\"true\"===t.getAttribute(\"data-toggle\"),s=a.select(t);o?i===r&&s.classed(\"active\",!s.classed(\"active\")):s.classed(\"active\",e[i]===n)})},o.hasButtons=function(t){var e=this.buttons;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n]!==e[r][n])return!1}return!0},o.getLogo=function(){var t=this.createGroup(),e=document.createElement(\"a\");return e.href=\"https://plot.ly/\",e.target=\"_blank\",e.setAttribute(\"data-title\",\"Produced with Plotly\"),e.className=\"modebar-btn plotlyjsicon modebar-btn--logo\",e.appendChild(this.createIcon(i.Icons.plotlylogo)),t.appendChild(e),t},o.handleCartesian=function(t){var e=t.currentTarget,r=e.getAttribute(\"data-attr\"),n=e.getAttribute(\"data-val\")||!0,a=this,o=this.graphInfo,s=this.graphInfo._fullLayout,l={};if(\"zoom\"===r)for(var u,c,h,f=\"in\"===n?.5:2,d=(1+f)/2,p=(1-f)/2,g=i.Axes.list(o,null,!0),v=0;v<g.length;v++)u=g[v],u.fixedrange||(c=u._name,\"auto\"===n?l[c+\".autorange\"]=!0:\"reset\"===n?void 0===u._rangeInitial?l[c+\".autorange\"]=!0:l[c+\".range\"]=u._rangeInitial.slice():(h=u.range,l[c+\".range\"]=[d*h[0]+p*h[1],d*h[1]+p*h[0]]));else\"hovermode\"!==r||\"x\"!==n&&\"y\"!==n||(n=s._isHoriz?\"y\":\"x\",e.setAttribute(\"data-val\",n)),l[r]=n;i.relayout(o,l).then(function(){a.updateActiveButton(),\"dragmode\"===r&&(s._hasCartesian&&i.Fx.setCursor(s._paper.select(\".nsewdrag\"),{pan:\"move\",zoom:\"crosshair\"}[n]),i.Fx.supplyLayoutDefaults(o.layout,s,o._fullData))})},o.handleHover3d=function(t){var e,r,n,a,o,s,l,u,c,h=t.currentTarget,f=JSON.parse(h.getAttribute(\"data-val\"))||!1,d=this,p=this.graphInfo,g=p._fullLayout,v=i.Plots.getSubplotIds(g,\"gl3d\"),m={},y={},b=[\"xaxis\",\"yaxis\",\"zaxis\"],x=[\"showspikes\",\"spikesides\",\"spikethickness\",\"spikecolor\"];if(f)m=f,h.setAttribute(\"data-val\",JSON.stringify(null));else{for(m={\"allaxes.showspikes\":!1},e=0;e<v.length;e++)for(r=v[e],n=g[r],a=y[r]={},o=0;3>o;o++)for(s=b[o],l=a[s]={},u=0;u<x.length;u++)c=x[u],l[c]=n[s][c];h.setAttribute(\"data-val\",JSON.stringify(y))}i.relayout(p,m).then(function(){d.updateActiveButton(h)})},o.handleDrag3d=function(t){var e=t.currentTarget,r=e.getAttribute(\"data-attr\"),n=e.getAttribute(\"data-val\")||!0,a=this,o=this.graphInfo,s={};s[r]=n,i.relayout(o,s).then(function(){a.updateActiveButton()})},o.handleCamera3d=function(t){var e,r,n,a,o,s,l=t.currentTarget,u=l.getAttribute(\"data-attr\"),c=this.graphInfo.layout,h=this.graphInfo._fullLayout,f=i.Plots.getSubplotIds(h,\"gl3d\");for(e=0;e<f.length;e++)r=f[e],n=c[r],a=h[r],o=a._scene,n&&\"resetDefault\"!==u?\"resetLastSave\"===u&&(s=n.camera,s?o.setCamera(s):o.setCameraToDefault()):o.setCameraToDefault()},o.handleGeo=function(t){for(var e,r,n,a=t.currentTarget,o=a.getAttribute(\"data-attr\"),s=a.getAttribute(\"data-val\")||!0,l=this.graphInfo._fullLayout,u=i.Plots.getSubplotIds(l,\"geo\"),c=0;c<u.length;c++)e=l[u[c]]._geo,\"zoom\"===o?(r=e.projection.scale(),n=\"in\"===s?2*r:.5*r,e.projection.scale(n),e.zoom.scale(n),e.render()):\"reset\"===o?e.zoomReset():\"hovermode\"===o&&(e.showHover=!e.showHover);this.updateActiveButton(a)},o.handleHoverPie=function(){var t=this,e=t.graphInfo,r=e._fullLayout.hovermode?!1:\"closest\";i.relayout(e,\"hovermode\",r).then(function(){t.updateActiveButton()})},o.handleHoverGl2d=function(t){var e=this,r=t.currentTarget,n=e.graphInfo,a=n._fullLayout.hovermode?!1:\"closest\";i.relayout(n,\"hovermode\",a).then(function(){e.updateActiveButton(r)})},o.cleanup=function(){this.element.innerHTML=\"\";var t=this.element.parentNode;t&&t.removeChild(this.element)},o.toImage=function(){var t=\"png\",e=this;if(i.Lib.isIE())return void i.Lib.notifier(\"Snapshotting is unavailable in Internet Explorer. Consider exporting your images using the Plotly Cloud\",\"long\");if(this._snapshotInProgress)return void i.Lib.notifier(\"Snapshotting is still in progress - please hold\",\"long\");this._snapshotInProgress=!0,i.Lib.notifier(\"Taking snapshot - this may take a few seconds\",\"long\");var r=i.Snapshot.toImage(this.graphInfo,{format:t}),n=this.graphInfo.fn||\"newplot\";n+=\".\"+t,r.once(\"success\",function(t){e._snapshotInProgress=!1;var i=document.createElement(\"a\");i.href=t,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),r.clean()}),r.once(\"error\",function(n){e._snapshotInProgress=!1,i.Lib.notifier(\"Sorry there was a problem downloading your \"+t,\"long\"),console.error(n),r.clean()})},o.sendDataToCloud=function(){var t=this.graphInfo;i.Plots.sendDataToCloud(t)},o.config=function(){return{zoom2d:{title:\"Zoom\",attr:\"dragmode\",val:\"zoom\",icon:\"zoombox\",click:this.handleCartesian},pan2d:{title:\"Pan\",attr:\"dragmode\",val:\"pan\",icon:\"pan\",click:this.handleCartesian},zoomIn2d:{title:\"Zoom in\",attr:\"zoom\",val:\"in\",icon:\"zoom_plus\",click:this.handleCartesian},zoomOut2d:{title:\"Zoom out\",attr:\"zoom\",val:\"out\",icon:\"zoom_minus\",click:this.handleCartesian},autoScale2d:{title:\"Autoscale\",attr:\"zoom\",val:\"auto\",icon:\"autoscale\",click:this.handleCartesian},resetScale2d:{title:\"Reset axes\",attr:\"zoom\",val:\"reset\",icon:\"home\",click:this.handleCartesian},hoverClosest2d:{title:\"Show closest data on hover\",attr:\"hovermode\",val:\"closest\",icon:\"tooltip_basic\",gravity:\"ne\",click:this.handleCartesian},hoverCompare2d:{title:\"Compare data on hover\",attr:\"hovermode\",val:this.graphInfo._fullLayout._isHoriz?\"y\":\"x\",icon:\"tooltip_compare\",gravity:\"ne\",click:this.handleCartesian},toImage:{title:\"download plot as a png\",icon:\"camera\",click:this.toImage},sendDataToCloud:{title:\"save and edit plot in cloud\",icon:\"disk\",click:this.sendDataToCloud},zoom3d:{title:\"Zoom\",attr:\"dragmode\",val:\"zoom\",icon:\"zoombox\",click:this.handleDrag3d},pan3d:{title:\"Pan\",attr:\"dragmode\",val:\"pan\",icon:\"pan\",click:this.handleDrag3d},orbitRotation:{title:\"orbital rotation\",attr:\"dragmode\",val:\"orbit\",icon:\"3d_rotate\",click:this.handleDrag3d},tableRotation:{title:\"turntable rotation\",attr:\"dragmode\",val:\"turntable\",icon:\"z-axis\",click:this.handleDrag3d},resetCameraDefault3d:{title:\"Reset camera to default\",attr:\"resetDefault\",icon:\"home\",click:this.handleCamera3d},resetCameraLastSave3d:{title:\"Reset camera to last save\",attr:\"resetLastSave\",icon:\"movie\",click:this.handleCamera3d},hoverClosest3d:{title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:null,toggle:!0,icon:\"tooltip_basic\",gravity:\"ne\",click:this.handleHover3d},zoomInGeo:{title:\"Zoom in\",attr:\"zoom\",val:\"in\",icon:\"zoom_plus\",click:this.handleGeo},zoomOutGeo:{title:\"Zoom out\",attr:\"zoom\",val:\"out\",icon:\"zoom_minus\",click:this.handleGeo},resetGeo:{title:\"Reset\",attr:\"reset\",val:null,icon:\"autoscale\",click:this.handleGeo},hoverClosestGeo:{title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:null,toggle:!0,icon:\"tooltip_basic\",gravity:\"ne\",click:this.handleGeo},hoverClosestPie:{title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:\"closest\",icon:\"tooltip_basic\",gravity:\"ne\",click:this.handleHoverPie},hoverClosestGl2d:{title:\"Toggle show closest data on hover\",attr:\"hovermode\",val:null,toggle:!0,icon:\"tooltip_basic\",gravity:\"ne\",click:this.handleHoverGl2d}}},e.exports=n},{\"../../plotly\":330,d3:53}],296:[function(t,e,r){var n=t(\"../annotations/attributes\"),i=t(\"../../traces/scatter/attributes\"),a=t(\"../../lib/extend\").extendFlat,o=i.line;e.exports={_isLinkedToArray:!0,type:{valType:\"enumerated\",values:[\"circle\",\"rect\",\"path\",\"line\"]},xref:a({},n.xref,{}),x0:{valType:\"any\"},x1:{valType:\"any\"},yref:a({},n.yref,{}),y0:{valType:\"any\"},y1:{valType:\"any\"},path:{valType:\"string\"},opacity:{valType:\"number\",min:0,max:1,dflt:1},line:{color:o.color,width:o.width,dash:o.dash},fillcolor:{valType:\"color\",dflt:\"rgba(0,0,0,0)\"}}},{\"../../lib/extend\":310,\"../../traces/scatter/attributes\":397,\"../annotations/attributes\":280}],297:[function(t,e,r){\"use strict\";function n(t,e){function r(e,r){return u.Lib.coerce(t,n,h.layoutAttributes,e,r)}var n={};r(\"opacity\"),r(\"fillcolor\"),r(\"line.color\"),r(\"line.width\"),r(\"line.dash\");for(var i=t.path?\"path\":\"rect\",o=r(\"type\",i),s=[\"x\",\"y\"],l=0;2>l;l++){var c=s[l],f={_fullLayout:e},d=u.Axes.coerceRef(t,n,f,c);if(\"path\"!==o){var p=.25,g=.75;if(\"paper\"!==d){var v=u.Axes.getFromId(f,d),m=a(v);p=m(v.range[0]+p*(v.range[1]-v.range[0])),g=m(v.range[0]+g*(v.range[1]-v.range[0]))}r(c+\"0\",p),r(c+\"1\",g)}}return\"path\"===o?r(\"path\"):u.Lib.noneOrAll(t,n,[\"x0\",\"x1\",\"y0\",\"y1\"]),n}function i(t){return\"category\"===t.type?t.c2l:t.d2l}function a(t){return\"category\"===t.type?t.l2c:t.l2d}function o(t){return function(e){return t(e.replace(\"_\",\" \"))}}function s(t,e){var r,n,a,s,l=e.type,c=u.Axes.getFromId(t,e.xref),f=u.Axes.getFromId(t,e.yref),d=t._fullLayout._size;if(c?(r=i(c),n=function(t){return c._offset+c.l2p(r(t,!0))}):n=function(t){return d.l+d.w*t},f?(a=i(f),s=function(t){return f._offset+f.l2p(a(t,!0))}):s=function(t){return d.t+d.h*(1-t)},\"path\"===l)return c&&\"date\"===c.type&&(n=o(n)),f&&\"date\"===f.type&&(s=o(s)),h.convertPath(e.path,n,s);var p=n(e.x0),g=n(e.x1),v=s(e.y0),m=s(e.y1);if(\"line\"===l)return\"M\"+p+\",\"+v+\"L\"+g+\",\"+m;if(\"rect\"===l)return\"M\"+p+\",\"+v+\"H\"+g+\"V\"+m+\"H\"+p+\"Z\";var y=(p+g)/2,b=(v+m)/2,x=Math.abs(y-p),_=Math.abs(b-v),w=\"A\"+x+\",\"+_,k=y+x+\",\"+b,A=y+\",\"+(b-_);return\"M\"+k+w+\" 0 1,1 \"+A+w+\" 0 0,1 \"+k+\"Z\"}function l(t,e,r,n,i){var a=\"category\"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var s,l,u,c,h,p=1/0,g=-(1/0),v=n.match(f);for(\"date\"===t.type&&(a=o(a)),s=0;s<v.length;s++)l=v[s],u=i[l.charAt(0)].drawn,void 0!==u&&(c=v[s].substr(1).match(d),!c||c.length<u||(h=a(c[u]),p>h&&(p=h),h>g&&(g=h)));return g>=p?[p,g]:void 0}}var u=t(\"../../plotly\"),c=t(\"fast-isnumeric\"),h=e.exports={};h.layoutAttributes=t(\"./attributes\"),h.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],a=0;a<r.length;a++)i.push(n(r[a]||{},e))},h.drawAll=function(t){var e=t._fullLayout;e._shapelayer.selectAll(\"path\").remove();for(var r=0;r<e.shapes.length;r++)h.draw(t,r)},h.add=function(t){var e=t._fullLayout.shapes.length;u.relayout(t,\"shapes[\"+e+\"]\",\"add\")},h.draw=function(t,e,r,o){var l,f=t.layout,d=t._fullLayout;if(!c(e)||-1===e){if(!e&&Array.isArray(o))return f.shapes=o,h.supplyLayoutDefaults(f,d),void h.drawAll(t);if(\"remove\"===o)return delete f.shapes,d.shapes=[],void h.drawAll(t);if(r&&\"add\"!==o){for(l=0;l<d.shapes.length;l++)h.draw(t,l,r,o);return}e=d.shapes.length,d.shapes.push({})}if(!r&&o){if(\"remove\"===o){for(d._shapelayer.selectAll('[data-index=\"'+e+'\"]').remove(),d.shapes.splice(e,1),f.shapes.splice(e,1),l=e;l<d.shapes.length;l++)d._shapelayer.selectAll('[data-index=\"'+(l+1)+'\"]').attr(\"data-index\",String(l)),h.draw(t,l);return}if(\"add\"===o||u.Lib.isPlainObject(o)){d.shapes.splice(e,0,{});var p=u.Lib.isPlainObject(o)?u.Lib.extendFlat({},o):{text:\"New text\"};for(f.shapes?f.shapes.splice(e,0,p):f.shapes=[p],l=d.shapes.length-1;l>e;l--)d._shapelayer.selectAll('[data-index=\"'+(l-1)+'\"]').attr(\"data-index\",String(l)),h.draw(t,l)}}d._shapelayer.selectAll('[data-index=\"'+e+'\"]').remove();var g=f.shapes[e];if(g){var v={xref:g.xref,yref:g.yref},m={};\"string\"==typeof r&&r?m[r]=o:u.Lib.isPlainObject(r)&&(m=r);var y=Object.keys(m);for(l=0;l<m.length;l++){var b=y[l];u.Lib.nestedProperty(g,b).set(m[b])}var x=[\"x0\",\"x1\",\"y0\",\"y1\"];for(l=0;4>l;l++){var _=x[l];if(void 0===m[_]&&void 0!==g[_]){var w,k=_.charAt(0),A=u.Axes.getFromId(t,u.Axes.coerceRef(v,{},t,k)),M=u.Axes.getFromId(t,u.Axes.coerceRef(g,{},t,k)),L=g[_];void 0!==m[k+\"ref\"]&&(A?(w=i(A)(L),L=(w-A.range[0])/(A.range[1]-A.range[0])):L=(L-M.domain[0])/(M.domain[1]-M.domain[0]),M?(w=M.range[0]+L*(M.range[1]-M.range[0]),L=a(M)(w)):L=A.domain[0]+L*(A.domain[1]-A.domain[0])),g[_]=L}}var T=n(g,d);d.shapes[e]=T;var E={\"data-index\":String(e),\"fill-rule\":\"evenodd\",d:s(t,T)},C=(T.xref+T.yref).replace(/paper/g,\"\"),S=T.line.width?T.line.color:\"rgba(0,0,0,0)\",z=d._shapelayer.append(\"path\").attr(E).style(\"opacity\",T.opacity).call(u.Color.stroke,S).call(u.Color.fill,T.fillcolor).call(u.Drawing.dashLine,T.line.dash,T.line.width);C&&z.call(u.Drawing.setClipUrl,\"clip\"+d._uid+C)}};var f=/[MLHVQCTSZ][^MLHVQCTSZ]*/g,d=/[^\\s,]+/g,p={M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},g={M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},v={M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0};h.convertPath=function(t,e,r){return t.replace(f,function(t){var n=0,i=t.charAt(0),a=p[i],o=g[i],s=v[i],l=t.substr(1).replace(d,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.*/,\"\"),console.log(\"ignoring extra params in segment \"+t)),i+l})},h.calcAutorange=function(t){var e,r,n,i,a,o=t._fullLayout,s=o.shapes;if(s.length&&t._fullData.length)for(e=0;e<s.length;e++)r=s[e],n=r.line.width/2,\"paper\"!==r.xref&&(i=u.Axes.getFromId(t,r.xref),a=l(i,r.x0,r.x1,r.path,p),a&&u.Axes.expand(i,a,{ppad:n})),\"paper\"!==r.yref&&(i=u.Axes.getFromId(t,r.yref),a=l(i,r.y0,r.y1,r.path,g),a&&u.Axes.expand(i,a,{ppad:n}))}},{\"../../plotly\":330,\"./attributes\":296,\"fast-isnumeric\":58}],298:[function(t,e,r){\"use strict\";var n=t(\"../../plotly\"),i=t(\"d3\"),a=t(\"fast-isnumeric\"),o=n.Plots,s=e.exports={};s.draw=function(t,e){function r(t){n.Lib.syncOrAsync([l,u],t)}function l(e){return e.attr(\"transform\",C?\"rotate(\"+[C.rotate,d.x,d.y]+\") translate(0, \"+C.offset+\")\":null),e.style({\"font-family\":L,\"font-size\":i.round(T,2)+\"px\",fill:n.Color.rgb(E),opacity:j*n.Color.opacity(E),\"font-weight\":o.fontWeight}).attr(d).call(n.util.convertToTspans).attr(d),e.selectAll(\"tspan.line\").attr(d),o.previousPromises(t)}function u(t){var e=i.select(t.node().parentNode);if(z&&z.selection&&z.side&&I){e.attr(\"transform\",null);var r=0,o={left:\"right\",right:\"left\",top:\"bottom\",bottom:\"top\"}[z.side],s=-1!==[\"left\",\"top\"].indexOf(z.side)?-1:1,l=a(z.pad)?z.pad:2,u=n.Drawing.bBox(e.node()),c={left:0,top:0,right:p.width,bottom:p.height},h=m?p.width:(c[z.side]-u[z.side])*(\"left\"===z.side||\"top\"===z.side?-1:1);if(0>h?r=h:(u.left-=z.offsetLeft,u.right-=z.offsetLeft,u.top-=z.offsetTop,u.bottom-=z.offsetTop,z.selection.each(function(){var t=n.Drawing.bBox(this);n.Lib.bBoxIntersect(u,t,l)&&(r=Math.max(r,s*(t[z.side]-u[o])+l))}),r=Math.min(h,r)),r>0||0>h){var f={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[z.side];e.attr(\"transform\",\"translate(\"+f+\")\")}}}function c(){j=0,O=!0,I=N,p._infolayer.select(\".\"+e).attr({\"data-unformatted\":I}).text(I).on(\"mouseover.opacity\",function(){i.select(this).transition().duration(100).style(\"opacity\",1)}).on(\"mouseout.opacity\",function(){i.select(this).transition().duration(1e3).style(\"opacity\",0)})}if(!e)return n.Axes.listIds(t).forEach(function(e){s.draw(t,e+\"title\")}),void s.draw(t,\"gtitle\");var h,f,d,p=t._fullLayout,g=p._size,v=e.charAt(0),m=\"cb\"===e.substr(1,2);if(m){var y=e.substr(3).replace(\"title\",\"\");t._fullData.some(function(e,r){return e.uid===y?(h=r,f=t.calcdata[r][0].t.cb.axis,!0):void 0})}else f=p[n.Axes.id2name(e.replace(\"title\",\"\"))]||p;var b,x,_,w,k,A=f===p?\"title\":f._name+\".title\",M=m?\"colorscale\":(f._id||v).toUpperCase()+\" axis\",L=f.titlefont.family,T=f.titlefont.size,E=f.titlefont.color,C=\"\",S={},z={selection:i.select(t).selectAll(\"g.\"+f._id+\"tick\"),side:f.side},P=m?0:1.5;m?(z.offsetLeft=g.l,z.offsetTop=g.t):z.selection.size()&&(k=i.select(z.selection.node().parentNode).attr(\"transform\").match(/translate\\(([-\\.\\d]+),([-\\.\\d]+)\\)/),k&&(z.offsetLeft=+k[1],z.offsetTop=+k[2])),m&&f.titleside?(b=g.l+f.titlex*g.w,x=g.t+(1-f.titley)*g.h+(\"top\"===f.titleside?3+.75*T:-3-.25*T),d={x:b,y:x,\"text-anchor\":\"start\"},z={},e=\"h\"+e):\"x\"===v?(_=f,w=\"free\"===_.anchor?{_offset:g.t+(1-(_.position||0))*g.h,_length:0}:n.Axes.getFromId(t,_.anchor),b=_._offset+_._length/2,x=w._offset+(\"top\"===_.side?-10-T*(P+(_.showticklabels?1:0)):w._length+10+T*(P+(_.showticklabels?1.5:.5))),d={x:b,y:x,\"text-anchor\":\"middle\"},z.side||(z.side=\"bottom\")):\"y\"===v?(w=f,_=\"free\"===w.anchor?{_offset:g.l+(w.position||0)*g.w,_length:0}:n.Axes.getFromId(t,w.anchor),x=w._offset+w._length/2,b=_._offset+(\"right\"===w.side?_._length+10+T*(P+(w.showticklabels?1:.5)):-10-T*(P+(w.showticklabels?.5:0))),S={center:0},d={x:b,y:x,\"text-anchor\":\"middle\"},C={rotate:\"-90\",offset:0},z.side||(z.side=\"left\")):(M=\"Plot\",T=p.titlefont.size,b=p.width/2,x=p._size.t/2,d={x:b,y:x,\"text-anchor\":\"middle\"},z={});var j=1,O=!1,I=f.title.trim();\"\"===I&&(j=0),I.match(/Click to enter .+ title/)&&(j=.2,O=!0);var D;if(m){D=i.select(t).selectAll(\".\"+f._id.substr(1)+\" .cbtitle\");var R=\"h\"===e.charAt(0)?e.substr(1):\"h\"+e;D.selectAll(\".\"+R+\",.\"+R+\"-math-group\").remove()}else D=p._infolayer.selectAll(\".g-\"+e).data([0]),D.enter().append(\"g\").classed(\"g-\"+e,!0);var F=D.selectAll(\"text\").data([0]);F.enter().append(\"text\"),F.text(I).attr(\"class\",e),F.attr({\"data-unformatted\":I}).call(r);var N=\"Click to enter \"+M.replace(/\\d+/,\"\")+\" title\";t._context.editable?(I||c(),F.call(n.util.makeEditable).on(\"edit\",function(e){if(m){var r=t._fullData[h];o.traceIs(r,\"markerColorscale\")?n.restyle(t,\"marker.colorbar.title\",e,h):n.restyle(t,\"colorbar.title\",e,h)}else n.relayout(t,A,e)}).on(\"cancel\",function(){this.text(this.attr(\"data-unformatted\")).call(r)}).on(\"input\",function(t){this.text(t||\" \").attr(d).selectAll(\"tspan.line\").attr(d)})):(!I||I.match(/Click to enter .+ title/))&&F.remove(),F.classed(\"js-placeholder\",O)}},{\"../../plotly\":330,d3:53,\"fast-isnumeric\":58}],299:[function(t,e,r){e.exports={DZA:\"algeria\",AGO:\"angola\",EGY:\"egypt\",BGD:\"bangladesh|^(?=.*east).*paki?stan\",NER:\"\\\\bniger(?!ia)\",LIE:\"liechtenstein\",NAM:\"namibia\",BGR:\"bulgaria\",BOL:\"bolivia\",GHA:\"ghana|gold.?coast\",CCK:\"\\\\bcocos|keeling\",PAK:\"^(?!.*east).*paki?stan\",CPV:\"verde\",JOR:\"jordan\",LBR:\"liberia\",LBY:\"libya\",MYS:\"malaysia\",IOT:\"british.?indian.?ocean\",PRI:\"puerto.?rico\",MYT:\"mayotte\",PRK:\"^(?=.*democrat).*\\\\bkorea|^(?=.*people).*\\\\bkorea|^(?=.*north).*\\\\bkorea|\\\\bd\\\\.?p\\\\.?r\\\\.?k\",PSE:\"palestin|\\\\bgaza|west.?bank\",TZA:\"tanzania\",BWA:\"botswana|bechuana\",KHM:\"cambodia|kampuchea|khmer|^p\\\\.?r\\\\.?k\\\\.?$\",UMI:\"minor.?outlying.?is\",TTO:\"trinidad|tobago\",PRY:\"paraguay\",HKG:\"hong.?kong\",SAU:\"\\\\bsa\\\\w*.?arabia\",LBN:\"lebanon\",SVN:\"slovenia\",BFA:\"burkina|\\\\bfaso|upper.?volta\",SVK:\"^(?!.*cze).*slovak\",MRT:\"mauritania\",HRV:\"croatia\",CHL:\"\\\\bchile\",CHN:\"^(?!.*\\\\bmac)(?!.*\\\\bhong)(?!.*\\\\btai).*china|^p\\\\.?r\\\\.?c\\\\.?$\",KNA:\"kitts|\\\\bnevis\",JAM:\"jamaica\",SMR:\"san.?marino\",GIB:\"gibraltar\",DJI:\"djibouti\",GIN:\"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea\",FIN:\"finland\",URY:\"uruguay\",VAT:\"holy.?see|vatican|papal.?st\",STP:\"\\\\bs(a|\\xe3)o.?tom(e|\\xe9)\",SYC:\"seychell\",NPL:\"nepal\",CXR:\"christmas\",LAO:\"\\\\blaos?\\\\b\",YEM:\"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\\\bp\\\\.?d\\\\.?r).*yemen\",BVT:\"bouvet\",ZAF:\"\\\\bs\\\\w*.?africa\",KIR:\"kiribati\",PHL:\"philippines\",SXM:\"^(?!.*martin)(?!.*saba).*maarten\",ROU:\"r(o|u|ou)mania\",VIR:\"^(?=.*\\\\bu\\\\.?\\\\s?s).*virgin|^(?=.*states).*virgin\",SYR:\"syria\",MAC:\"maca(o|u)\",NFK:\"norfolk\",NIC:\"nicaragua\",MLT:\"\\\\bmalta\",KAZ:\"kazak\",TCA:\"turks\",PYF:\"french.?polynesia|tahiti\",NIU:\"niue\",DMA:\"dominica(?!n)\",GBR:\"united.?kingdom|britain|^u\\\\.?k\\\\.?$\",BEN:\"benin|dahome\",GUF:\"^(?=.*french).*guiana\",BEL:\"^(?!.*luxem).*belgium\",MSR:\"montserrat\",TGO:\"togo\",DEU:\"^(?!.*east).*germany|^(?=.*\\\\bfed.*\\\\brep).*german\",GUM:\"\\\\bguam\",LKA:\"sri.?lanka|ceylon\",SSD:\"\\\\bs\\\\w*.?sudan\",FLK:\"falkland|malvinas\",PCN:\"pitcairn\",BES:\"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\\\bbes.?islands\",GUY:\"guyana|british.?guiana\",CRI:\"costa.?rica\",COK:\"\\\\bcook\",MAR:\"morocco|\\\\bmaroc\",MNP:\"mariana\",LSO:\"lesotho|basuto\",HUN:\"^(?!.*austr).*hungary\",TKM:\"turkmen\",SUR:\"surinam|dutch.?guiana\",NLD:\"^(?!.*\\\\bant)(?!.*\\\\bcarib).*netherlands\",BMU:\"bermuda\",HMD:\"heard.*mcdonald\",TCD:\"\\\\bchad\",GEO:\"^(?!.*south).*georgia\",MNE:\"^(?!.*serbia).*montenegro\",MNG:\"mongolia\",MHL:\"marshall\",MTQ:\"martinique\",CSK:\"czechoslovakia\",BLZ:\"belize|^(?=.*british).*honduras\",DDR:\"german.?democratic.?republic|^(d|g)\\\\.?d\\\\.?r\\\\.?$|^(?=.*east).*germany\",MMR:\"myanmar|burma\",AFG:\"afghan\",BDI:\"burundi\",VGB:\"^(?=.*\\\\bu\\\\.?\\\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin\",BLR:\"belarus|byelo\",BLM:\"barth(e|\\xe9)lemy\",GRD:\"grenada\",TKL:\"tokelau\",GRC:\"greece|hellenic|hellas\",GRL:\"greenland\",SHN:\"helena\",AND:\"andorra\",MOZ:\"mozambique\",TJK:\"tajik\",THA:\"thailand|\\\\bsiam\",HTI:\"haiti\",MEX:\"\\\\bmexic\",ANT:\"^(?=.*\\\\bant).*(nether|dutch)\",ZWE:\"zimbabwe|^(?!.*northern).*rhodesia\",LCA:\"\\\\blucia\",IND:\"india(?!.*ocea)\",LVA:\"latvia\",BTN:\"bhutan\",VCT:\"vincent\",VNM:\"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam\",NOR:\"norway\",CZE:\"^(?=.*rep).*czech|czechia|bohemia\",ATF:\"french.?southern|\\\\bfr.*\\\\bso.*\\\\ban.*\\\\b\\\\bt\",ATG:\"antigua\",FJI:\"fiji\",HND:\"^(?!.*brit).*honduras\",MUS:\"mauritius\",DOM:\"dominican\",LUX:\"^(?!.*belg).*luxem\",ISR:\"israel\",YUG:\"yugoslavia\",FSM:\"micronesia\",PER:\"peru\",REU:\"r(e|\\xe9)union\",IDN:\"indonesia\",VUT:\"vanuatu|new.?hebrides\",MKD:\"macedonia|^f\\\\.?y\\\\.?r\\\\.?o\\\\.?m\\\\.?$\",COD:\"\\\\bdem.*congo|congo.*\\\\bdem|congo.*\\\\bdr|\\\\bdr.*congo|\\\\bd\\\\.?r\\\\.?c|\\\\bd\\\\.?r\\\\.?o\\\\.?c|\\\\br\\\\.?d\\\\.?c|belgian.?congo|congo.?free.?state|kinshasa|zaire|l\\\\w{1,2}opoldville\",COG:\"^(?!.*\\\\bdem)(?!.*\\\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l\\\\w{1,2}opoldville)(?!.*free).*\\\\bcongo\",ISL:\"iceland\",GLP:\"guadeloupe\",ETH:\"ethiopia|abyssinia\",COM:\"comoro\",COL:\"colombia\",NGA:\"nigeria\",\n",
"TLS:\"^(?=.*leste).*timor|^(?=.*east).*timor\",TWN:\"taiwan|taipei|formosa\",PRT:\"portugal\",MDA:\"moldov|b(a|e)ssarabia\",GGY:\"guernsey\",MDG:\"madagascar|malagasy\",ATA:\"antarctica\",ECU:\"ecuador\",SEN:\"senegal\",ESH:\"sahara\",MDV:\"maldive\",ASM:\"^(?=.*americ).*samoa\",SPM:\"miquelon\",CUW:\"^(?!.*bonaire).*\\\\bcura(c|\\xe7)ao\",FRA:\"^(?!.*\\\\bdep)(?!.*martinique).*france|french.?republic|\\\\bgaul\",LTU:\"lithuania\",RWA:\"rwanda\",ZMB:\"zambia|northern.?rhodesia\",GMB:\"gambia\",WLF:\"futuna|wallis\",JEY:\"jersey\",FRO:\"faroe|faeroe\",GTM:\"guatemala\",DNK:\"denmark\",IMN:\"^(?=.*isle).*\\\\bman\",MAF:\"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)\",AUS:\"australia\",AUT:\"^(?!.*hungary).*austria|\\\\baust.*\\\\bemp\",SJM:\"svalbard\",VEN:\"venezuela\",PLW:\"palau\",KEN:\"kenya|british.?east.?africa|east.?africa.?prot\",TUR:\"turkey\",ALB:\"albania\",OMN:\"\\\\boman|trucial\",TUV:\"tuvalu\",ALA:\"\\\\b(a|\\xe5)land\",BRN:\"brunei\",TUN:\"tunisia\",RUS:\"\\\\brussia|soviet.?union|u\\\\.?s\\\\.?s\\\\.?r|socialist.?republics\",BRB:\"barbados\",BRA:\"brazil\",CIV:\"ivoire|ivory\",SRB:\"^(?!.*monte).*serbia\",GNQ:\"guine.*eq|eq.*guine|^(?=.*span).*guinea\",USA:\"^(?!.*islands).*united.?states|^u\\\\.?s\\\\.?a\\\\.?$|^u\\\\.?s\\\\.?$\",QAT:\"qatar\",WSM:\"^(?!.*amer).*samoa\",AZE:\"azerbaijan\",GNB:\"bissau|^(?=.*portu).*guinea\",SWZ:\"swaziland\",TON:\"tonga\",CAN:\"canada\",UKR:\"ukrain\",KOR:\"^(?!.*democrat)(?!.*people)(?!.*north).*\\\\bkorea|\\\\br\\\\.?o\\\\.?k\\\\b\",AIA:\"anguill?a\",CAF:\"\\\\bcen.*\\\\baf|^c\\\\.?a\\\\.?r\\\\.?$\",CHE:\"switz|swiss\",CYP:\"cyprus\",BIH:\"herzegovina|bosnia\",SGP:\"singapore\",SGS:\"south.?georgia|sandwich\",SOM:\"somali\",UZB:\"uzbek\",CMR:\"cameroon\",POL:\"poland\",EAZ:\"zanz\",KWT:\"kuwait\",ERI:\"eritrea\",GAB:\"gabon\",CYM:\"cayman\",ARE:\"emirates|^u\\\\.?a\\\\.?e\\\\.?$|united.?arab.?em\",EST:\"estonia\",MWI:\"malawi|nyasa\",ESP:\"spain\",IRQ:\"\\\\biraq|mesopotamia\",SLV:\"el.?salvador\",MLI:\"\\\\bmali\\\\b\",YMD:\"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\\\bp\\\\.?d\\\\.?r).*yemen\",IRL:\"ireland\",IRN:\"\\\\biran|persia\",ABW:\"^(?!.*bonaire).*\\\\baruba\",SLE:\"sierra\",PAN:\"panama\",SDN:\"^(?!.*\\\\bs(?!u)).*sudan\",SLB:\"solomon\",NZL:\"new.?zealand\",MCO:\"monaco\",ITA:\"italy\",JPN:\"japan\",KGZ:\"kyrgyz|kirghiz\",UGA:\"uganda\",NCL:\"new.?caledonia\",PNG:\"papua|\\\\bp.*\\\\bn.*\\\\bguin.*|^p\\\\.?n\\\\.?g\\\\.?$|new.?guinea\",ARG:\"argentin\",SWE:\"sweden\",BHS:\"bahamas\",BHR:\"bahrain\",ARM:\"armenia\",NRU:\"nauru\",CUB:\"\\\\bcuba\"}},{}],300:[function(t,e,r){\"use strict\";var n=e.exports={};n.projNames={equirectangular:\"equirectangular\",mercator:\"mercator\",orthographic:\"orthographic\",\"natural earth\":\"naturalEarth\",kavrayskiy7:\"kavrayskiy7\",miller:\"miller\",robinson:\"robinson\",eckert4:\"eckert4\",\"azimuthal equal area\":\"azimuthalEqualArea\",\"azimuthal equidistant\":\"azimuthalEquidistant\",\"conic equal area\":\"conicEqualArea\",\"conic conformal\":\"conicConformal\",\"conic equidistant\":\"conicEquidistant\",gnomonic:\"gnomonic\",stereographic:\"stereographic\",mollweide:\"mollweide\",hammer:\"hammer\",\"transverse mercator\":\"transverseMercator\",\"albers usa\":\"albersUsa\"},n.axesNames=[\"lonaxis\",\"lataxis\"],n.lonaxisSpan={orthographic:180,\"azimuthal equal area\":360,\"azimuthal equidistant\":360,\"conic conformal\":180,gnomonic:160,stereographic:180,\"transverse mercator\":180,\"*\":360},n.lataxisSpan={\"conic conformal\":150,stereographic:179.5,\"*\":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:\"equirectangular\",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:\"albers usa\"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:\"conic conformal\",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:\"mercator\",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:\"mercator\",projRotate:[0,0,0]},\"north america\":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:\"conic conformal\",projRotate:[-100,0,0],projParallels:[29.5,45.5]},\"south america\":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:\"mercator\",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor=\"#F0DC82\",n.waterColor=\"#3399FF\",n.locationmodeToLayer={\"ISO-3\":\"countries\",\"USA-states\":\"subunits\",\"country names\":\"countries\"},n.sphereSVG={type:\"Sphere\"},n.fillLayers=[\"ocean\",\"land\",\"lakes\"],n.lineLayers=[\"subunits\",\"countries\",\"coastlines\",\"rivers\",\"frame\"],n.baseLayers=[\"ocean\",\"land\",\"lakes\",\"subunits\",\"countries\",\"coastlines\",\"rivers\",\"lataxis\",\"lonaxis\",\"frame\"],n.layerNameToAdjective={ocean:\"ocean\",land:\"land\",lakes:\"lake\",subunits:\"subunit\",countries:\"country\",coastlines:\"coastline\",rivers:\"river\",frame:\"frame\"},n.baseLayersOverChoropleth=[\"rivers\",\"lakes\"]},{}],301:[function(t,e,r){e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],302:[function(t,e,r){e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],303:[function(t,e,r){e.exports={circle:\"\\u25cf\",\"circle-open\":\"\\u25cb\",square:\"\\u25a0\",\"square-open\":\"\\u25a1\",diamond:\"\\u25c6\",\"diamond-open\":\"\\u25c7\",cross:\"+\",x:\"\\u274c\"}},{}],304:[function(t,e,r){\"undefined\"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:\"none\",skipStartupTypeset:!0,displayAlign:\"left\",tex2jax:{inlineMath:[[\"$\",\"$\"],[\"\\\\(\",\"\\\\)\"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],305:[function(t,e,r){var n=t(\"./plotly\");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.setPlotConfig=t(\"./plot_api/set_plot_config\"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t(\"d3\")},{\"./plot_api/set_plot_config\":329,\"./plotly\":330,d3:53}],306:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],307:[function(t,e,r){\"use strict\";var n=t(\"../plotly\"),i=t(\"fast-isnumeric\"),a=t(\"tinycolor2\"),o=t(\"./nested_property\");Object.keys(t(\"../components/colorscale/scales\"));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)}},\"boolean\":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,n){!i(t)||void 0!==n.min&&t<n.min||void 0!==n.max&&t>n.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,n){t%1||!i(t)||void 0!==n.min&&t<n.min||void 0!==n.max&&t>n.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if(n.strict===!0&&\"string\"!=typeof t)return void e.set(r);var i=String(t);void 0===t||n.noBlank===!0&&!i?e.set(r):e.set(i)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(n.Colorscale.getScale(t,r))}},angle:{coerceFunction:function(t,e,r){\"auto\"===t?e.set(\"auto\"):i(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},axisid:{coerceFunction:function(t,e,r){if(\"string\"==typeof t&&t.charAt(0)===r){var n=Number(t.substr(1));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},sceneid:{coerceFunction:function(t,e,r){if(\"string\"==typeof t&&t.substr(0,5)===r){var n=Number(t.substr(5));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},geoid:{coerceFunction:function(t,e,r){if(\"string\"==typeof t&&t.substr(0,3)===r){var n=Number(t.substr(3));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},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;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join(\"+\")):e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,i){if(!Array.isArray(t))return void e.set(n);var a=i.items,o=[];n=Array.isArray(n)?n:[];for(var s=0;s<a.length;s++)r.coerce(t,o,a,\"[\"+s+\"]\",n[s]);e.set(o)}}},r.coerce=function(t,e,n,i,a){var s=o(n,i).get(),l=o(t,i),u=o(e,i),c=l.get();return void 0===a&&(a=s.dflt),s.arrayOk&&Array.isArray(c)?(u.set(c),c):(r.valObjects[s.valType].coerceFunction(c,u,a,s),u.get())},r.coerce2=function(t,e,n,i,a){var s=o(t,i),l=r.coerce(t,e,n,i,a);return s.get()?l:!1},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+\".family\",r.family),n.size=t(e+\".size\",r.size),n.color=t(e+\".color\",r.color),n}},{\"../components/colorscale/scales\":288,\"../plotly\":330,\"./nested_property\":317,\"fast-isnumeric\":58,tinycolor2:213}],308:[function(t,e,r){\"use strict\";function n(t,e){return String(t+Math.pow(10,e)).substr(1)}function i(t){var e;return e=y.test(t)?\"Y\":\"y\",e+=b.test(t)?\"b\":\"\"}function a(t){var e;return e=_.test(t)?x.test(t)?\"I\":\"H\":\"D\"}var o=t(\"d3\"),s=t(\"fast-isnumeric\");r.dateTime2ms=function(t){try{if(t.getTime)return+t}catch(e){return!1}var r,n,i,a,o=String(t).split(\" \");if(o.length>2)return!1;var l=o[0].split(\"-\");if(l.length>3||3!==l.length&&o[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var u=(new Date).getFullYear();r=((Number(l[0])-u+70)%100+200)%100+u-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),o[1]?(l=o[1].split(\":\"),l.length>3?!1:(a=Number(l[0]),l[0].length>2||!(a>=0&&23>=a)?!1:(i+=36e5*a,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if(\"undefined\"==typeof o)return void console.log(\"d3 is not defined\");e||(e=0);var r=new Date(t),i=o.time.format(\"%Y-%m-%d\")(r);return 7776e6>e?(i+=\" \"+n(r.getHours(),2),432e6>e&&(i+=\":\"+n(r.getMinutes(),2),108e5>e&&(i+=\":\"+n(r.getSeconds(),2),3e5>e&&(i+=\".\"+n(r.getMilliseconds(),3)))),i.replace(/([:\\s]00)*\\.?[0]*$/,\"\")):i};var l={H:[\"%H:%M:%S~%L\",\"%H:%M:%S\",\"%H:%M\"],I:[\"%I:%M:%S~%L%p\",\"%I:%M:%S%p\",\"%I:%M%p\"],D:[\"%H\",\"%I%p\",\"%Hh\"]},u={Y:[\"%Y~%m~%d\",\"%Y%m%d\",\"%y%m%d\",\"%m~%d~%Y\",\"%d~%m~%Y\"],Yb:[\"%b~%d~%Y\",\"%d~%b~%Y\",\"%Y~%d~%b\",\"%Y~%b~%d\"],y:[\"%m~%d~%y\",\"%d~%m~%y\",\"%y~%m~%d\"],yb:[\"%b~%d~%y\",\"%d~%b~%y\",\"%y~%d~%b\",\"%y~%b~%d\"]},c=o.time.format.utc,h={Y:{H:[\"%Y~%m~%dT%H:%M:%S\",\"%Y~%m~%dT%H:%M:%S~%L\"].map(c),I:[],D:[\"%Y%m%d%H%M%S\",\"%Y~%m\",\"%m~%Y\"].map(c)},Yb:{H:[],I:[],D:[\"%Y~%b\",\"%b~%Y\"].map(c)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};[\"Y\",\"Yb\",\"y\",\"yb\"].forEach(function(t){u[t].forEach(function(e){h[t].D.push(c(e)),[\"H\",\"I\",\"D\"].forEach(function(r){l[r].forEach(function(n){var i=h[t][r];i.push(c(e+\"~\"+n)),i.push(c(n+\"~\"+e))})})})});var f=/[a-z]*/g,d=function(t){return t.substr(0,3)},p=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,g=/[\\s,\\/\\-\\.\\(\\)]+/g,v=/~?([ap])~?m(~|$)/,m=function(t,e){return e+\"m \"},y=/\\d\\d\\d\\d/,b=/(^|~)[a-z]{3}/,x=/[ap]m/,_=/:/,w=/q([1-4])/,k=[\"31~mar\",\"30~jun\",\"30~sep\",\"31~dec\"],A=function(t,e){return k[e-1]},M=/ ?([+\\-]\\d\\d:?\\d\\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if(\"string\"!=typeof t)return!1;t=t.toLowerCase().replace(f,d).replace(p,\"\").replace(g,\"~\").replace(v,m).replace(w,A).trim().replace(M,\"\");var e,r,n=null,o=i(t),s=a(t);e=h[o][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var u=n.getTimezoneOffset();return n.setTime(n.getTime()+60*u*1e3),n}},{d3:53,\"fast-isnumeric\":58}],309:[function(t,e,r){\"use strict\";var n=t(\"events\").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){\"undefined\"!=typeof $&&$(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;\"undefined\"!=typeof $&&(n=$(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;\"function\"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;l<o.length;l++)o[l](r);return i=s(r),void 0!==n?n:i}};e.exports=i},{events:57}],310:[function(t,e,r){\"use strict\";function n(t,e,r){for(var o,s,l,u,c,h,f=t[0],d=t.length,p=1;d>p;p++){o=t[p];for(s in o)l=f[s],u=o[s],e&&u&&(i(u)||(c=a(u)))?(c?(c=!1,h=l&&a(l)?l:[]):h=l&&i(l)?l:{},f[s]=n([h,u],e,r)):(\"undefined\"!=typeof u||r)&&(f[s]=u)}return f}var i=t(\"./is_plain_object.js\"),a=Array.isArray;r.extendFlat=function(){return n(arguments,!1,!1)},r.extendDeep=function(){return n(arguments,!0,!1)},r.extendDeepAll=function(){return n(arguments,!0,!0)}},{\"./is_plain_object.js\":315}],311:[function(t,e,r){\"use strict\";function n(t,e){var r=u[t];return r(e)}function i(t){for(var e,r,n=0;n<l.length;n++)if(e=l[n],r=new RegExp(s[e]),r.test(t.toLowerCase()))return e;console.warn(\"unrecognized country name: \"+t+\".\")}var a=e.exports={},o=t(\"../plotly\"),s=t(\"../constants/country-name_to_iso3.json\"),l=Object.keys(s),u={\"ISO-3\":o.Lib.identity,\"USA-states\":o.Lib.identity,\"country names\":i};a.locationToFeature=function(t,e,r){for(var i,a=n(t,e),o=0;o<r.length;o++)if(i=r[o],i.id===a)return i;console.warn([\"location with id\",a,\"does not have a matching topojson feature at this resolution.\"].join(\" \"))}},{\"../constants/country-name_to_iso3.json\":299,\"../plotly\":330}],312:[function(t,e,r){\"use strict\";function n(t,e){var r=c(t);return r[3]*=e,r}function i(t){return l(t).isValid()?t:h}function a(t){return u(t)?t:f}function o(t,e,r){var o,l,u,c,d,p=t.color,g=Array.isArray(p),v=Array.isArray(e),m=[];if(o=void 0!==t.colorscale?s.Colorscale.makeScaleFunction(t.colorscale,t.cmin,t.cmax):i,l=g?function(t,e){return void 0===t[e]?h:o(t[e])}:i,u=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var y=0;r>y;y++)c=l(p,y),d=u(e,y),m[y]=n(c,d);else m=n(p,e);return m}var s=t(\"../plotly\"),l=t(\"tinycolor2\"),u=t(\"fast-isnumeric\"),c=t(\"./str2rgbarray\"),h=t(\"../components/color/attributes\").defaultLine,f=1;e.exports=o},{\"../components/color/attributes\":282,\"../plotly\":330,\"./str2rgbarray\":323,\"fast-isnumeric\":58,tinycolor2:213}],313:[function(t,e,r){\"use strict\";function n(t){for(var e=0;(e=t.indexOf(\"<sup>\",e))>=0;){var r=t.indexOf(\"</sup>\",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\\<br\\>/g,\"\\n\")}function a(t){return t.replace(/\\<.*\\>/g,\"\")}function o(t){for(var e=0;(e=t.indexOf(\"&\",e))>=0;){var r=t.indexOf(\";\",e);if(e>r)e+=1;else{var n=u[t.slice(e+1,r)];t=n?t.slice(0,e)+n+t.slice(r+1):t.slice(0,e)+t.slice(r+1)}}return t}function s(t){return\"\"+o(a(n(i(t))))}var l=t(\"superscript-text\"),u={mu:\"\\u03bc\",amp:\"&\",lt:\"<\",gt:\">\"};e.exports=s},{\"superscript-text\":199}],314:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=e.exports={};i.nestedProperty=t(\"./nested_property\"),i.isPlainObject=t(\"./is_plain_object\");var a=t(\"./coerce\");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont;var o=t(\"./dates\");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.parseDate=o.parseDate;var s=t(\"./search\");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t(\"./stats\");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t(\"./matrix\");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t(\"./extend\");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.notifier=t(\"./notifier\"),i.swapAttrs=function(t,e,r,n){r||(r=\"x\"),n||(n=\"y\");for(var a=0;a<e.length;a++){var o=e[a],s=i.nestedProperty(t,o.replace(\"?\",r)),l=i.nestedProperty(t,o.replace(\"?\",n)),u=s.get();s.set(l.get()),l.set(u)}},i.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},i.VERBOSE=!1,i.TIMER=(new Date).getTime(),i.log=function(){i.VERBOSE&&console.log.apply(console,arguments)},i.markTime=function(t){if(i.VERBOSE){var e=(new Date).getTime();console.log(t,e-i.TIMER,\"(msec)\"),\"trace\"===i.VERBOSE&&console.trace(),i.TIMER=e}},i.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.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},i.identity=function(t){return t},i.randstr=function h(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return\"0\";var n,i,a,o=Math.log(Math.pow(2,e))/Math.log(r),s=\"\";for(n=2;o===1/0;n*=2)o=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=o-Math.floor(o);for(n=0;n<Math.floor(o);n++)a=Math.floor(Math.random()*r).toString(r),s=a+s;l&&(i=Math.pow(r,l),a=Math.floor(Math.random()*i).toString(r),s=a+s);var u=parseInt(s,r);return t&&t.indexOf(s)>-1||u!==1/0&&u>=Math.pow(2,e)?h(t,e,r):s},i.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},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)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;l>r;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;o>r;r++){for(a=0,n=0;l>n;n++)i=r+n+1-e,-o>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},i.promiseError=function(t){console.log(t,t.stack)},i.syncOrAsync=function(t,e,r){function n(){return i.markTime(\"async done \"+o.name),i.syncOrAsync(t,e,r)}for(var a,o;t.length;){if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);i.markTime(\"sync done \"+o.name)}return r&&r(e)},i.stripTrailingSlash=function(t){return\"/\"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)i=t[r[n]],void 0!==i&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},i.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),i=0;n>i;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};\"object\"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;n<l.length;n++)a=l[n],o=t[a],\"_\"!==a.charAt(0)&&\"function\"!=typeof o&&(\"module\"===a?r[a]=o:Array.isArray(o)?r[a]=o.slice(0,s):o&&\"object\"==typeof o?r[a]=i.minExtend(t[a],e[a]):r[a]=o);for(l=Object.keys(e),n=0;n<l.length;n++)a=l[n],o=e[a],\"object\"==typeof o&&a in r&&\"object\"==typeof r[a]||(r[a]=o);return r},i.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},i.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},i.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(i.isPlotDiv(t))return t},i.isPlotDiv=function(t){var e=n.select(t);return e.size()&&e.classed(\"js-plotly-plot\")},i.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},i.addStyleRule=function(t,e){if(!i.styleSheet){var r=document.createElement(\"style\");r.appendChild(document.createTextNode(\"\")),document.head.appendChild(r),i.styleSheet=r.sheet}var n=i.styleSheet;n.insertRule?n.insertRule(t+\"{\"+e+\"}\",0):n.addRule?n.addRule(t,e,0):console.warn(\"addStyleRule failed\")},i.isIE=function(){return\"undefined\"!=typeof window.navigator.msSaveBlob}},{\"./coerce\":307,\"./dates\":308,\"./extend\":310,\"./is_plain_object\":315,\"./matrix\":316,\"./nested_property\":317,\"./notifier\":318,\"./search\":320,\"./stats\":322,d3:53}],315:[function(t,e,r){\"use strict\";e.exports=function(t){return\"[object Object]\"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],316:[function(t,e,r){\"use strict\";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;t>n;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;n>e;e++)for(a[e]=new Array(i),r=0;i>r;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;a>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=r.dot(t,o[i])}else for(n=0,i=0;a>i;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],317:[function(t,e,r){\"use strict\";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o<e.length-1;o++){if(r=e[o],-1===r){for(i=!0,a=[],s=0;s<l.length;s++)a[s]=n(l[s],e.slice(o+1))(),a[s]!==a[0]&&(i=!1);return i?a[0]:a}if(\"number\"==typeof r&&!Array.isArray(l))return void 0;if(l=l[r],\"object\"!=typeof l||null===l)return void 0}return\"object\"!=typeof l||null===l?void 0:(a=l[e[o]],null===a?void 0:a)}}function i(t,e){var r=[\"annotations\",\"shapes\",\"range\",\"domain\"],n=-1===r.indexOf(e);return Array.isArray(t)&&n}function a(t,e){return function(r){var n,a,c=t,h=[t],f=u(r)&&!i(r,e[e.length-1]);for(a=0;a<e.length-1;a++){if(n=e[a],\"number\"==typeof n&&!Array.isArray(c))throw\"array index but container is not an array\";if(-1===n){if(f=!o(c,e.slice(a+1),r))break;return}if(!s(c,n,e[a+1],f))break;if(c=c[n],\"object\"!=typeof c||null===c)throw\"container is not an object\";h.push(c)}f?(a===e.length-1&&delete c[e[a]],l(h)):c[e[a]]=r}}function o(t,e,r){var n,i=Array.isArray(r),o=!0,l=r,c=i?!1:u(r),h=e[0];for(n=0;n<t.length;n++)i&&(l=r[n%r.length],c=u(l)),c&&(o=!1),s(t,n,h,c)&&a(t[n],e)(l);return o}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;\"number\"==typeof r?t[e]=[]:t[e]={}}return!0}function l(t){var e,r,n,a,o;for(e=t.length-1;e>=0;e--){if(n=t[e],o=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)u(n[r])?o?n[r]=void 0:n.pop():o=!0;else if(\"object\"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)u(n[a[r]])&&!i(n[a[r]],a[r])?delete n[a[r]]:o=!0;if(o)return}}function u(t){return void 0===t||null===t?!0:\"object\"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function c(t,e,r){return{set:function(){throw\"bad container\"},get:function(){},astr:e,parts:r,obj:t}}var h=t(\"fast-isnumeric\");e.exports=function(t,e){if(h(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<l.length;){if(r=String(l[s]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/)){if(r[1])l[s]=r[1];else{if(0!==s)throw\"bad property string\";l.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split(\"][\"),o=0;o<i.length;o++)s++,l.splice(s,0,Number(i[o]))}s++}return\"object\"!=typeof t?c(t,e,l):{set:a(t,l),get:n(t,l),astr:e,parts:l,obj:t}}},{\"fast-isnumeric\":58}],318:[function(t,e,r){\"use strict\";var n=t(\"d3\"),i=t(\"fast-isnumeric\"),a=[];e.exports=function(t,e){function r(t){t.duration(700).style(\"opacity\",0).each(\"end\",function(t){var e=a.indexOf(t);-1!==e&&a.splice(e,1),n.select(this).remove()})}if(-1===a.indexOf(t)){a.push(t);var o=1e3;i(e)?o=e:\"long\"===e&&(o=3e3);var s=n.select(\"body\").selectAll(\".plotly-notifier\").data([0]);s.enter().append(\"div\").classed(\"plotly-notifier\",!0);var l=s.selectAll(\".notifier-note\").data(a);l.enter().append(\"div\").classed(\"notifier-note\",!0).style(\"opacity\",0).each(function(t){var e=n.select(this);e.append(\"button\").classed(\"notifier-close\",!0).html(\"&times;\").on(\"click\",function(){e.transition().call(r)}),e.append(\"p\").html(t),e.transition().duration(700).style(\"opacity\",1).transition().delay(o).call(r)})}}},{d3:53,\"fast-isnumeric\":58}],319:[function(t,e,r){\"use strict\";function n(t,e){for(var r,n=[],a=0;a<e.length;a++)r=e[a],r===t?n[a]=r:\"object\"==typeof r?n[a]=Array.isArray(r)?i.Lib.extendDeep([],r):i.Lib.extendDeepAll({},r):n[a]=r;return n}var i=t(\"../plotly\"),a={};a.add=function(t,e,r,n,i){var a,o;return t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},o=t.undoQueue.index,t.autoplay?void(t.undoQueue.inSequence||(t.autoplay=!1)):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(a={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(o,t.undoQueue.queue.length-o,a),t.undoQueue.index+=1):a=t.undoQueue.queue[o-1],t.undoQueue.beginSequence=!1,a.undo.calls.unshift(e),a.undo.args.unshift(r),a.redo.calls.push(n),void a.redo.args.push(i))},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,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<e.undo.calls.length;r++)a.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},a.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)a.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},a.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=a},{\"../plotly\":330}],320:[function(t,e,r){\"use strict\";function n(t,e){return e>t}function i(t,e){return e>=t}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t(\"fast-isnumeric\");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 l,u,c=0,h=e.length,f=0;for(u=e[e.length-1]>e[0]?r?n:i:r?o:a;h>c&&f++<100;)l=Math.floor((c+h)/2),u(e[l],t)?c=l+1:h=l;return f>90&&console.log(\"Long binary search...\"),c-1},r.sorterAsc=function(t,e){return t-e},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;n>s;s++)e[s+1]>e[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;a>i&&o++<100;)n=u((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{\"fast-isnumeric\":58}],321:[function(t,e,r){\"use strict\";var n=t(\"../plotly\");e.exports=function(t){var e=function(){};for(var r in t)\"function\"==typeof t[r]&&(t[r]=e);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var i=document.createElement(\"div\");return i.textContent=\"Webgl is not supported by your browser - visit http://get.webgl.org for more info\",i.style.cursor=\"pointer\",i.style.fontSize=\"24px\",i.style.color=n.Color.defaults[0],t.container.appendChild(i),t.container.style.background=\"#FFFFFF\",t.container.onclick=function(){window.open(\"http://get.webgl.org\")},!1}},{\"../plotly\":330}],322:[function(t,e,r){\"use strict\";var n=t(\"fast-isnumeric\");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;a>o;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;a>o;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw\"n should be a finite number\";if(e=e*t.length-.5,0>e)return t[0];if(e>t.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\":58}],323:[function(t,e,r){\"use strict\";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t(\"tinycolor2\"),a=t(\"arraytools\");e.exports=n},{arraytools:32,tinycolor2:213}],324:[function(t,e,r){\"use strict\";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|&lt;|&#60;)/g,\"\\\\lt \").replace(/(>|&gt;|&#62;)/g,\"\\\\gt \")}function a(t,e,r){var n=\"math-output-\"+l.Lib.randstr([],64),a=u.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=u.select(\"body\").select(\"#MathJax_SVG_glyphs\");if(a.select(\".MathJax_SVG\").empty()||!a.select(\"svg\").node())console.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){for(var e=l.util.html_entity_decode(t),r=e.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\\/?)([^ >]*)\\s*(.*)>/i),r=e&&e[2].toLowerCase(),n=h[r];if(void 0!==n){var i=e[1],a=e[3],o=a.match(/^style\\s*=\\s*\"([^\"]+)\"\\s*/i);if(\"a\"===r)return i?\"</a>\":\"href\"!==a.substr(0,4).toLowerCase()?\"<a>\":'<a xlink:show=\"new\" xlink:href'+a.substr(4)+\">\";if(\"br\"===r)return\"<br>\";if(i)return\"sup\"===r?'</tspan><tspan dy=\"0.42em\">&#x200b;</tspan>':\"sub\"===r?'</tspan><tspan dy=\"-0.21em\">&#x200b;</tspan>':\"</tspan>\";var s=\"<tspan\";return(\"sup\"===r||\"sub\"===r)&&(s=\"&#x200b;\"+s),o&&(o=o[1].replace(/(^|;)\\s*color:/,\"$1 fill:\"),n=(n?n+\";\":\"\")+o),s+(n?' style=\"'+n+'\"':\"\")+\">\"}return l.util.xml_entity_encode(t).replace(/</g,\"&lt;\")}),n=[],i=r.indexOf(\"<br>\");i>0;i=r.indexOf(\"<br>\",i+1))n.push(i);var a=0;n.forEach(function(t){for(var e=t+a,n=r.slice(0,e),i=\"\",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\\/?).*>/i);if(s&&\"<br>\"!==n[o]){s[1]||(i=n[o]);break}}i&&(r.splice(e+1,0,i),r.splice(e,0,\"</tspan>\"),a+=2)});var o=r.join(\"\"),s=o.split(/<br>/gi);return s.length>1&&(r=s.map(function(t,e){return'<tspan class=\"line\" dy=\"'+1.3*e+'em\">'+t+\"</tspan>\"})),r.join(\"\")}function s(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 l=t(\"../plotly\"),u=t(\"d3\"),c=e.exports={};u.selection.prototype.appendSVG=function(t){for(var e='<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">'+t+\"</svg>\",r=(new DOMParser).parseFromString(e,\"application/xml\"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector(\"parsererror\")?(console.log(r.querySelector(\"parsererror div\").textContent),null):u.select(this.node().lastChild)},c.html_entity_decode=function(t){var e=u.select(\"body\").append(\"div\").style({display:\"none\"}).html(\"\"),r=t.replace(/(&[^;]*;)/gi,function(t){return\"&lt;\"===t?\"&#60;\":\"&rt;\"===t?\"&#62;\":e.html(t).text()});return e.remove(),r},c.xml_entity_encode=function(t){return t.replace(/&(?!\\w+;|\\#[0-9]+;| \\#x[0-9A-F]+;)/g,\"&amp;\")},c.convertToTspans=function(t,e){function r(){d.empty()||(p=c.attr(\"class\")+\"-math\",d.select(\"svg.\"+p).remove()),t.text(\"\").style({visibility:\"visible\",\"white-space\":\"pre\"}),f=t.appendSVG(s),f||t.text(i),t.select(\"a\").size()&&t.style(\"pointer-events\",\"all\"),\n",
"e&&e.call(c)}var i=t.text(),s=o(i),c=t,h=!c.attr(\"data-notex\")&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),f=i,d=u.select(c.node().parentNode);if(!d.empty()){var p=c.attr(\"class\")?c.attr(\"class\").split(\" \")[0]:\"text\";p+=\"-math\",d.selectAll(\"svg.\"+p).remove(),d.selectAll(\"g.\"+p+\"-group\").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute(\"data-bb\");if(h){var v=l.Lib.getPlotDiv(c.node());(v&&v._promises||[]).push(new Promise(function(t){c.style({visibility:\"hidden\"});var i={fontSize:parseInt(c.style(\"font-size\"),10)};a(h[2],i,function(i,a,o){d.selectAll(\"svg.\"+p).remove(),d.selectAll(\"g.\"+p+\"-group\").remove();var s=i&&i.select(\"svg\");if(!s||!s.node())return r(),void t();var l=d.append(\"g\").classed(p+\"-group\",!0).attr({\"pointer-events\":\"none\"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({\"class\":p,height:o.height,preserveAspectRatio:\"xMinYMin meet\"}).style({overflow:\"visible\",\"pointer-events\":\"none\"});var u=c.style(\"fill\")||\"black\";s.select(\"g\").attr({fill:u,stroke:u});var h=n(s,\"width\"),f=n(s,\"height\"),g=+c.attr(\"x\")-h*{start:0,middle:.5,end:1}[c.attr(\"text-anchor\")||\"start\"],v=parseInt(c.style(\"font-size\"),10)||n(c,\"height\"),m=-v/4;\"y\"===p[0]?(l.attr({transform:\"rotate(\"+[-90,+c.attr(\"x\"),+c.attr(\"y\")]+\") translate(\"+[-h/2,m-f/2]+\")\"}),s.attr({x:+c.attr(\"x\"),y:+c.attr(\"y\")})):\"l\"===p[0]?s.attr({x:c.attr(\"x\"),y:m-f/2}):\"a\"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+c.attr(\"y\")+m-f/2}),e&&e.call(c,l),t(l)})}))}else r();return t}};var h={sup:'font-size:70%\" dy=\"-0.6em',sub:'font-size:70%\" dy=\"0.3em',b:\"font-weight:bold\",i:\"font-style:italic\",a:\"\",span:\"\",br:\"\",em:\"font-style:italic;font-weight:bold\"},f=new RegExp(\"</?(\"+Object.keys(h).join(\"|\")+\")( [^>]*)?/?>\",\"g\");c.plainText=function(t){return(t||\"\").replace(f,\" \")},c.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=f.attr(\"class\");t=e?\".\"+e.split(\" \")[0]+\"-math-group\":\"[class*=-math-group]\",t&&u.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=u.select(l.Lib.getPlotDiv(o.node())),e=t.select(\".svg-container\"),n=e.append(\"div\");n.classed(\"plugin-editable editable\",!0).style({position:\"absolute\",\"font-family\":o.style(\"font-family\")||\"Arial\",\"font-size\":o.style(\"font-size\")||12,color:r.fill||o.style(\"fill\")||\"black\",opacity:1,\"background-color\":r.background||\"transparent\",outline:\"#ffffff33 1px solid\",margin:[-parseFloat(o.style(\"font-size\"))/8+1,0,0,-1].join(\"px \")+\"px\",padding:\"0\",\"box-sizing\":\"border-box\"}).attr({contenteditable:!0}).text(r.text||o.attr(\"data-unformatted\")).call(s(o,e,r)).on(\"blur\",function(){o.text(this.textContent).style({opacity:1});var t,e=u.select(this).attr(\"class\");t=e?\".\"+e.split(\" \")[0]+\"-math-group\":\"[class*=-math-group]\",t&&u.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;u.select(this).transition().duration(0).remove(),u.select(document).on(\"mouseup\",null),c.edit.call(o,r)}).on(\"focus\",function(){var t=this;u.select(document).on(\"mouseup\",function(){return u.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on(\"keyup\",function(){27===u.event.which?(o.style({opacity:1}),u.select(this).style({opacity:0}).on(\"blur\",function(){return!1}).transition().remove(),c.cancel.call(o,this.textContent)):(c.input.call(o,this.textContent),u.select(this).call(s(o,e,r)))}).on(\"keydown\",function(){13===u.event.which&&this.blur()}).call(i)}r||(r={});var o=this,c=u.dispatch(\"edit\",\"input\",\"cancel\"),h=u.select(this.node()).style({\"pointer-events\":\"all\"}),f=e||h;return e&&h.style({\"pointer-events\":\"none\"}),r.immediate?n():f.on(\"click\",n),u.rebind(this,c,\"on\")}},{\"../plotly\":330,d3:53}],325:[function(t,e,r){\"use strict\";var n=e.exports={},i=t(\"../constants/geo_constants\").locationmodeToLayer,a=t(\"topojson\").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}},{\"../constants/geo_constants\":300,topojson:214}],326:[function(t,e,r){\"use strict\";function n(t){var e;if(\"string\"==typeof t){if(e=document.getElementById(t),null===e)throw new Error(\"No DOM element with id '\"+t+\"' exits on the page.\");return e}if(null===t||void 0===t)throw new Error(\"DOM element provided is null or undefined\");return t}function i(t,e){t._fullLayout._paperdiv.style(\"background\",\"white\"),z.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=z.Lib.extendFlat({},z.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&(\"setBackground\"===t&&\"opaque\"===e[t]?r[t]=i:r[t]=e[t])}),t._fullLayout&&t._fullLayout._modebar&&delete t._fullLayout._modebar,e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t){var e,r,n,i,a,o=t._fullLayout,s=t._fullData,l=D.getSubplotIds(o,\"gl3d\");for(o._paperdiv.style({width:o.width+\"px\",height:o.height+\"px\"}),t._context.setBackground(t,o.paper_bgcolor),e=0;e<l.length;e++)r=l[e],n=D.getSubplotData(s,\"gl3d\",r),i=o[r]._scene,void 0===i&&(a={container:t.querySelector(\".gl-container\"),id:r,staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},i=new z.Scene(a,o),o[r]._scene=i),i.plot(n,o,t.layout)}function s(t){var e,r,n,i,a=t._fullLayout,o=t._fullData,s=D.getSubplotIds(a,\"geo\");for(void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}}),e=0;e<s.length;e++)r=s[e],n=D.getSubplotData(o,\"geo\",r),i=a[r]._geo,void 0===i&&(i=new z.Geo({id:r,container:a._geocontainer.node(),topojsonURL:t._context.topojsonURL},a),a[r]._geo=i),i.plot(n,a)}function l(t){for(var e=t._fullLayout,r=t._fullData,n=D.getSubplotIds(e,\"gl2d\"),i=0;i<n.length;i++){var a,o=n[i],s=e._plots[o],l=D.getSubplotData(r,\"gl2d\",o);a=s._scene2d,void 0===a&&(a=new z.Scene2D({container:t.querySelector(\".gl-container\"),id:o,staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),s._scene2d=a),a.plot(l,e,t.layout)}}function u(t,e,r){var n=j.select(t).selectAll(\".plot-container\").data([0]);n.enter().insert(\"div\",\":first-child\").classed(\"plot-container plotly\",!0);var i=n.selectAll(\".svg-container\").data([0]);i.enter().append(\"div\").classed(\"svg-container\",!0).style(\"position\",\"relative\"),i.html(\"\"),e&&(t.data=e),r&&(t.layout=r),z.micropolar.manager.fillLayout(t),\"initial\"===t._fullLayout.autosize&&t._context.autosizable&&(M(t,{}),t._fullLayout.autosize=r.autosize=!0),i.style({width:t._fullLayout.width+\"px\",height:t._fullLayout.height+\"px\"}),t.framework=z.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;\"\"!==s&&s||(o=0);var l=\"Click to enter title\",u=function(){this.call(z.util.convertToTspans)},c=a.select(\".title-group text\").call(u);if(t._context.editable){c.attr({\"data-unformatted\":s}),s&&s!==l||(o=.2,c.attr({\"data-unformatted\":l}).text(l).style({opacity:o}).on(\"mouseover.opacity\",function(){j.select(this).transition().duration(100).style(\"opacity\",1)}).on(\"mouseout.opacity\",function(){j.select(this).transition().duration(1e3).style(\"opacity\",0)}));var h=function(){this.call(z.util.makeEditable).on(\"edit\",function(e){t.framework({layout:{title:e}}),this.attr({\"data-unformatted\":e}).text(e).call(u),this.call(h)}).on(\"cancel\",function(){var t=this.attr(\"data-unformatted\");this.text(t).call(u)})};c.call(h)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),D.addLinks(t),Promise.resolve()}function c(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 n=z.Axes.list({_fullLayout:t});for(e=0;e<n.length;e++){var i=n[e];i.anchor&&\"free\"!==i.anchor&&(i.anchor=z.Axes.cleanId(i.anchor)),i.overlaying&&(i.overlaying=z.Axes.cleanId(i.overlaying)),i.type||(i.isdate?i.type=\"date\":i.islog?i.type=\"log\":i.isdate===!1&&i.islog===!1&&(i.type=\"linear\")),(\"withzero\"===i.autorange||\"tozero\"===i.autorange)&&(i.autorange=!0,i.rangemode=\"tozero\"),delete i.islog,delete i.isdate,delete i.categories,p(i,\"domain\")&&delete i.domain,void 0!==i.autotick&&(void 0===i.tickmode&&(i.tickmode=i.autotick?\"auto\":\"linear\"),delete i.autotick)}void 0===t.annotations||Array.isArray(t.annotations)||(console.log(\"annotations must be an array\"),delete t.annotations);var a=(t.annotations||[]).length;for(e=0;a>e;e++){var o=t.annotations[e];o.ref&&(\"paper\"===o.ref?(o.xref=\"paper\",o.yref=\"paper\"):\"data\"===o.ref&&(o.xref=\"x\",o.yref=\"y\"),delete o.ref),h(o,\"xref\"),h(o,\"yref\")}void 0===t.shapes||Array.isArray(t.shapes)||(console.log(\"shapes must be an array\"),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var l=t.shapes[e];h(l,\"xref\"),h(l,\"yref\")}var u=t.legend;u&&(u.x>3?(u.x=1.02,u.xanchor=\"left\"):u.x<-2&&(u.x=-.02,u.xanchor=\"right\"),u.y>3?(u.y=1.02,u.yanchor=\"bottom\"):u.y<-2&&(u.y=-.02,u.yanchor=\"top\")),\"rotate\"===t.dragmode&&(t.dragmode=\"orbit\"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var c,f,d,g,v,m,y,b=D.getSubplotIds(t,\"gl3d\");for(e=0;e<b.length;e++)if(c=t[b[e]],f=c.cameraposition,Array.isArray(f)&&4===f[0].length){for(d=f[0],v=f[1],g=f[2],m=O([],d),y=[],r=0;3>r;++r)y[r]=v[e]+g*m[2+4*r];c.camera={eye:{x:y[0],y:y[1],z:y[2]},center:{x:v[0],y:v[1],z:v[2]},up:{x:m[1],y:m[5],z:m[9]}},delete c.cameraposition}return z.Lib.markTime(\"finished rest of cleanLayout, starting color\"),z.Color.clean(t),z.Lib.markTime(\"finished cleanLayout color.clean\"),t}function h(t,e){var r=t[e],n=e.charAt(0);r&&\"paper\"!==r&&(t[e]=z.Axes.cleanId(r,n))}function f(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return\"uid\"in t}).map(function(t){return t.uid})),i=0;i<t.length;i++){var a=t[i];if(!(\"uid\"in a)||-1!==r.indexOf(a.uid)){var o,s;for(s=0;100>s&&(o=z.Lib.randstr(n),-1!==r.indexOf(o));s++);a.uid=z.Lib.randstr(n),n.push(a.uid)}if(r.push(a.uid),\"histogramy\"===a.type&&\"xbins\"in a&&!(\"ybins\"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&\"opacity\"in a.error_y){var l=z.Color.defaults,u=a.error_y.color||(D.traceIs(a,\"bar\")?z.Color.defaultLine:l[i%l.length]);a.error_y.color=z.Color.addOpacity(z.Color.rgb(u),z.Color.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}\"bardir\"in a&&(\"h\"!==a.bardir||!D.traceIs(a,\"bar\")&&\"histogram\"!==a.type.substr(0,9)||(a.orientation=\"h\",k(a)),delete a.bardir),\"histogramy\"===a.type&&k(a),(\"histogramx\"===a.type||\"histogramy\"===a.type)&&(a.type=\"histogram\"),\"scl\"in a&&(a.colorscale=a.scl,delete a.scl),\"reversescl\"in a&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=z.Axes.cleanId(a.xaxis,\"x\")),a.yaxis&&(a.yaxis=z.Axes.cleanId(a.yaxis,\"y\")),a.scene&&(a.scene=z.Gl3dLayout.cleanId(a.scene)),D.traceIs(a,\"pie\")||(Array.isArray(a.textposition)?a.textposition=a.textposition.map(d):a.textposition&&(a.textposition=d(a.textposition))),p(a,\"line\")&&delete a.line,\"marker\"in a&&(p(a.marker,\"line\")&&delete a.marker.line,p(a,\"marker\")&&delete a.marker),z.Lib.markTime(\"finished rest of cleanData, starting color\"),z.Color.clean(a),z.Lib.markTime(\"finished cleanData color.clean\")}}function d(t){var e=\"middle\",r=\"center\";return-1!==t.indexOf(\"top\")?e=\"top\":-1!==t.indexOf(\"bottom\")&&(e=\"bottom\"),-1!==t.indexOf(\"left\")?r=\"left\":-1!==t.indexOf(\"right\")&&(r=\"right\"),e+\" \"+r}function p(t,e){return e in t&&\"object\"==typeof t[e]&&0===Object.keys(t[e]).length}function g(t){var e,r,n,i,a=z.Axes.list(t),o=t._fullData,s=t._fullLayout,l=t.calcdata=new Array(o.length);for(t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,s._piecolormap={},s._piedefaultcolorcount=0,e=0;e<a.length;e++)a[e]._categories=[];for(e=0;e<o.length;e++)r=o[e],n=r._module,i=[],n&&r.visible===!0&&n.calc&&(i=n.calc(t,r)),Array.isArray(i)&&i[0]||(i=[{x:!1,y:!1}]),i[0].t||(i[0].t={}),i[0].trace=r,z.Lib.markTime(\"done with calcdata for \"+e),l[e]=i}function v(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)n=t[r],0>n?a.push(i+n):a.push(n);return a}function m(t,e,r){var n,i;for(n=0;n<e.length;n++){if(i=e[n],i!==parseInt(i,10))throw new Error(\"all values in \"+r+\" must be integers\");if(i>=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||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error(\"each index in \"+r+\" must be unique.\")}}function y(t,e,r){if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array.\");if(\"undefined\"==typeof e)throw new Error(\"currentIndices is a required argument.\");if(Array.isArray(e)||(e=[e]),m(t,e,\"currentIndices\"),\"undefined\"==typeof r||Array.isArray(r)||(r=[r]),\"undefined\"!=typeof r&&m(t,r,\"newIndices\"),\"undefined\"!=typeof r&&e.length!==r.length)throw new Error(\"current and new indices must be of equal length.\")}function b(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array.\");if(\"undefined\"==typeof e)throw new Error(\"traces must be defined.\");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if(i=e[n],\"object\"!=typeof i||Array.isArray(i)||null===i)throw new Error(\"all values in traces array must be non-array objects\");if(\"undefined\"==typeof r||Array.isArray(r)||(r=[r]),\"undefined\"!=typeof r&&r.length!==e.length)throw new Error(\"if indices is specified, traces.length must equal indices.length\")}function x(t,e,r,n){var i=z.Lib.isPlainObject(n);if(!Array.isArray(t.data))throw new Error(\"gd.data must be an array\");if(!z.Lib.isPlainObject(e))throw new Error(\"update must be a key:value object\");if(\"undefined\"==typeof r)throw new Error(\"indices must be an integer or array of integers\");m(t,r,\"indices\");for(var a in e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error(\"attribute \"+a+\" must be an array of length equal to indices array length\");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error(\"when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object\")}}function _(t,e,r,n){var i,a,o,s,l,u=z.Lib.isPlainObject(n),c=[];Array.isArray(r)||(r=[r]),r=v(r,t.data.length-1);for(var h in e)for(var f=0;f<r.length;f++){if(i=t.data[r[f]],o=z.Lib.nestedProperty(i,h),a=o.get(),s=e[h][f],!Array.isArray(s))throw new Error(\"attribute: \"+h+\" index: \"+f+\" must be an array\");if(!Array.isArray(a))throw new Error(\"cannot extend missing or non-array attribute: \"+h);l=u?n[h][f]:n,I(l)||(l=-1),c.push({prop:o,target:a,insert:s,maxp:Math.floor(l)})}return c}function w(t,e,r,n,i,a){x(t,e,r,n);for(var o,s,l,u=_(t,e,r,n),c=[],h={},f={},d=0;d<u.length;d++)s=u[d].prop,l=u[d].maxp,o=i(u[d].target,u[d].insert),l>=0&&l<o.length&&(c=a(o,l)),l=u[d].target.length,s.set(o),Array.isArray(h[s.astr])||(h[s.astr]=[]),Array.isArray(f[s.astr])||(f[s.astr]=[]),h[s.astr].push(c),f[s.astr].push(l);return{update:h,maxPoints:f}}function k(t){var e;if(z.Lib.swapAttrs(t,[\"?\",\"?0\",\"d?\",\"?bins\",\"nbins?\",\"autobin?\",\"?src\",\"error_?\"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n=\"copy_ystyle\"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);z.Lib.swapAttrs(t,[\"error_?.copy_ystyle\"]),n&&z.Lib.swapAttrs(t,[\"error_?.color\",\"error_?.thickness\",\"error_?.width\"])}if(t.hoverinfo){var i=t.hoverinfo.split(\"+\");for(e=0;e<i.length;e++)\"x\"===i[e]?i[e]=\"y\":\"y\"===i[e]&&(i[e]=\"x\");t.hoverinfo=i.join(\"+\")}}function A(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}function M(t,e){var r,n,i=t._fullLayout,a=t._context;if(t.emit(\"plotly_autosize\"),t._context.fillFrame)n=window.innerWidth,r=window.innerHeight,document.body.style.overflow=\"hidden\";else if(I(a.frameMargins)&&a.frameMargins>0){var o=A(t._boundingBoxMargins),s=o.left+o.right,l=o.bottom+o.top,u=i._container.node().getBoundingClientRect(),c=1-2*a.frameMargins;n=Math.round(c*(u.width-s)),r=Math.round(c*(u.height-l))}else r=parseFloat(window.getComputedStyle(t).height)||i.height,n=parseFloat(window.getComputedStyle(t).width)||i.width;return Math.abs(i.width-n)>1||Math.abs(i.height-r)>1?(i.height=t.layout.height=r,i.width=t.layout.width=n):\"initial\"!==i.autosize&&(delete e.autosize,i.autosize=t.layout.autosize=!0),D.sanitizeMargins(i),e}function L(t){var e=j.select(t),r=t._fullLayout;if(r._hasGL3D&&z.Gl3dLayout.initAxes(t),r._container=e.selectAll(\".plot-container\").data([0]),r._container.enter().insert(\"div\",\":first-child\").classed(\"plot-container\",!0).classed(\"plotly\",!0),r._paperdiv=r._container.selectAll(\".svg-container\").data([0]),r._paperdiv.enter().append(\"div\").classed(\"svg-container\",!0).style(\"position\",\"relative\"),\"initial\"===r.autosize&&(M(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(\".gl-container\").data([0]),r._glcontainer.enter().append(\"div\").classed(\"gl-container\",!0),r._geocontainer=r._paperdiv.selectAll(\".geo-container\").data([0]),r._geocontainer.enter().append(\"div\").classed(\"geo-container\",!0),r._paperdiv.selectAll(\".main-svg\").remove(),r._paper=r._paperdiv.insert(\"svg\",\":first-child\").classed(\"main-svg\",!0),r._toppaper=r._paperdiv.append(\"svg\").classed(\"main-svg\",!0),!r._uid){var n=[];j.selectAll(\"defs\").each(function(){this.id&&n.push(this.id.split(\"-\")[1])}),r._uid=z.Lib.randstr(n)}r._paperdiv.selectAll(\".main-svg\").attr({xmlns:\"http://www.w3.org/2000/svg\",\"xmlns:xmlns:xlink\":\"http://www.w3.org/1999/xlink\"}),r._defs=r._paper.append(\"defs\").attr(\"id\",\"defs-\"+r._uid),r._draggers=r._paper.append(\"g\").classed(\"draglayer\",!0);var i=z.Axes.getSubplots(t);i.join(\"\")!==Object.keys(t._fullLayout._plots||{}).join(\"\")&&T(t,i),r._hasCartesian&&E(t,i),r._shapelayer=r._paper.append(\"g\").classed(\"shapelayer\",!0),r._pielayer=r._paper.append(\"g\").classed(\"pielayer\",!0),r._glimages=r._paper.append(\"g\").classed(\"glimages\",!0),r._geoimages=r._paper.append(\"g\").classed(\"geoimages\",!0),r._infolayer=r._toppaper.append(\"g\").classed(\"infolayer\",!0),r._hoverlayer=r._toppaper.append(\"g\").classed(\"hoverlayer\",!0),t.emit(\"plotly_framework\");var a=z.Lib.syncOrAsync([C,function(){return z.Axes.doTicks(t,\"redraw\")},z.Fx.init],t);return a&&a.then&&t._promises.push(a),a}function T(t,e){function r(e,r){return function(){return z.Axes.getFromId(t,e,r)}}for(var n,i,a=t._fullLayout._plots={},o=0;o<e.length;o++)n=e[o],i=a[n]={},i.id=n,i.x=r(n,\"x\"),i.y=r(n,\"y\"),i.xaxis=i.x(),i.yaxis=i.y()}function E(t,e){function r(t){t.append(\"g\").classed(\"maplayer\",!0),t.append(\"g\").classed(\"barlayer\",!0),t.append(\"g\").classed(\"errorlayer\",!0),t.append(\"g\").classed(\"boxlayer\",!0),t.append(\"g\").classed(\"scatterlayer\",!0)}var n=t._fullLayout,i=[];n._paper.selectAll(\"g.subplot\").data(e).enter().append(\"g\").classed(\"subplot\",!0).each(function(a){var o=n._plots[a],s=o.plotgroup=j.select(this).classed(a,!0),l=o.xaxis,u=o.yaxis;o.overlays=[];var c=z.Axes.getFromId(t,l.overlaying)||l;c!==l&&c.overlaying&&(c=l,l.overlaying=!1);var h=z.Axes.getFromId(t,u.overlaying)||u;h!==u&&h.overlaying&&(h=u,u.overlaying=!1);var f=c._id+h._id;f!==a&&-1!==e.indexOf(f)?(o.mainplot=f,i.push(o),l.domain=c.domain.slice(),u.domain=h.domain.slice()):(o.bg=s.append(\"rect\").style(\"stroke-width\",0),o.gridlayer=s.append(\"g\"),o.overgrid=s.append(\"g\"),o.zerolinelayer=s.append(\"g\"),o.overzero=s.append(\"g\"),o.plot=s.append(\"svg\").call(r),o.overplot=s.append(\"g\"),o.xlines=s.append(\"path\"),o.ylines=s.append(\"path\"),o.overlines=s.append(\"g\"),o.xaxislayer=s.append(\"g\"),o.yaxislayer=s.append(\"g\"),o.overaxes=s.append(\"g\")),o.draglayer=n._draggers.append(\"g\")}),i.forEach(function(t){var e=n._plots[t.mainplot];e.overlays.push(t),t.gridlayer=e.overgrid.append(\"g\"),t.zerolinelayer=e.overzero.append(\"g\"),t.plot=e.overplot.append(\"svg\").call(r),t.xlines=e.overlines.append(\"path\"),t.ylines=e.overlines.append(\"path\"),t.xaxislayer=e.overaxes.append(\"g\"),t.yaxislayer=e.overaxes.append(\"g\")}),e.forEach(function(t){var e=n._plots[t];e.plot.attr(\"preserveAspectRatio\",\"none\").style(\"fill\",\"none\"),e.xlines.style(\"fill\",\"none\").classed(\"crisp\",!0),e.ylines.style(\"fill\",\"none\").classed(\"crisp\",!0)})}function C(t){return z.Lib.syncOrAsync([D.doAutoMargin,S],t)}function S(t){var e,r=t._fullLayout,n=r._size,i=z.Axes.list(t);for(e=0;e<i.length;e++)i[e]._linepositions={};r._paperdiv.style({width:r.width+\"px\",height:r.height+\"px\"}).selectAll(\".main-svg\").call(z.Drawing.setSize,r.width,r.height),t._context.setBackground(t,r.paper_bgcolor);var a=[];return r._paper.selectAll(\"g.subplot\").each(function(e){var i=r._plots[e],o=z.Axes.getFromId(t,e,\"x\"),s=z.Axes.getFromId(t,e,\"y\");o.setScale(),s.setScale(),i.bg&&i.bg.call(z.Drawing.setRect,o._offset-n.p,s._offset-n.p,o._length+2*n.p,s._length+2*n.p).call(z.Color.fill,r.plot_bgcolor),i.plot.call(z.Drawing.setRect,o._offset,s._offset,o._length,s._length);var l=z.Drawing.crispRound(t,o.linewidth,1),u=z.Drawing.crispRound(t,s.linewidth,1),c=n.p+u,h=\"M\"+-c+\",\",f=\"h\"+(o._length+2*c),d=\"free\"===o.anchor&&-1===a.indexOf(o._id),p=n.h*(1-(o.position||0))+l/2%1,g=o.anchor===s._id&&(o.mirror||\"top\"!==o.side)||\"all\"===o.mirror||\"allticks\"===o.mirror||o.mirrors&&o.mirrors[s._id+\"bottom\"],v=s._length+n.p+l/2,m=o.anchor===s._id&&(o.mirror||\"top\"===o.side)||\"all\"===o.mirror||\"allticks\"===o.mirror||o.mirrors&&o.mirrors[s._id+\"top\"],y=-n.p-l/2,b=n.p,x=g?0:l,_=m?0:l,w=\",\"+(-b-_)+\"v\"+(s._length+2*b+_+x),k=\"free\"===s.anchor&&-1===a.indexOf(s._id),A=n.w*(s.position||0)+u/2%1,M=s.anchor===o._id&&(s.mirror||\"right\"!==s.side)||\"all\"===s.mirror||\"allticks\"===s.mirror||s.mirrors&&s.mirrors[o._id+\"left\"],L=-n.p-u/2,T=s.anchor===o._id&&(s.mirror||\"right\"===s.side)||\"all\"===s.mirror||\"allticks\"===s.mirror||s.mirrors&&s.mirrors[o._id+\"right\"],E=o._length+n.p+u/2;o._linepositions[e]=[g?v:void 0,m?y:void 0,d?p:void 0],o.anchor===s._id?o._linepositions[e][3]=\"top\"===o.side?y:v:d&&(o._linepositions[e][3]=p),s._linepositions[e]=[M?L:void 0,T?E:void 0,k?A:void 0],s.anchor===o._id?s._linepositions[e][3]=\"right\"===s.side?E:L:k&&(s._linepositions[e][3]=A);var C=\"translate(\"+o._offset+\",\"+s._offset+\")\",S=C,P=C;d&&(S=\"translate(\"+o._offset+\",\"+n.t+\")\",y+=s._offset-n.t,v+=s._offset-n.t),k&&(P=\"translate(\"+n.l+\",\"+s._offset+\")\",L+=o._offset-n.l,E+=o._offset-n.l),i.xlines.attr(\"transform\",S).attr(\"d\",(g?h+v+f:\"\")+(m?h+y+f:\"\")+(d?h+p+f:\"\")||\"M0,0\").style(\"stroke-width\",l+\"px\").call(z.Color.stroke,o.showline?o.linecolor:\"rgba(0,0,0,0)\"),i.ylines.attr(\"transform\",P).attr(\"d\",(M?\"M\"+L+w:\"\")+(T?\"M\"+E+w:\"\")+(k?\"M\"+A+w:\"\")||\"M0,0\").attr(\"stroke-width\",u+\"px\").call(z.Color.stroke,s.showline?s.linecolor:\"rgba(0,0,0,0)\"),i.xaxislayer.attr(\"transform\",S),i.yaxislayer.attr(\"transform\",P),i.gridlayer.attr(\"transform\",C),i.zerolinelayer.attr(\"transform\",C),i.draglayer.attr(\"transform\",C),d&&a.push(o._id),k&&a.push(s._id)}),z.Axes.makeClipPaths(t),z.Titles.draw(t,\"gtitle\"),z.Fx.modeBar(t),t._promises.length&&Promise.all(t._promises)}var z=t(\"../plotly\"),P=t(\"../lib/events\"),j=t(\"d3\"),O=t(\"gl-mat4/fromQuat\"),I=t(\"fast-isnumeric\"),D=z.Plots;z.plot=function(t,e,r,i){function h(){var e,r,n,i=t.calcdata;for(z.Legend.draw(t),e=0;e<i.length;e++)r=i[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):D.autoMargin(t,\"cb\"+n.uid);return D.doAutoMargin(t),D.previousPromises(t)}function d(){var e=JSON.stringify(M._size)===S?[]:[h,C];return z.Lib.syncOrAsync(e.concat(z.Fx.init),t)}function p(){if(T){for(var e,r,n=D.getSubplotIds(M,\"cartesian\"),i=t._modules,a=0;a<n.length;a++){e=M._plots[n[a]];for(var o=0;o<i.length;o++)r=i[o],r.setPositions&&r.setPositions(t,e)}return z.Lib.markTime(\"done with bar/box adjustments\"),z.ErrorBars.calc(t),z.Lib.markTime(\"done Plotly.ErrorBars.calc\"),z.Lib.syncOrAsync([z.Shapes.calcAutorange,z.Annotations.calcAutorange,v],t)}}function v(){for(var e=z.Axes.list(t,\"\",!0),r=0;r<e.length;r++)z.Axes.doAutoRange(e[r])}function m(){return z.Axes.doTicks(t,\"redraw\")}function y(){function e(t,e){var r,n,i,a=[];for(r=0;r<t.length;r++)n=t[r],i=n[0].trace,i.xaxis+i.yaxis===e&&a.push(n);return a}function r(t,e){var r,n,i,a=[];for(r=0;r<t.length;r++)n=t[r],i=n[0].trace,i._module===e&&i.visible===!0&&a.push(n);return a}var n,i,a,u,c,h,f,d,p,g,v,m=t.calcdata,y=D.getSubplotIds(M,\"cartesian\"),b=t._modules;for(t._fullLayout._hasGL3D&&o(t),t._fullLayout._hasGeo&&s(t),t._fullLayout._hasGL2D&&l(t),n=0;n<m.length;n++)a=m[n],u=a[0].trace,u.visible===!0&&u._module.colorbar||(c=u.uid,M._paper.selectAll(\".hm\"+c+\",.contour\"+c+\",.cb\"+c+\",#clip\"+c).remove());for(n=0;n<y.length;n++){for(h=y[n],f=t._fullLayout._plots[h],d=e(m,h),p=[],f.plot&&f.plot.selectAll(\"g.trace\").remove(),i=0;i<b.length;i++)v=b[i],v.plot&&(g=r(d,v),v.plot(t,f,g),z.Lib.markTime(\"done \"+(g[0]&&g[0][0].trace.type)),g[0]&&g[0][0].trace&&D.traceIs(g[0][0].trace,\"errorBarsOK\")&&(p=p.concat(g)));t._fullLayout._hasCartesian&&(z.ErrorBars.plot(t,f,p),z.Lib.markTime(\"done ErrorBars\"))}var x=r(m,z.Pie);return x.length&&z.Pie.plot(t,x),D.style(t),z.Lib.markTime(\"done plots.style\"),z.Shapes.drawAll(t),z.Annotations.drawAll(t),D.addLinks(t),D.previousPromises(t)}function b(){t._replotting=!1,z.Lib.markTime(\"done plot\"),t.emit(\"plotly_afterplot\")}z.Lib.markTime(\"in plot\"),t=n(t),P.init(t);var x=P.triggerHandler(t,\"plotly_beforeplot\",[e,r,i]);if(x!==!1){e||r||z.Lib.isPlotDiv(t)||console.log(\"Warning: calling Plotly.plot as if redrawing but this container doesn't yet have a plot.\",t),a(t,i),r||(r={}),j.select(t).classed(\"js-plotly-plot\",!0),z.Drawing.makeTester(t),t._promises=[];var _=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(f(e,t.data),_?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),(!t.layout||_)&&(t.layout=c(r)),t._dragging)return void(t._replotPending=!0);if(t._replotPending=!1,D.supplyDefaults(t),e&&e[0]&&e[0].r)return u(t,e,r);t._replotting=!0;var w=t._fullData.length>0;if(w){var k=z.Axes.getSubplots(t).join(\"\"),A=Object.keys(t._fullLayout._plots||{}).join(\"\");(t.framework!==L||_||A!==k)&&(t.framework=L,L(t))}else _&&L(t);var M=t._fullLayout,T=!t.calcdata||t.calcdata.length!==(t.data||[]).length;T&&(g(t),(t._context.doubleClick!==!1||t._context.displayModeBar!==!1)&&z.Axes.saveRangeInitial(t));for(var E=0;E<t.calcdata.length;E++)t.calcdata[E][0].trace=t._fullData[E];var S=JSON.stringify(M._size),O=z.Lib.syncOrAsync([D.previousPromises,h,C,d,p,m,y],t,b);return O&&O.then?O:Promise.resolve()}},z.redraw=function(t){return t=n(t),z.Lib.isPlotDiv(t)?(t.calcdata=void 0,z.plot(t).then(function(){t.emit(\"plotly_redraw\")})):void console.log(\"This element is not a Plotly Plot\",t)},z.newPlot=function(t,e,r,i){t=n(t),D.purge(t),z.plot(t,e,r,i)},z.extendTraces=function R(t,e,r,i){t=n(t);var a=w(t,e,r,i,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)});z.redraw(t);var o=[t,a.update,r,a.maxPoints];z.Queue&&z.Queue.add(t,z.prependTraces,o,R,arguments)},z.prependTraces=function F(t,e,r,i){t=n(t);var a=w(t,e,r,i,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)});z.redraw(t);var o=[t,a.update,r,a.maxPoints];z.Queue&&z.Queue.add(t,z.extendTraces,o,F,arguments)},z.addTraces=function N(t,e,r){t=n(t);var i,a=[],o=z.deleteTraces,s=N,l=[t,a],u=[t,e];for(b(t,e,r),Array.isArray(e)||(e=[e]),i=0;i<e.length;i+=1)t.data.push(e[i]);for(i=0;i<e.length;i++)a.push(-e.length+i);if(\"undefined\"==typeof r)return z.redraw(t),void(z.Queue&&z.Queue.add(t,o,l,s,u));Array.isArray(r)||(r=[r]);try{y(t,a,r)}catch(c){throw t.data.splice(t.data.length-e.length,e.length),c}z.Queue&&z.Queue.startSequence(t),z.Queue&&z.Queue.add(t,o,l,s,u),z.moveTraces(t,a,r),z.Queue&&z.Queue.stopSequence(t)},z.deleteTraces=function B(t,e){t=n(t);var r,i,a=[],o=z.addTraces,s=B,l=[t,a,e],u=[t,e];if(\"undefined\"==typeof e)throw new Error(\"indices must be an integer or array of integers.\");for(Array.isArray(e)||(e=[e]),m(t,e,\"indices\"),e=v(e,t.data.length-1),e.sort().reverse(),r=0;r<e.length;r+=1)i=t.data.splice(e[r],1)[0],a.push(i);z.redraw(t),z.Queue&&z.Queue.add(t,o,l,s,u)},z.moveTraces=function U(t,e,r){t=n(t);var i,a=[],o=[],s=U,l=U,u=[t,r,e],c=[t,e,r];if(y(t,e,r),e=Array.isArray(e)?e:[e],\"undefined\"==typeof r)for(r=[],i=0;i<e.length;i++)r.push(-e.length+i);for(r=Array.isArray(r)?r:[r],e=v(e,t.data.length-1),r=v(r,t.data.length-1),i=0;i<t.data.length;i++)-1===e.indexOf(i)&&a.push(t.data[i]);for(i=0;i<e.length;i++)o.push({newIndex:r[i],trace:t.data[e[i]]});for(o.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<o.length;i+=1)a.splice(o[i].newIndex,0,o[i].trace);t.data=a,z.redraw(t),z.Queue&&z.Queue.add(t,s,u,l,c)},z.restyle=function V(t,e,r,i){function a(){return i.map(function(){return void 0})}function o(t){var e=z.Axes.id2name(t);-1===p.indexOf(e)&&p.push(e)}function s(t){return\"LAYOUT\"+t+\".autorange\"}function l(t){return\"LAYOUT\"+t+\".range\"}function u(e,r,n){if(Array.isArray(e))return void e.forEach(function(t){u(t,r,n)});if(!(e in f)){var o;o=\"LAYOUT\"===e.substr(0,6)?z.Lib.nestedProperty(t.layout,e.replace(\"LAYOUT\",\"\")):z.Lib.nestedProperty(t.data[i[n]],e),e in L||(L[e]=a()),void 0===L[e][n]&&(L[e][n]=o.get()),void 0!==r&&o.set(r)}}t=n(t);var c,h=t._fullLayout,f={};if(\"string\"==typeof e)f[e]=r;else{if(!z.Lib.isPlainObject(e))return void console.log(\"restyle fail\",e,r,i);f=e,void 0===i&&(i=r)}Object.keys(f).length&&(t.changed=!0),I(i)?i=[i]:Array.isArray(i)&&i.length||(i=t._fullData.map(function(t,e){return e}));var d=[\"mode\",\"visible\",\"type\",\"orientation\",\"fill\",\"histfunc\",\"histnorm\",\"text\",\"x\",\"y\",\"z\",\"xtype\",\"x0\",\"dx\",\"ytype\",\"y0\",\"dy\",\"xaxis\",\"yaxis\",\"line.width\",\"connectgaps\",\"transpose\",\"zsmooth\",\"showscale\",\"marker.showscale\",\"zauto\",\"marker.cauto\",\"autocolorscale\",\"marker.autocolorscale\",\"colorscale\",\"marker.colorscale\",\"reversescale\",\"marker.reversescale\",\"autobinx\",\"nbinsx\",\"xbins\",\"xbins.start\",\"xbins.end\",\"xbins.size\",\"autobiny\",\"nbinsy\",\"ybins\",\"ybins.start\",\"ybins.end\",\"ybins.size\",\"autocontour\",\"ncontours\",\"contours\",\"contours.coloring\",\"error_y\",\"error_y.visible\",\"error_y.value\",\"error_y.type\",\"error_y.traceref\",\"error_y.array\",\"error_y.symmetric\",\"error_y.arrayminus\",\"error_y.valueminus\",\"error_y.tracerefminus\",\"error_x\",\"error_x.visible\",\"error_x.value\",\"error_x.type\",\"error_x.traceref\",\"error_x.array\",\"error_x.symmetric\",\"error_x.arrayminus\",\"error_x.valueminus\",\"error_x.tracerefminus\",\"swapxy\",\"swapxyaxes\",\"orientationaxes\",\"marker.colors\",\"values\",\"labels\",\"label0\",\"dlabel\",\"sort\",\"textinfo\",\"textposition\",\"textfont.size\",\"textfont.family\",\"textfont.color\",\"insidetextfont.size\",\"insidetextfont.family\",\"insidetextfont.color\",\"outsidetextfont.size\",\"outsidetextfont.family\",\"outsidetextfont.color\",\"hole\",\"scalegroup\",\"domain\",\"domain.x\",\"domain.y\",\"domain.x[0]\",\"domain.x[1]\",\"domain.y[0]\",\"domain.y[1]\",\"tilt\",\"tiltaxis\",\"depth\",\"direction\",\"rotation\",\"pull\"];for(c=0;c<i.length;c++)if(D.traceIs(t._fullData[i[c]],\"box\")){d.push(\"name\");break}var p,g=[\"marker\",\"marker.size\",\"textfont\",\"boxpoints\",\"jitter\",\"pointpos\",\"whiskerwidth\",\"boxmean\"],v=[\"zmin\",\"zmax\",\"zauto\",\"marker.cmin\",\"marker.cmax\",\"marker.cauto\",\"contours.start\",\"contours.end\",\"contours.size\",\"contours.showlines\",\"line\",\"line.smoothing\",\"line.shape\",\"error_y.width\",\"error_x.width\",\"error_x.copy_ystyle\",\"marker.maxdisplayed\"],m=[\"type\",\"x\",\"y\",\"x0\",\"y0\",\"orientation\",\"xaxis\",\"yaxis\"],y=!1,b=!1,x=!1,_=!1,w=!1,A=!1,M={},L={},T={};(h._hasGL3D||h._hasGeo||h._hasGL2D)&&(x=!0);var E=[\"zmin\",\"zmax\"],C=[\"xbins.start\",\"xbins.end\",\"xbins.size\"],S=[\"ybins.start\",\"ybins.end\",\"ybins.size\"],P=[\"contours.start\",\"contours.end\",\"contours.size\"];for(var j in f){var O,R,F,N,B,U=f[j];if(M[j]=U,\"LAYOUT\"!==j.substr(0,6)){for(L[j]=a(),c=0;c<i.length;c++){if(O=t.data[i[c]],R=t._fullData[i[c]],F=z.Lib.nestedProperty(O,j),N=F.get(),B=Array.isArray(U)?U[c%U.length]:U,-1!==E.indexOf(j))u(\"zauto\",!1,c);else if(\"colorscale\"===j)u(\"autocolorscale\",!1,c);else if(\"autocolorscale\"===j)u(\"colorscale\",void 0,c);else if(\"marker.colorscale\"===j)u(\"marker.autocolorscale\",!1,c);else if(\"marker.autocolorscale\"===j)u(\"marker.colorscale\",void 0,c);else if(\"zauto\"===j)u(E,void 0,c);else if(-1!==C.indexOf(j))u(\"autobinx\",!1,c);else if(\"autobinx\"===j)u(C,void 0,c);else if(-1!==S.indexOf(j))u(\"autobiny\",!1,c);else if(\"autobiny\"===j)u(S,void 0,c);else if(-1!==P.indexOf(j))u(\"autocontour\",!1,c);else if(\"autocontour\"===j)u(P,void 0,c);else if(-1!==[\"x0\",\"dx\"].indexOf(j)&&R.x&&\"scaled\"!==R.xtype)u(\"xtype\",\"scaled\",c);else if(-1!==[\"y0\",\"dy\"].indexOf(j)&&R.y&&\"scaled\"!==R.ytype)u(\"ytype\",\"scaled\",c);else if(\"colorbar.thicknessmode\"===j&&F.get()!==B&&-1!==[\"fraction\",\"pixels\"].indexOf(B)&&R.colorbar){\n",
"var q=-1!==[\"top\",\"bottom\"].indexOf(R.colorbar.orient)?h.height-h.margin.t-h.margin.b:h.width-h.margin.l-h.margin.r;u(\"colorbar.thickness\",R.colorbar.thickness*(\"fraction\"===B?1/q:q),c)}else if(\"colorbar.lenmode\"===j&&F.get()!==B&&-1!==[\"fraction\",\"pixels\"].indexOf(B)&&R.colorbar){var H=-1!==[\"top\",\"bottom\"].indexOf(R.colorbar.orient)?h.width-h.margin.l-h.margin.r:h.height-h.margin.t-h.margin.b;u(\"colorbar.len\",R.colorbar.len*(\"fraction\"===B?1/H:H),c)}else\"colorbar.tick0\"===j||\"colorbar.dtick\"===j?u(\"colorbar.tickmode\",\"linear\",c):\"colorbar.tickmode\"===j&&u([\"colorbar.tick0\",\"colorbar.dtick\"],void 0,c);if(\"type\"===j&&\"pie\"===B!=(\"pie\"===N)){var G=\"x\",Y=\"y\";\"bar\"!==B&&\"bar\"!==N||\"h\"!==O.orientation||(G=\"y\",Y=\"x\"),z.Lib.swapAttrs(O,[\"?\",\"?src\"],\"labels\",G),z.Lib.swapAttrs(O,[\"d?\",\"?0\"],\"label\",G),z.Lib.swapAttrs(O,[\"?\",\"?src\"],\"values\",Y),\"pie\"===N?(z.Lib.nestedProperty(O,\"marker.color\").set(z.Lib.nestedProperty(O,\"marker.colors\").get()),h._pielayer.selectAll(\"g.trace\").remove()):D.traceIs(O,\"cartesian\")&&(z.Lib.nestedProperty(O,\"marker.colors\").set(z.Lib.nestedProperty(O,\"marker.color\").get()),T[O.xaxis||\"x\"]=!0,T[O.yaxis||\"y\"]=!0)}L[j][c]=N;var W=[\"swapxy\",\"swapxyaxes\",\"orientation\",\"orientationaxes\"];if(-1!==W.indexOf(j)){if(\"orientation\"===j){if(F.set(B),F.get()===L[j][c])continue}else\"orientationaxes\"===j&&(O.orientation={v:\"h\",h:\"v\"}[R.orientation]);k(O)}else F.set(B)}if(-1!==[\"swapxyaxes\",\"orientationaxes\"].indexOf(j)&&z.Axes.swap(t,i),\"orientationaxes\"===j){var X=z.Lib.nestedProperty(t.layout,\"hovermode\");\"x\"===X.get()?X.set(\"y\"):\"y\"===X.get()&&X.set(\"x\")}if(-1!==i.indexOf(0)&&-1!==m.indexOf(j)&&(z.Axes.clearTypes(t,i),y=!0),(-1===[\"autobinx\",\"autobiny\",\"zauto\"].indexOf(j)||B!==!1)&&(w=!0),(-1!==[\"colorbar\",\"line\"].indexOf(F.parts[0])||\"marker\"===F.parts[0]&&\"colorbar\"===F.parts[1])&&(A=!0),-1!==d.indexOf(j)){if(-1!==[\"orientation\",\"type\"].indexOf(j)){for(p=[],c=0;c<i.length;c++){var Z=t.data[i[c]];D.traceIs(Z,\"cartesian\")&&(o(Z.xaxis||\"x\"),o(Z.yaxis||\"y\"),\"type\"===e&&u([\"autobinx\",\"autobiny\"],!0,c))}u(p.map(s),!0,0),u(p.map(l),[0,1],0)}y=!0}else-1!==v.indexOf(j)?x=!0:-1!==g.indexOf(j)&&(b=!0)}else F=z.Lib.nestedProperty(t.layout,j.replace(\"LAYOUT\",\"\")),L[j]=[F.get()],F.set(Array.isArray(U)?U[0]:U),y=!0}var Q=Object.keys(T);t:for(c=0;c<Q.length;c++){for(var $=Q[c],K=$.charAt(0),J=K+\"axis\",tt=0;tt<t.data.length;tt++)if(D.traceIs(t.data[tt],\"cartesian\")&&(t.data[tt][J]||K)===$)continue t;u(\"LAYOUT\"+z.Axes.id2name($),null,0)}z.Queue&&z.Queue.add(t,V,[t,L,i],V,[t,M,i]);var et=!1;z.Axes.list(t).forEach(function(t){t.autorange&&(et=!0)}),(y||_||b&&et)&&(t.calcdata=void 0);var rt;_?rt=[function(){var e=t.layout;return t.layout=void 0,z.plot(t,\"\",e)}]:y||x||b?rt=[z.plot]:(D.supplyDefaults(t),rt=[D.previousPromises],w&&rt.push(function(){var e,r,n;for(e=0;e<t.calcdata.length;e++)r=t.calcdata[e],n=(((r[0]||{}).trace||{})._module||{}).arraysToCalcdata,n&&n(r);return D.style(t),z.Legend.draw(t),D.previousPromises(t)}),A&&rt.push(function(){return t.calcdata.forEach(function(t){if((t[0].t||{}).cb){var e=t[0].trace,r=t[0].t.cb;D.traceIs(e,\"contour\")&&r.line({width:e.contours.showlines!==!1?e.line.width:0,dash:e.line.dash,color:\"line\"===e.contours.coloring?r._opts.line.color:e.line.color}),D.traceIs(e,\"markerColorscale\")?r.options(e.marker.colorbar)():r.options(e.colorbar)()}}),D.previousPromises(t)}));var nt=z.Lib.syncOrAsync(rt,t);return nt&&nt.then||(nt=Promise.resolve()),nt.then(function(){t.emit(\"plotly_restyle\",z.Lib.extendDeep([],[M,i]))})},z.relayout=function q(t,e,r){function i(t,e){if(Array.isArray(t))return void t.forEach(function(t){i(t,e)});if(!(t in p)){var r=z.Lib.nestedProperty(f,t);t in L||(L[t]=r.get()),void 0!==e&&r.set(e)}}function a(t,e){var r=z.Axes.id2name(t[e+\"ref\"]||e);return(d[r]||{}).autorange}if(t=n(t),!t.framework||!t.framework.isPolar){var o,s,l,u,c,h,f=t.layout,d=t._fullLayout,p={},g=!1,v=!1,m=!1,y=!1,b=!1,x=!1,_=!1;if(\"string\"==typeof e)p[e]=r;else{if(!z.Lib.isPlainObject(e))return void console.log(\"relayout fail\",e,r);p=e}Object.keys(p).length&&(t.changed=!0),l=Object.keys(p),s=z.Axes.list(t);for(var w=0;w<l.length;w++){if(0===l[w].indexOf(\"allaxes\")){for(var k=0;k<s.length;k++)c=s[k]._id.substr(1),h=-1!==c.indexOf(\"scene\")?c+\".\":\"\",o=l[w].replace(\"allaxes\",h+s[k]._name),p[o]||(p[o]=p[l[w]]);delete p[l[w]]}l[w].match(/^annotations\\[[0-9-]+\\].ref$/)&&(u=p[l[w]].split(\"y\"),p[l[w].replace(\"ref\",\"xref\")]=u[0],p[l[w].replace(\"ref\",\"yref\")]=2===u.length?\"y\"+u[1]:\"paper\",delete p[l[w]])}var A={},L={},T=[\"height\",\"width\"];for(var E in p){var S=z.Lib.nestedProperty(f,E),P=p[E],j=S.parts.length,O=\"string\"==typeof S.parts[j-1]?j-1:j-2,I=S.parts[O],R=S.parts[O-1]+\".\"+I,F=S.parts.slice(0,O).join(\".\"),N=z.Lib.nestedProperty(t.layout,F).get(),B=z.Lib.nestedProperty(d,F).get();if(A[E]=P,L[E]=\"reverse\"===I?P:S.get(),-1!==T.indexOf(E)?i(\"autosize\",!1):\"autosize\"===E?i(T,void 0):R.match(/^[xyz]axis[0-9]*\\.range(\\[[0|1]\\])?$/)?i(F+\".autorange\",!1):R.match(/^[xyz]axis[0-9]*\\.autorange$/)?i([F+\".range[0]\",F+\".range[1]\"],void 0):R.match(/^aspectratio\\.[xyz]$/)?i(S.parts[0]+\".aspectmode\",\"manual\"):R.match(/^aspectmode$/)?i([F+\".x\",F+\".y\",F+\".z\"],void 0):\"tick0\"===I||\"dtick\"===I?i(F+\".tickmode\",\"linear\"):\"tickmode\"===I&&i([F+\".tick0\",F+\".dtick\"],void 0),\"type\"===I&&\"log\"===B.type!=(\"log\"===P)){var U=N;if(U&&U.range)if(B.autorange)\"log\"===P&&(U.range=U.range[1]>U.range[0]?[1,2]:[2,1]);else{var V=U.range[0],H=U.range[1];\"log\"===P?(0>=V&&0>=H&&i(F+\".autorange\",!0),0>=V?V=H/1e6:0>=H&&(H=V/1e6),i(F+\".range[0]\",Math.log(V)/Math.LN10),i(F+\".range[1]\",Math.log(H)/Math.LN10)):(i(F+\".range[0]\",Math.pow(10,V)),i(F+\".range[1]\",Math.pow(10,H)))}else i(F+\".autorange\",!0)}if(\"reverse\"===I)N.range?N.range.reverse():(i(F+\".autorange\",!0),N.range=[1,0]),B.autorange?b=!0:y=!0;else if(\"annotations\"===S.parts[0]||\"shapes\"===S.parts[0]){var G=S.parts[1],Y=S.parts[0],W=f[Y]||[],X=z[z.Lib.titleCase(Y)],Z=W[G]||{};2===S.parts.length&&(\"add\"===p[E]||z.Lib.isPlainObject(p[E])?L[E]=\"remove\":\"remove\"===p[E]?-1===G?(L[Y]=W,delete L[E]):L[E]=Z:console.log(\"???\",p)),!a(Z,\"x\")&&!a(Z,\"y\")||z.Lib.containsAny(E,[\"color\",\"opacity\",\"align\",\"dash\"])||(b=!0),X.draw(t,G,S.parts.slice(2).join(\".\"),p[E]),delete p[E]}else 0===S.parts[0].indexOf(\"scene\")?y=!0:0===S.parts[0].indexOf(\"geo\")?y=!0:!d._hasGL2D||-1===E.indexOf(\"axis\")&&\"plot_bgcolor\"!==S.parts[0]?\"hiddenlabels\"===E?b=!0:-1!==S.parts[0].indexOf(\"legend\")?g=!0:-1!==E.indexOf(\"title\")?v=!0:-1!==S.parts[0].indexOf(\"bgcolor\")?m=!0:S.parts.length>1&&z.Lib.containsAny(S.parts[1],[\"tick\",\"exponent\",\"grid\",\"zeroline\"])?v=!0:-1!==E.indexOf(\".linewidth\")&&-1!==E.indexOf(\"axis\")?v=m=!0:S.parts.length>1&&-1!==S.parts[1].indexOf(\"line\")?m=!0:S.parts.length>1&&\"mirror\"===S.parts[1]?v=m=!0:\"margin.pad\"===E?v=m=!0:\"margin\"===S.parts[0]||\"autorange\"===S.parts[1]||\"rangemode\"===S.parts[1]||\"type\"===S.parts[1]||\"domain\"===S.parts[1]||E.match(/^(bar|box|font)/)?b=!0:\"hovermode\"===E?x=!0:\"dragmode\"===E?_=!0:-1===[\"hovermode\",\"dragmode\",\"height\",\"width\",\"autosize\"].indexOf(E)&&(y=!0):y=!0,S.set(P)}z.Queue&&z.Queue.add(t,q,[t,L],q,[t,A]),p.autosize&&(p=M(t,p)),(p.height||p.width||p.autosize)&&(b=!0);var Q=Object.keys(p),$=[D.previousPromises];if(y||b)$.push(function(){return t.layout=void 0,b&&(t.calcdata=void 0),z.plot(t,\"\",f)});else if(Q.length){D.supplyDefaults(t),d=t._fullLayout,g&&$.push(function(){return z.Legend.draw(t),D.previousPromises(t)}),m&&$.push(C),v&&$.push(function(){return z.Axes.doTicks(t,\"redraw\"),z.Titles.draw(t,\"gtitle\"),D.previousPromises(t)}),x&&z.Fx.modeBar(t);var K;if(_||x){for(K=D.getSubplotIds(d,\"gl3d\"),w=0;w<K.length;w++)c=d[K[w]]._scene,c.handleDragmode(d.dragmode);for(K=D.getSubplotIds(d,\"gl2d\"),w=0;w<K.length;w++)c=d._plots[K[w]]._scene2d,c.updateFx(d)}}var J=z.Lib.syncOrAsync($,t);return J&&J.then||(J=Promise.resolve()),J.then(function(){t.emit(\"plotly_relayout\",z.Lib.extendDeep({},A))})}}},{\"../lib/events\":309,\"../plotly\":330,d3:53,\"fast-isnumeric\":58,\"gl-mat4/fromQuat\":75}],327:[function(t,e,r){\"use strict\";function n(t,e){try{t._fullLayout._paper.style(\"background\",e)}catch(r){console.log(r)}}e.exports={staticPlot:!1,editable:!1,autosizable:!1,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:\"reset+autosize\",showTips:!0,showLink:!1,sendData:!0,linkText:\"Edit chart\",showSources:!1,displayModeBar:\"hover\",displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:\"https://cdn.plot.ly/\"}},{}],328:[function(t,e,r){\"use strict\";function n(t){var e=g.Plots.attributes,r=l({type:t}),n=c(t),i=f(t),a={},h={};a.type=null,m(a,e),a=o(r.attributes,a,\"attributes\",t),void 0!==i.attributes&&m(a,i.attributes),a.type=t,a=u(a),s(a),M.traces[t]=v({},n,{attributes:a}),void 0!==r.layoutAttributes&&(h=o(r.layoutAttributes,h,\"layoutAttributes\",t),s(h),M.traces[t].layoutAttributes=h)}function i(){var t=g.Plots.layoutAttributes,e={};e=o(t,e,\"layoutAttributes\",\"*\"),e=h(e),e=d(e),e=u(e),s(e),e=p(e),M.layout={layoutAttributes:e}}function a(){M.defs={valObjects:g.Lib.valObjects,metaKeys:A.concat([\"description\",\"role\"])}}function o(t,e,r,n){var i,a,s,u,c;return Object.keys(t).forEach(function(h){return h===b?void Object.keys(t[h]).forEach(function(u){i=l({module:t[h][u]}),void 0!==i&&(a=i[r],s=o(a,{},r,n),g.Lib.nestedProperty(e,u).set(m({},s)))}):h===x?void Object.keys(t[h]).forEach(function(i){i===n&&(u=l({module:t[h][i]}),void 0!==u&&(c=u[r],c=o(c,{},r,n),y(e,c)))}):void(e[h]=g.Lib.isPlainObject(t[h])?y({},t[h]):t[h])}),e}function s(t){function e(t){return{valType:\"string\"}}function r(t,r,n){E.isValObject(t)?\"data_array\"===t.valType?(t.role=\"data\",n[r+\"src\"]=e(r)):t.arrayOk===!0&&(n[r+\"src\"]=e(r)):g.Lib.isPlainObject(t)&&(t.role=\"object\")}E.crawl(t,r)}function l(t){return\"type\"in t?\"area\"===t.type?{attributes:L}:g.Plots.getModule({type:t.type}):\"module\"in t?g[t.module]:void 0}function u(t){return Object.keys(t).forEach(function(e){\"_\"===e.charAt(0)&&-1===A.indexOf(e)&&delete t[e]}),t}function c(t){return\"area\"===t?{}:g.Plots.modules[t].meta||{}}function h(t){return v(t,{radialaxis:T.radialaxis,angularaxis:T.angularaxis}),v(t,T.layout),t}function f(t){var e=g.Plots.subplotsRegistry,r=Object.keys(e).filter(function(e){return g.Plots.traceIs({type:t},e)})[0];return\"area\"===t?{}:void 0===r?{}:e[r]}function d(t){var e=g.Plots.subplotsRegistry;return Object.keys(t).forEach(function(r){Object.keys(e).forEach(function(n){var i,a=e[n];i=\"cartesian\"===n?a.attrRegex.x.test(r)||a.attrRegex.y.test(r):a.attrRegex.test(r),i&&(t[r][_]=!0)})}),t}function p(t){return Object.keys(t).forEach(function(e){var r=m({},t[e]);if(r[w]===!0){var n=e.substr(0,e.length-1);delete r[w],t[e]={items:{}},t[e].items[n]=r,t[e].role=\"object\"}}),t}var g=t(\"../plotly\"),v=g.Lib.extendFlat,m=g.Lib.extendDeep,y=g.Lib.extendDeepAll,b=\"_nestedModules\",x=\"_composedModules\",_=\"_isSubplotObj\",w=\"_isLinkedToArray\",k=\"_deprecated\",A=[_,w,k],M={traces:{},layout:{},defs:{}},L=t(\"../plots/polar/area_attributes\"),T=t(\"../plots/polar/axis_attributes\"),E=e.exports={};E.get=function(){return g.Plots.allTypes.concat(\"area\").forEach(n),i(),a(),M},E.crawl=function(t,e){Object.keys(t).forEach(function(r){var n=t[r];-1===A.indexOf(r)&&(e(n,r,t),E.isValObject(n)||g.Lib.isPlainObject(n)&&E.crawl(n,e))})},E.isValObject=function(t){return t&&void 0!==t.valType}},{\"../plotly\":330,\"../plots/polar/area_attributes\":365,\"../plots/polar/axis_attributes\":366}],329:[function(t,e,r){\"use strict\";var n=t(\"../plotly\");e.exports=function(t){return n.Lib.extendFlat(n.defaultConfig,t)}},{\"../plotly\":330}],330:[function(t,e,r){t(\"es6-promise\").polyfill(),r.Lib=t(\"./lib\"),r.util=t(\"./lib/svg_text_utils\"),r.Queue=t(\"./lib/queue\"),r.Icons=t(\"../build/ploticon\"),t(\"../build/plotcss\"),r.MathJaxConfig=t(\"./fonts/mathjax_config\"),r.defaultConfig=t(\"./plot_api/plot_config\"),r.Plots=t(\"./plots/plots\"),r.Axes=t(\"./plots/cartesian/axes\"),r.Fx=t(\"./plots/cartesian/graph_interact\"),r.Scene=t(\"./plots/gl3d/scene\"),r.Gl3dLayout=t(\"./plots/gl3d/layout\"),r.Geo=t(\"./plots/geo/geo\"),r.GeoLayout=t(\"./plots/geo/layout\"),r.Scene2D=t(\"./plots/gl2d/scene2d\"),r.micropolar=t(\"./plots/polar/micropolar\"),r.Color=t(\"./components/color\"),r.Drawing=t(\"./components/drawing\"),r.Colorscale=t(\"./components/colorscale\"),r.Colorbar=t(\"./components/colorbar\"),r.ErrorBars=t(\"./components/errorbars\"),r.Annotations=t(\"./components/annotations\"),r.Shapes=t(\"./components/shapes\"),r.Titles=t(\"./components/titles\"),r.Legend=t(\"./components/legend\"),r.ModeBar=t(\"./components/modebar\"),r.Scatter=t(\"./traces/scatter\"),r.Bars=t(\"./traces/bars\"),r.Boxes=t(\"./traces/boxes\"),r.Heatmap=t(\"./traces/heatmap\"),r.Histogram=t(\"./traces/histogram\"),r.Pie=t(\"./traces/pie\"),r.Contour=t(\"./traces/contour\"),r.Scatter3D=t(\"./traces/scatter3d\"),r.Surface=t(\"./traces/surface\"),r.Mesh3D=t(\"./traces/mesh3d\"),r.ScatterGeo=t(\"./traces/scattergeo\"),r.Choropleth=t(\"./traces/choropleth\"),r.ScatterGl=t(\"./traces/scattergl\"),t(\"./plot_api/plot_api\"),r.PlotSchema=t(\"./plot_api/plot_schema\"),r.Snapshot=t(\"./snapshot\")},{\"../build/plotcss\":1,\"../build/ploticon\":2,\"./components/annotations\":281,\"./components/color\":283,\"./components/colorbar\":285,\"./components/colorscale\":287,\"./components/drawing\":289,\"./components/errorbars\":292,\"./components/legend\":294,\"./components/modebar\":295,\"./components/shapes\":297,\"./components/titles\":298,\"./fonts/mathjax_config\":304,\"./lib\":314,\"./lib/queue\":319,\"./lib/svg_text_utils\":324,\"./plot_api/plot_api\":326,\"./plot_api/plot_config\":327,\"./plot_api/plot_schema\":328,\"./plots/cartesian/axes\":333,\"./plots/cartesian/graph_interact\":334,\"./plots/geo/geo\":337,\"./plots/geo/layout\":342,\"./plots/gl2d/scene2d\":350,\"./plots/gl3d/layout\":357,\"./plots/gl3d/scene\":362,\"./plots/plots\":364,\"./plots/polar/micropolar\":367,\"./snapshot\":371,\"./traces/bars\":376,\"./traces/boxes\":379,\"./traces/choropleth\":383,\"./traces/contour\":386,\"./traces/heatmap\":388,\"./traces/histogram\":390,\"./traces/mesh3d\":394,\"./traces/pie\":396,\"./traces/scatter\":398,\"./traces/scatter3d\":403,\"./traces/scattergeo\":406,\"./traces/scattergl\":411,\"./traces/surface\":415,\"es6-promise\":56}],331:[function(t,e,r){e.exports={type:{valType:\"enumerated\",values:[],dflt:\"scatter\"},visible:{valType:\"enumerated\",values:[!0,!1,\"legendonly\"],dflt:!0},showlegend:{valType:\"boolean\",dflt:!0},legendgroup:{valType:\"string\",dflt:\"\"},opacity:{valType:\"number\",min:0,max:1,dflt:1},name:{valType:\"string\"},uid:{valType:\"string\",dflt:\"\"},hoverinfo:{valType:\"flaglist\",flags:[\"x\",\"y\",\"z\",\"text\",\"name\"],extras:[\"all\",\"none\"],dflt:\"all\"},stream:{token:{valType:\"string\",noBlank:!0,strict:!0},maxpoints:{valType:\"number\",min:0}}}},{}],332:[function(t,e,r){e.exports={xaxis:{valType:\"axisid\",dflt:\"x\"},yaxis:{valType:\"axisid\",dflt:\"y\"}}},{}],333:[function(t,e,r){\"use strict\";function n(t,e){if(\"-\"===t.type){var r=t._id,n=r.charAt(0);-1!==r.indexOf(\"scene\")&&(r=n);var s=o(e,r,n);if(s){if(\"histogram\"===s.type&&n==={v:\"y\",h:\"x\"}[s.orientation||\"v\"])return void(t.type=\"linear\");if(a(s,n)){for(var l,u=i(s),c=[],h=0;h<e.length;h++)l=e[h],M.Plots.traceIs(l,\"box\")&&(l[n+\"axis\"]||n)===r&&(void 0!==l[u]?c.push(l[u][0]):void 0!==l.name?c.push(l.name):c.push(\"text\"));t.type=E.autoType(c)}else t.type=E.autoType(s[n]||[s[n+\"0\"]])}}}function i(t){return{v:\"x\",h:\"y\"}[t.orientation||\"v\"]}function a(t,e){var r=i(t);return M.Plots.traceIs(t,\"box\")&&e===r&&void 0===t[r]&&void 0===t[r+\"0\"]}function o(t,e,r){for(var n,i=0;i<t.length;i++)if(n=t[i],(n[r+\"axis\"]||r)===e){if(a(n,r))return n;if((n[r]||[]).length||n[r+\"0\"])return n}}function s(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(T(t[e]))return!0;return!1}function l(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=1.0001*t.range[0]-1e-4*t.range[1],s=1.0001*t.range[1]-1e-4*t.range[0],l=Math.min(o,s),u=Math.max(o,s),c=0;for(Array.isArray(i)||(i=[]),r=0;r<n.length;r++)e=t.d2l(n[r]),e>l&&u>e&&(void 0===i[r]?a[c]=E.tickText(t,e):a[c]=f(t,e,String(i[r])),c++);return c<n.length&&a.splice(c,n.length-c),a}function u(t,e,r){return e*M.Lib.roundUp(t/e,r)}function c(t){var e,r=t.dtick;if(t._tickexponent=0,T(r)||\"string\"==typeof r||(r=1),\"category\"===t.type)t._tickround=null;else if(T(r)||\"L\"===r.charAt(0))if(\"date\"===t.type)r>=864e5?t._tickround=\"d\":r>=36e5?t._tickround=\"H\":r>=6e4?t._tickround=\"M\":r>=1e3?t._tickround=\"S\":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{T(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e=\"log\"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&(\"SI\"===t.exponentformat||\"B\"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else\"M\"===r.charAt(0)?t._tickround=2===r.length?\"m\":\"y\":t._tickround=null}function h(t,e){var r=t.match(Y),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),a=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,\"\")||\"0\";return L.time.format(t.replace(Y,a))(n)}return L.time.format(t)(n)}function f(t,e,r){var n=t.tickfont||t._td._fullLayout.font;return{x:e,dx:0,dy:0,text:r||\"\",fontSize:n.size,font:n.family,fontColor:n.color}}function d(t,e,r,n){var i,a=e.x,o=t._tickround,s=new Date(a),l=\"\";r&&t.hoverformat?i=h(t.hoverformat,a):t.tickformat?i=h(t.tickformat,a):(n&&(T(o)?o+=2:o={y:\"m\",m:\"d\",d:\"H\",H:\"M\",M:\"S\",S:2}[o]),\"y\"===o?i=B(s):\"m\"===o?i=U(s):(a!==t._tmin||r||(l=\"<br>\"+B(s)),\"d\"===o?i=V(s):\"H\"===o?i=q(s):(a!==t._tmin||r||(l=\"<br>\"+V(s)+\", \"+B(s)),i=H(s),\"M\"!==o&&(i+=G(s),\"S\"!==o&&(i+=m(A(a/1e3,1),t,\"none\",r).substr(1)))))),e.text=i+l}function p(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=m(Math.pow(10,o),t,i,n);else if(T(a)||\"D\"===a.charAt(0)&&A(o+.01,1)<.1)if(-1!==[\"e\",\"E\",\"power\"].indexOf(t.exponentformat)){var s=Math.round(o);0===s?e.text=1:1===s?e.text=\"10\":s>1?e.text=\"10<sup>\"+s+\"</sup>\":e.text=\"10<sup>\\u2212\"+-s+\"</sup>\",e.fontSize*=1.25}else e.text=m(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,A(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*(0>o?.5:.25)))}}function g(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=\"\"),e.text=String(r)}function v(t,e,r,n,i){\"all\"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i=\"hide\"),e.text=m(e.x,t,i,n)}function m(t,e,r,n){var i=0>t,a=e._tickround,o=r||e.exponentformat||\"B\",s=e._tickexponent,l=e.tickformat;if(n){var u={exponentformat:e.exponentformat,dtick:\"none\"===e.showexponent?e.dtick:T(t)?Math.abs(t)||1:1,range:\"none\"===e.showexponent?e.range:[0,t||1]};c(u),a=(Number(u._tickround)||0)+4,s=u._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return L.format(l)(t).replace(/-/g,\"\\u2212\");var h=Math.pow(10,-a)/2;if(\"none\"===o&&(s=0),t=Math.abs(t),h>t)t=\"0\",i=!1;else{if(t+=h,s&&(t*=Math.pow(10,-s),a+=s),0===a)t=String(Math.floor(t));else if(0>a){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var f=a;0>f;f++)t+=\"0\"}else{t=String(t);var d=t.indexOf(\".\")+1;d&&(t=t.substr(0,d+a).replace(/\\.?0+$/,\"\"))}t=y(t,e._td._fullLayout.separators)}if(s&&\"hide\"!==o){var p;p=0>s?\"\\u2212\"+-s:\"power\"!==o?\"+\"+s:String(s),\"e\"===o||(\"SI\"===o||\"B\"===o)&&(s>12||-15>s)?t+=\"e\"+p:\"E\"===o?t+=\"E\"+p:\"power\"===o?t+=\"&times;10<sup>\"+p+\"</sup>\":\"B\"===o&&9===s?t+=\"B\":(\"SI\"===o||\"B\"===o)&&(t+=W[s/3+5])}return i?\"\\u2212\"+t:t}function y(t,e){var r=e.charAt(0),n=e.charAt(1),i=t.split(\".\"),a=i[0],o=i.length>1?r+i[1]:\"\";if(n&&(i.length>1||a.length>4))for(;X.test(a);)a=a.replace(X,\"$1\"+n+\"$2\");return a+o}function b(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o<n.length;o++){var s=n[o];e&&s.charAt(0)!==e||i.test(s)&&a.push(r+s)}return a.sort()}var i=t._fullLayout;if(!i)return[];var a=n(i,\"\");if(r)return a;for(var o=M.Plots.getSubplotIds(i,\"gl3d\")||[],s=0;s<o.length;s++){var l=o[s];a=a.concat(n(i[l],l+\".\"))}return a}function x(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)(-1!==i[n].x.indexOf(o)||-1!==i[n].y.indexOf(s))&&a.push(n);if(a.length){var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],_(u.x,l.x),_(u.y,l.y);_(u.x,[o]),_(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}function _(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function w(t,e,r){var n,i,a=[],o=[],s=t.layout;for(n=0;n<e.length;n++)a.push(E.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(E.getFromId(t,r[n]));var l=Object.keys(a[0]),u=[\"anchor\",\"domain\",\"overlaying\",\"position\",\"side\",\"tickangle\"],c=[\"linear\",\"log\"];for(n=0;n<l.length;n++){var h=l[n],f=a[0][h],d=o[0][h],p=!0,g=!1,v=!1;if(\"_\"!==h.charAt(0)&&\"function\"!=typeof f&&-1===u.indexOf(h)){for(i=1;i<a.length&&p;i++){var m=a[i][h];\"type\"===h&&-1!==c.indexOf(f)&&-1!==c.indexOf(m)&&f!==m?g=!0:m!==f&&(p=!1)}for(i=1;i<o.length&&p;i++){var y=o[i][h];\"type\"===h&&-1!==c.indexOf(d)&&-1!==c.indexOf(y)&&d!==y?v=!0:o[i][h]!==d&&(p=!1)}p&&(g&&(s[a[0]._name].type=\"linear\"),v&&(s[o[0]._name].type=\"linear\"),k(s,h,a,o))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];-1!==e.indexOf(b.xref)&&-1!==r.indexOf(b.yref)&&M.Lib.swapAttrs(s.annotations[n],[\"?\"])}}function k(t,e,r,n){var i,a=M.Lib.nestedProperty,o=a(t[r[0]._name],e).get(),s=a(t[n[0]._name],e).get();for(\"title\"===e&&(\"Click to enter X axis title\"===o&&(o=\"Click to enter Y axis title\"),\"Click to enter Y axis title\"===s&&(s=\"Click to enter X axis title\")),i=0;i<r.length;i++)a(t,r[i]._name+\".\"+e).set(s);for(i=0;i<n.length;i++)a(t,n[i]._name+\".\"+e).set(o)}function A(t,e){return(t%e+e)%e}var M=t(\"../../plotly\"),L=t(\"d3\"),T=t(\"fast-isnumeric\"),E=e.exports={};E.attributes=t(\"./attributes\"),M.Plots.registerSubplot(\"cartesian\",[\"xaxis\",\"yaxis\"],[\"x\",\"y\"],E.attributes),E.layoutAttributes=t(\"./layout_attributes\");var C=/^xaxis[0-9]*$/,S=/^yaxis[0-9]*$/;E.supplyLayoutDefaults=function(t,e,r){function n(t,e){var r=Number(t.substr(5)||1),n=Number(e.substr(5)||1);return r-n}var i,a=Object.keys(t),o=[],s=[],l={},u={};for(i=0;i<a.length;i++){var c=a[i];C.test(c)?o.push(c):S.test(c)&&s.push(c)}for(i=0;i<r.length;i++){var h=r[i],f=E.id2name(h.xaxis),d=E.id2name(h.yaxis);if(f&&-1===o.indexOf(f)&&o.push(f),d&&-1===s.indexOf(d)&&s.push(d),M.Plots.traceIs(h,\"2dMap\")&&(l[f]=!0,l[d]=!0),M.Plots.traceIs(h,\"oriented\")){var p=\"h\"===h.orientation?d:f;u[p]=!0}}(e._hasCartesian||e._hasGL2D||!r.length)&&(o.length?o.sort(n):o=[\"xaxis\"],s.length?s.sort(n):s=[\"yaxis\"]),o.concat(s).forEach(function(n){function i(t,e){return M.Lib.coerce(c,h,E.layoutAttributes,t,e)}var a=n.charAt(0),c=t[n]||{},h={},f={letter:a,font:e.font,outerTicks:l[n],showGrid:!u[n],name:n,data:r},d={letter:a,counterAxes:{x:s,y:o}[a].map(E.name2id),overlayableAxes:{x:o,y:s}[a].filter(function(e){return e!==n&&!(t[e]||{}).overlaying}).map(E.name2id)};E.handleAxisDefaults(c,h,i,f),E.handleAxisPositioningDefaults(c,h,i,d),e[n]=h,t[n]||\"-\"===c.type||(t[n]={type:c.type})}),o.length&&s.length&&M.Lib.coerce(t,e,M.Plots.layoutAttributes,\"plot_bgcolor\")},E.handleAxisDefaults=function(t,e,r,i){var a=i.letter,o=i.font||{},s=\"Click to enter \"+(i.title||a.toUpperCase()+\" axis\")+\" title\";i.name&&(e._name=i.name,e._id=E.name2id(i.name));var l=r(\"type\");\"-\"===l&&(n(e,i.data),\"-\"===e.type?e.type=\"linear\":l=t.type=e.type),E.setConvert(e),r(\"title\",s),M.Lib.coerceFont(r,\"titlefont\",{family:o.family,size:Math.round(1.2*o.size),color:o.color});var u=2===(t.range||[]).length&&T(t.range[0])&&T(t.range[1]),c=r(\"autorange\",!u);c&&r(\"rangemode\");var h=r(\"range\",[-1,\"x\"===a?6:4]);h[0]===h[1]&&(e.range=[h[0]-1,h[0]+1]),M.Lib.noneOrAll(t.range,e.range,[0,1]),r(\"fixedrange\"),E.handleTickValueDefaults(t,e,r,l),E.handleTickDefaults(t,e,r,l,i);var f=M.Lib.coerce2(t,e,E.layoutAttributes,\"linecolor\"),d=M.Lib.coerce2(t,e,E.layoutAttributes,\"linewidth\"),p=r(\"showline\",!!f||!!d);p||(delete e.linecolor,delete e.linewidth),(p||e.ticks)&&r(\"mirror\");var g=M.Lib.coerce2(t,e,E.layoutAttributes,\"gridcolor\"),v=M.Lib.coerce2(t,e,E.layoutAttributes,\"gridwidth\"),m=r(\"showgrid\",i.showGrid||!!g||!!v);m||(delete e.gridcolor,delete e.gridwidth);var y=M.Lib.coerce2(t,e,E.layoutAttributes,\"zerolinecolor\"),b=M.Lib.coerce2(t,e,E.layoutAttributes,\"zerolinewidth\"),x=r(\"zeroline\",i.showGrid||!!y||!!b);return x||(delete e.zerolinecolor,delete e.zerolinewidth),e},E.handleTickDefaults=function(t,e,r,n,i){var a=M.Lib.coerce2(t,e,E.layoutAttributes,\"ticklen\"),o=M.Lib.coerce2(t,e,E.layoutAttributes,\"tickwidth\"),s=M.Lib.coerce2(t,e,E.layoutAttributes,\"tickcolor\"),l=r(\"ticks\",i.outerTicks||a||o||s?\"outside\":\"\");l||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor);var u=r(\"showticklabels\");if(u){M.Lib.coerceFont(r,\"tickfont\",i.font||{}),r(\"tickangle\");var c=E.getShowAttrDflt(t);if(\"category\"!==n){var h=r(\"tickformat\");i.noHover||r(\"hoverformat\"),h||\"date\"===n||(r(\"showexponent\",c),r(\"exponentformat\"))}var f=r(\"tickprefix\");f&&r(\"showtickprefix\",c);var d=r(\"ticksuffix\");d&&r(\"showticksuffix\",c)}},E.handleTickValueDefaults=function(t,e,r,n){var i=\"auto\";\"array\"!==t.tickmode||\"log\"!==n&&\"date\"!==n||(t.tickmode=\"auto\"),Array.isArray(t.tickvals)?i=\"array\":t.dtick&&T(t.dtick)&&(i=\"linear\");var a=r(\"tickmode\",i);if(\"auto\"===a)r(\"nticks\");else if(\"linear\"===a)r(\"tick0\"),r(\"dtick\");else{var o=r(\"tickvals\");void 0===o?e.tickmode=\"auto\":r(\"ticktext\")}},E.handleAxisPositioningDefaults=function(t,e,r,n){var i=n.counterAxes||[],a=n.overlayableAxes||[],o=n.letter,s=M.Lib.coerce(t,e,{anchor:{valType:\"enumerated\",values:[\"free\"].concat(i),dflt:T(t.position)?\"free\":i[0]||\"free\"}},\"anchor\");\"free\"===s&&r(\"position\"),M.Lib.coerce(t,e,{side:{valType:\"enumerated\",values:\"x\"===o?[\"bottom\",\"top\"]:[\"left\",\"right\"],dflt:\"x\"===o?\"bottom\":\"left\"}},\"side\");var l=!1;if(a.length&&(l=M.Lib.coerce(t,e,{overlaying:{valType:\"enumerated\",values:[!1].concat(a),dflt:!1}},\"overlaying\")),!l){var u=r(\"domain\");u[0]>u[1]-.01&&(e.domain=[0,1]),M.Lib.noneOrAll(t.domain,e.domain,[0,1])}return e},E.coerceRef=function(t,e,r,n){var i=r._fullLayout._hasGL2D?[]:E.listIds(r,n),a=n+\"ref\",o={};return o[a]={valType:\"enumerated\",values:i.concat([\"paper\"]),dflt:i[0]||\"paper\"},M.Lib.coerce(t,e,o,a)},E.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(E.getFromId(t,r.xaxis)||{}).type,delete(E.getFromId(t,r.yaxis)||{}).type})};var z=/^[xyz][0-9]*$/,P=/^[xyz]axis[0-9]*$/;E.id2name=function(t){if(\"string\"==typeof t&&t.match(z)){var e=t.substr(1);return\"1\"===e&&(e=\"\"),t.charAt(0)+\"axis\"+e}},E.name2id=function(t){if(t.match(P)){var e=t.substr(5);return\"1\"===e&&(e=\"\"),t.charAt(0)+e}},E.cleanId=function(t,e){if(t.match(z)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,\"\");return\"1\"===r&&(r=\"\"),t.charAt(0)+r}},E.cleanName=function(t,e){if(t.match(z)&&(!e||t.charAt(0)===e)){var r=t.substr(5).replace(/^0+/,\"\");return\"1\"===r&&(r=\"\"),t.charAt(0)+\"axis\"+r}},E.counterLetter=function(t){return{x:\"y\",y:\"x\"}[t.charAt(0)]},E.autoType=function(t){return E.moreDates(t)?\"date\":E.category(t)?\"category\":s(t)?\"linear\":\"-\"},E.getShowAttrDflt=function(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]]};return r.every(n)||1===r.length?t[r[0]]:void 0},E.moreDates=function(t){for(var e,r=0,n=0,i=Math.max(1,(t.length-1)/1e3),a=0;a<t.length;a+=i)e=t[Math.round(a)],M.Lib.isDateTime(e)&&(r+=1),T(e)&&(n+=1);return r>2*n},E.category=function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a<t.length;a+=r)e=E.cleanDatum(t[Math.round(a)]),T(e)?n++:\"string\"==typeof e&&\"\"!==e&&\"None\"!==e&&i++;return i>2*n},E.cleanDatum=function(t){try{if(\"object\"==typeof t&&null!==t&&t.getTime)return M.Lib.ms2DateTime(t);if(\"string\"!=typeof t&&!T(t))return\"\";t=t.toString().replace(/['\"%,$# ]/g,\"\")}catch(e){console.log(e,t)}return t},E.BADNUM=void 0,E.setConvert=function(t){function e(e,r){if(e>0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*i*Math.abs(n-a))}return E.BADNUM}function r(t){return Math.pow(10,t)}function n(t){return T(t)?Number(t):E.BADNUM}var i=10;if(t.c2l=\"log\"===t.type?e:n,t.l2c=\"log\"===t.type?r:n,t.l2d=function(e){return t.c2d(t.l2c(e))},t.setScale=function(){var e,r=t._td._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=E.getFromId(t._td,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)T(t.range[e])||(t.range[e]=T(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if(\"y\"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw M.Lib.notifier(\"Something went wrong with axis scaling\",\"long\"),t._td._replotting=!1,new Error(\"axis scaling\")},t.l2p=function(e){return T(e)?L.round(M.Lib.constrain(t._b+t._m*e,-i*t._length,(1+i)*t._length),2):E.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==[\"linear\",\"log\",\"-\"].indexOf(t.type))t.c2d=n,t.d2c=function(t){return t=E.cleanDatum(t),T(t)?Number(t):E.BADNUM},t.d2l=function(e,r){return\"log\"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if(\"date\"===t.type){if(t.c2d=function(t){return T(t)?M.Lib.ms2DateTime(t):E.BADNUM},t.d2c=function(t){return T(t)?Number(t):M.Lib.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var a=t.range.map(M.Lib.dateTime2ms);!T(t.range[0])&&T(a[0])&&(t.range[0]=a[0]),!T(t.range[1])&&T(a[1])&&(t.range[1]=a[1])}catch(o){console.log(o,t.range)}}else\"category\"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?E.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,a;if(r in e)for(n=e[r],i=new Array(n.length),a=0;a<n.length;a++)i[a]=t.d2c(n[a]);else{var o=r+\"0\"in e?t.d2c(e[r+\"0\"]):0,s=e[\"d\"+r]?Number(e[\"d\"+r]):1;for(n=e[{x:\"y\",y:\"x\"}[r]],i=new Array(n.length),a=0;a<n.length;a++)i[a]=o+a*s}return i},t._min=[],t._max=[],t._minDtick=null,t._forceTick0=null},E.minDtick=function(t,e,r,n){-1===[\"log\",\"category\"].indexOf(t.type)&&n?null===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},E.doAutoRange=function(t){if(t._length||t.setScale(),t.autorange&&t._min&&t._max&&t._min.length&&t._max.length){var e,r=t._min[0].val,n=t._max[0].val;for(e=1;e<t._min.length&&r===n;e++)r=Math.min(r,t._min[e].val);for(e=1;e<t._max.length&&r===n;e++)n=Math.max(n,t._max[e].val);var i,a,o,s,l,u,c,h=0,f=t.range&&t.range[1]<t.range[0];for(\"reversed\"===t.autorange&&(f=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(a=t._min[e],i=0;i<t._max.length;i++)o=t._max[i],c=o.val-a.val,u=t._length-a.pad-o.pad,c>0&&u>0&&c/u>h&&(s=a,l=o,h=c/u);r===n?t.range=f?[r+1,\"normal\"!==t.rangemode?0:r-1]:[\"normal\"!==t.rangemode?0:r-1,r+1]:h&&((\"linear\"===t.type||\"-\"===t.type)&&(\"tozero\"===t.rangemode&&s.val>=0?s={val:0,pad:0}:\"nonnegative\"===t.rangemode&&(s.val-h*s.pad<0&&(s={val:0,pad:0}),l.val<0&&(l={val:1,pad:0})),h=(l.val-s.val)/(t._length-s.pad-l.pad)),t.range=[s.val-h*s.pad,l.val+h*l.pad],t.range[0]===t.range[1]&&(t.range=[t.range[0]-1,t.range[0]+1]),f&&t.range.reverse());var d=t._td.layout[t._name];d||(t._td.layout[t._name]=d={}),d!==t&&(d.range=t.range.slice(),d.autorange=t.autorange)}},E.saveRangeInitial=function(t,e){\n",
"for(var r,n,i,a=E.list(t,\"\",!0),o=!1,s=0;s<a.length;s++)r=a[s],n=void 0===r._rangeInitial,i=n||!(r.range[0]===r._rangeInitial[0]&&r.range[1]===r._rangeInitial[1]),(n&&r.autorange===!1||e&&i)&&(r._rangeInitial=r.range.slice(),o=!0);return o};var j=Number.MAX_VALUE/2;E.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function i(r){function n(t){return T(t)&&Math.abs(t)<j}if(l=e[r],T(l)){if(h=b(r)+m,f=x(r)+m,p=l-w(r),g=l+_(r),\"log\"===t.type&&g/10>p&&(p=g/10),u=t.c2l(p),c=t.c2l(g),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(d=!0,o=0;o<t._min.length&&d;o++)s=t._min[o],s.val<=u&&s.pad>=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<t._max.length&&d;o++)s=t._max[o],s.val>=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&&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,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&(\"linear\"===t.type||\"-\"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(a=0;6>a;a++)i(a);for(a=v-1;a>5;a--)i(a)}},E.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-d)/h.dtick)%100<2}var a=M.Lib.aggNums(Math.min,null,t),o=M.Lib.aggNums(Math.max,null,t);if(\"category\"===e.type)return{start:a-.5,end:o+.5,size:1};var s;if(r)s=(o-a)/r;else{var l=M.Lib.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*M.Lib.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*M.Lib.stdev(t)/Math.pow(t.length,n?.25:.4))}var h={type:\"log\"===e.type?\"linear\":e.type,range:[a,o]};E.autoTicks(h,s);var f,d=E.tickIncrement(E.tickFirst(h),h.dtick,\"reverse\");if(\"number\"==typeof h.dtick){for(var p=0,g=0,v=0,m=0,y=0;y<t.length;y++)t[y]%1===0?v++:T(t[y])||m++,i(t[y])&&p++,i(t[y]+h.dtick/2)&&g++;var b=t.length-m;if(v===b&&\"date\"!==e.type)h.dtick<1?d=a-.5*h.dtick:d-=.5;else if(.1*b>g&&(p>.3*b||i(a)||i(o))){var x=h.dtick/2;d+=a>d+x?x:-x}var _=1+Math.floor((o-d)/h.dtick);f=d+_*h.dtick}else for(f=d;o>=f;)f=E.tickIncrement(f,h.dtick);return{start:d,end:f,size:h.dtick}},E.calcTicks=function(t){if(\"array\"===t.tickmode)return l(t);if(\"auto\"===t.tickmode||!t.dtick){var e,r=t.nticks;r||(\"category\"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e=\"y\"===t._id.charAt(0)?40:80,r=M.Lib.constrain(t._length/e,4,9)+1)),E.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0=\"date\"===t.type?new Date(2e3,0,1).getTime():0),c(t),t._tmin=E.tickFirst(t);var n=t.range[1]<t.range[0],i=[],a=1.0001*t.range[1]-1e-4*t.range[0];\"category\"===t.type&&(a=n?Math.max(-.5,a):Math.min(t._categories.length-.5,a));for(var o=t._tmin;(n?o>=a:a>=o)&&(i.push(o),!(i.length>1e3));o=E.tickIncrement(o,t.dtick,n));t._tmax=i[i.length-1];for(var s=new Array(i.length),u=0;u<i.length;u++)s[u]=E.tickText(t,i[u]);return s};var O=[2,5,10],I=[1,2,3,6,12],D=[1,2,5,10,15,30],R=[1,2,3,7,14],F=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],N=[-.301,0,.301,.699,1];E.autoTicks=function(t,e){var r;if(\"date\"===t.type)t.tick0=new Date(2e3,0,1).getTime(),e>157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=\"M\"+12*u(e,r,O)):e>12096e5?(e/=26298e5,t.dtick=\"M\"+u(e,1,I)):e>432e5?(t.dtick=u(e,864e5,R),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=u(e,36e5,I):e>3e4?t.dtick=u(e,6e4,D):e>500?t.dtick=u(e,1e3,D):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=u(e,r,O));else if(\"log\"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=\"L\"+u(e,r,O)}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=u(e,r,O));if(0===t.dtick&&(t.dtick=1),!T(t.dtick)&&\"string\"!=typeof t.dtick){var i=t.dtick;throw t.dtick=1,\"ax.dtick error: \"+String(i)}},E.tickIncrement=function(t,e,r){var n=r?-1:1;if(T(e))return t+n*e;var i=e.charAt(0),a=n*Number(e.substr(1));if(\"M\"===i){var o=new Date(t);return o.setMonth(o.getMonth()+a)}if(\"L\"===i)return Math.log(Math.pow(10,t)+a)/Math.LN10;if(\"D\"===i){var s=\"D2\"===e?N:F,l=t+.01*n,u=M.Lib.roundUp(A(l,1),s,r);return Math.floor(l)+Math.log(L.round(Math.pow(10,u),1))/Math.LN10}throw\"unrecognized dtick \"+String(e)},E.tickFirst=function(t){var e=t.range[1]<t.range[0],r=e?Math.floor:Math.ceil,n=1.0001*t.range[0]-1e-4*t.range[1],i=t.dtick,a=t.tick0;if(T(i)){var o=r((n-a)/i)*i+a;return\"category\"===t.type&&(o=M.Lib.constrain(o,0,t._categories.length-1)),o}var s,l,u,c=i.charAt(0),h=Number(i.substr(1));if(\"M\"===c){for(s=new Date(a),n=new Date(n),l=12*(n.getFullYear()-s.getFullYear())+n.getMonth()-s.getMonth(),u=s.setMonth(s.getMonth()+(Math.round(l/h)+(e?1:-1))*h);e?u>n:n>u;)u=E.tickIncrement(u,i,e);return u}if(\"L\"===c)return Math.log(r((Math.pow(10,n)-a)/h)*h+a)/Math.LN10;if(\"D\"===c){var f=\"D2\"===i?N:F,d=M.Lib.roundUp(A(n,1),f,e);return Math.floor(n)+Math.log(L.round(Math.pow(10,d),1))/Math.LN10}throw\"unrecognized dtick \"+String(i)};var B=L.time.format(\"%Y\"),U=L.time.format(\"%b %Y\"),V=L.time.format(\"%b %-d\"),q=L.time.format(\"%b %-d %Hh\"),H=L.time.format(\"%H:%M\"),G=L.time.format(\":%S\"),Y=/%(\\d?)f/g;E.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?\"none\"===n:(i={first:t._tmin,last:t._tmax}[n],\"all\"!==n&&e!==i)}var i,a=f(t,e),o=\"array\"===t.tickmode,s=r||o;if(o&&Array.isArray(t.ticktext)){for(var l=Math.abs(t.range[1]-t.range[0])/1e4,u=0;u<t.ticktext.length&&!(Math.abs(e-t.d2l(t.tickvals[u]))<l);u++);if(u<t.ticktext.length)return a.text=String(t.ticktext[u]),a}return i=\"none\"!==t.exponentformat&&n(t.showexponent)?\"hide\":\"\",\"date\"===t.type?d(t,a,r,s):\"log\"===t.type?p(t,a,r,s,i):\"category\"===t.type?g(t,a):v(t,a,r,s,i),t.tickprefix&&!n(t.showtickprefix)&&(a.text=t.tickprefix+a.text),t.ticksuffix&&!n(t.showticksuffix)&&(a.text+=t.ticksuffix),a};var W=[\"f\",\"p\",\"n\",\"&mu;\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\"],X=/(\\d+)(\\d{3})/;E.list=function(t,e,r){return b(t,e,r).map(function(e){return M.Lib.nestedProperty(t._fullLayout,e).get()})},E.listIds=function(t,e){return b(t,e,!0).map(E.name2id)},E.getFromId=function(t,e,r){var n=t._fullLayout;return\"x\"===r?e=e.replace(/y[0-9]*/,\"\"):\"y\"===r&&(e=e.replace(/x[0-9]*/,\"\")),n[E.id2name(e)]},E.getFromTrace=function(t,e,r){var n=t._fullLayout,i=null;if(M.Plots.traceIs(e,\"gl3d\")){var a=e.scene;\"scene\"===a.substr(0,5)&&(i=n[a][r+\"axis\"])}else i=E.getFromId(t,e[r+\"axis\"]||r);return i},E.subplotMatch=/^x([0-9]*)y([0-9]*)$/,E.getSubplots=function(t,e){function r(t,e){return-1!==t.indexOf(e._id)}var n,i,a,o=[],s=t.data||[];for(n=0;n<s.length;n++){var l=s[n];if(l.visible!==!1&&\"legendonly\"!==l.visible&&(M.Plots.traceIs(l,\"cartesian\")||M.Plots.traceIs(l,\"gl2d\"))){var u=l.xaxis||\"x\",c=l.yaxis||\"y\";a=u+c,-1===o.indexOf(a)&&o.push(a)}}var h=E.list(t,\"\",!0);for(n=0;n<h.length;n++){var f=h[n],d=f._id.charAt(0),p=\"free\"===f.anchor?\"x\"===d?\"y\":\"x\":f.anchor,g=E.getFromId(t,p),v=!1;for(i=0;i<o.length;i++)if(r(o[i],f)){v=!0;break}if(\"free\"!==f.anchor||!v){if(!g)return void console.log([\"Warning: couldnt find anchor\",p,\"for axis\",f._id].join(\" \"));a=\"x\"===d?f._id+g._id:g._id+f._id,-1===o.indexOf(a)&&o.push(a)}}var m=E.subplotMatch,y=[];for(n=0;n<o.length;n++)a=o[n],m.test(a)&&y.push(a);return y.sort(function(t,e){var r=t.match(m),n=e.match(m);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?E.findSubplotsWithAxis(y,e):y},E.findSubplotsWithAxis=function(t,e){for(var r=new RegExp(\"x\"===e._id.charAt(0)?\"^\"+e._id+\"y\":e._id+\"$\"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},E.makeClipPaths=function(t){var e,r,n=t._fullLayout,i=n._defs,a={_offset:0,_length:n.width,_id:\"\"},o={_offset:0,_length:n.height,_id:\"\"},s=E.list(t,\"x\",!0),l=E.list(t,\"y\",!0),u=[];for(e=0;e<s.length;e++)for(u.push({x:s[e],y:o}),r=0;r<l.length;r++)0===e&&u.push({x:a,y:l[r]}),u.push({x:s[e],y:l[r]});var c=i.selectAll(\"g.clips\").data([0]);c.enter().append(\"g\").classed(\"clips\",!0);var h=c.selectAll(\".axesclip\").data(u,function(t){return t.x._id+t.y._id});h.enter().append(\"clipPath\").classed(\"axesclip\",!0).attr(\"id\",function(t){return\"clip\"+n._uid+t.x._id+t.y._id}).append(\"rect\"),h.exit().remove(),h.each(function(t){L.select(this).select(\"rect\").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},E.doTicks=function(t,e,r){function n(t){var e=l.l2p(t.x);return e>1&&e<l._length-1}function i(t,e){var r=t.selectAll(\"path.\"+x).data(\"inside\"===l.ticks?O:y,b);e&&l.ticks?(r.enter().append(\"path\").classed(x,1).classed(\"ticks\",1).classed(\"crisp\",1).call(M.Color.stroke,l.tickcolor).style(\"stroke-width\",z+\"px\").attr(\"d\",e),r.attr(\"transform\",f),r.exit().remove()):r.remove()}function a(n,i){function a(t,e){t.each(function(t){var r=d(e),n=L.select(this),i=n.select(\".text-math-group\"),a=f(t)+(T(e)&&0!==+e?\" rotate(\"+e+\",\"+c(t)+\",\"+(h(t)-t.fontSize/2)+\")\":\"\");if(i.empty()){var o=n.select(\"text\").attr({transform:a,\"text-anchor\":r});o.empty()||o.selectAll(\"tspan.line\").attr({x:o.attr(\"x\"),y:o.attr(\"y\")})}else{var s=M.Drawing.bBox(i.node()).width*{end:-.5,start:.5}[r];i.attr(\"transform\",a+(s?\"translate(\"+s+\",0)\":\"\"))}})}function o(){return E.length&&Promise.all(E)}function s(){if(a(u,l.tickangle),\"x\"===v&&!T(l.tickangle)&&(\"log\"!==l.type||\"D\"!==String(l.dtick).charAt(0))){var n=[];for(u.each(function(t){var e=L.select(this),r=e.select(\".text-math-group\"),i=l.l2p(t.x);r.empty()&&(r=e.select(\"text\"));var a=M.Drawing.bBox(r.node());n.push({top:0,bottom:10,height:10,left:i-a.width/2,right:i+a.width/2+2,width:a.width+2})}),g=0;g<n.length-1;g++)if(M.Lib.bBoxIntersect(n[g],n[g+1])){w=30;break}if(w){var i=Math.abs((y[y.length-1].x-y[0].x)*l._m)/(y.length-1);2.5*_>i&&(w=90),a(u,w)}l._lastangle=w}return r||M.Titles.draw(t,e+\"title\"),e+\" done\"}var u=n.selectAll(\"g.\"+x).data(y,b);if(!l.showticklabels||!T(i))return u.remove(),void M.Titles.draw(t,e+\"title\");var c,h,d,p;if(\"x\"===v){var m=\"bottom\"===P?1:-1;c=function(t){return t.dx},p=i+(A+k)*m,h=function(t){return t.dy+p+t.fontSize*(\"bottom\"===P?1:-.5)},d=function(t){return T(t)&&0!==t&&180!==t?0>t*m?\"end\":\"start\":\"middle\"}}else h=function(t){return t.dy+t.fontSize/2},c=function(t){return t.dx+i+(A+k+(90===Math.abs(l.tickangle)?t.fontSize/2:0))*(\"right\"===P?1:-1)},d=function(t){return T(t)&&90===Math.abs(t)?\"middle\":\"right\"===P?\"start\":\"end\"};var _=0,w=0,E=[];u.enter().append(\"g\").classed(x,1).append(\"text\").attr(\"text-anchor\",\"middle\").each(function(e){var r=L.select(this),n=t._promises.length;r.call(M.Drawing.setPosition,c(e),h(e)).call(M.Drawing.font,e.font,e.fontSize,e.fontColor).text(e.text).call(M.util.convertToTspans),n=t._promises[n],n?E.push(t._promises.pop().then(function(){a(r,l.tickangle)})):a(r,l.tickangle)}),u.exit().remove(),u.each(function(t){_=Math.max(_,t.fontSize)}),a(u,l._lastangle||l.tickangle);var C=M.Lib.syncOrAsync([o,s]);return C&&C.then&&t._promises.push(C),C}function o(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:M.Plots.traceIs(t,\"bar\")&&t.orientation==={x:\"h\",y:\"v\"}[v]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===v}function s(e,r,i){var a=e.gridlayer,s=e.zerolinelayer,u=e[\"hidegrid\"+v]?[]:O,c=\"M0,0\"+(\"x\"===v?\"v\":\"h\")+r._length,h=a.selectAll(\"path.\"+_).data(l.showgrid===!1?[]:u,b);h.enter().append(\"path\").classed(_,1).classed(\"crisp\",1).attr(\"d\",c).each(function(t){l.zeroline&&(\"linear\"===l.type||\"-\"===l.type)&&Math.abs(t.x)<l.dtick/100&&L.select(this).remove()}),h.attr(\"transform\",f).call(M.Color.stroke,l.gridcolor||\"#ddd\").style(\"stroke-width\",C+\"px\"),h.exit().remove();for(var d=!1,p=0;p<t._fullData.length;p++)if(o(t._fullData[p],i)){d=!0;break}var g=l.range[0]*l.range[1]<=0&&l.zeroline&&(\"linear\"===l.type||\"-\"===l.type)&&u.length&&(d||n({x:0})||!l.showline),m=s.selectAll(\"path.\"+w).data(g?[{x:0}]:[]);m.enter().append(\"path\").classed(w,1).classed(\"zl\",1).classed(\"crisp\",1).attr(\"d\",c),m.attr(\"transform\",f).call(M.Color.stroke,l.zerolinecolor||M.Color.defaultLine).style(\"stroke-width\",S+\"px\"),m.exit().remove()}var l,u=t._fullLayout,c=!1;if(\"object\"==typeof e)l=e,e=l._id,c=!0;else if(l=E.getFromId(t,e),\"redraw\"===e&&u._paper.selectAll(\"g.subplot\").each(function(t){var e=u._plots[t],r=e.x(),n=e.y();e.plot.attr(\"viewBox\",\"0 0 \"+r._length+\" \"+n._length),e.xaxislayer.selectAll(\".\"+r._id+\"tick\").remove(),e.yaxislayer.selectAll(\".\"+n._id+\"tick\").remove(),e.gridlayer.selectAll(\"path\").remove(),e.zerolinelayer.selectAll(\"path\").remove()}),!e||\"redraw\"===e)return M.Lib.syncOrAsync(E.list(t,\"\",!0).map(function(r){return function(){if(r._id){var n=E.doTicks(t,r._id);return\"redraw\"===e&&(r._r=r.range.slice()),n}}}));l.tickformat||(-1===[\"none\",\"e\",\"E\",\"power\",\"SI\",\"B\"].indexOf(l.exponentformat)&&(l.exponentformat=\"e\"),-1===[\"all\",\"first\",\"last\",\"none\"].indexOf(l.showexponent)&&(l.showexponent=\"all\")),l.range=[+l.range[0],+l.range[1]],l.setScale();var h,f,d,p,g,v=e.charAt(0),m=E.counterLetter(e),y=E.calcTicks(l),b=function(t){return t.text+t.x+l.mirror},x=e+\"tick\",_=e+\"grid\",w=e+\"zl\",k=(l.linewidth||1)/2,A=(\"outside\"===l.ticks?l.ticklen:1)+(l.linewidth||0),C=M.Drawing.crispRound(t,l.gridwidth,1),S=M.Drawing.crispRound(t,l.zerolinewidth,C),z=M.Drawing.crispRound(t,l.tickwidth,1);if(\"x\"===v)h=[\"bottom\",\"top\"],f=function(t){return\"translate(\"+l.l2p(t.x)+\",0)\"},d=\"M0,\",p=\"v\";else{if(\"y\"!==v)return void console.log(\"unrecognized doTicks axis\",e);h=[\"left\",\"right\"],f=function(t){return\"translate(0,\"+l.l2p(t.x)+\")\"},d=\"M\",p=\",0h\"}var P=l.side||h[0],j=[-1,1,P===h[1]?1:-1];\"inside\"!==l.ticks==(\"x\"===v)&&(j=j.map(function(t){return-t}));var O=y.filter(n);if(c)return i(l._axislayer,d+(l._pos+k*j[2])+p+j[2]*l.ticklen),a(l._axislayer,l._pos);var I=E.getSubplots(t,l).map(function(t){var e=u._plots[t];if(u._hasCartesian){var r=e[v+\"axislayer\"],n=l._linepositions[t]||[],o=e[m](),c=o._id===l.anchor,f=[!1,!1,!1],y=\"\";if(\"allticks\"===l.mirror?f=[!0,!0,!1]:c&&(\"ticks\"===l.mirror?f=[!0,!0,!1]:f[h.indexOf(P)]=!0),l.mirrors)for(g=0;2>g;g++){var b=l.mirrors[o._id+h[g]];(\"ticks\"===b||\"labels\"===b)&&(f[g]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],i=j[e];t&&T(r)&&(y+=d+(r+k*i)+p+i*l.ticklen)}),i(r,y),s(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return I.length?Promise.all(I):0},E.swap=function(t,e){for(var r=x(t,e),n=0;n<r.length;n++)w(t,r[n].x,r[n].y)}},{\"../../plotly\":330,\"./attributes\":332,\"./layout_attributes\":335,d3:53,\"fast-isnumeric\":58}],334:[function(t,e,r){\"use strict\";function n(t,e){for(var r=[],n=t.length;n>0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;n<t.length;n++)r.push(t[n].p2c(e));return r}function a(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}}function o(t,e,r){r||(r=\"xy\");var a=t._fullLayout,o=a._plots[r],d=[r].concat(o.overlays.map(function(t){return t.id})),p=d.map(function(e){return _.Axes.getFromId(t,e,\"x\")}),g=d.map(function(e){return _.Axes.getFromId(t,e,\"y\")}),v=e.hovermode||a.hovermode;if(-1===[\"x\",\"y\",\"closest\"].indexOf(v)||!t.calcdata||t.querySelector(\".zoombox\")||t._dragging)return f(t,e);var m,y,b,x,w,k,T,E,C,S,z,P,j=[],O=[];if(Array.isArray(e))for(v=\"array\",b=0;b<e.length;b++)w=t.calcdata[e[b].curveNumber||0],\"none\"!==w[0].trace.hoverinfo&&O.push(w);else{for(x=0;x<t.calcdata.length;x++)w=t.calcdata[x],k=w[0].trace,\"none\"!==k.hoverinfo&&-1!==d.indexOf(k.xaxis+k.yaxis)&&O.push(w);var I,D;if(e.target&&\"clientX\"in e&&\"clientY\"in e){if(M.triggerHandler(t,\"plotly_beforehover\",e)===!1)return;var R=e.target.getBoundingClientRect();if(I=e.clientX-R.left,D=e.clientY-R.top,0>I||I>R.width||0>D||D>R.height)return f(t,e)}else I=\"xpx\"in e?e.xpx:p[0]._length/2,D=\"ypx\"in e?e.ypx:g[0]._length/2;if(m=\"xval\"in e?n(d,e.xval):i(p,I),y=\"yval\"in e?n(d,e.yval):i(g,D),!A(m[0])||!A(y[0]))return console.log(\"Plotly.Fx.hover failed\",e,t),f(t,e)}var F=1/0;for(x=0;x<O.length;x++)if(w=O[x],w&&w[0]&&w[0].trace&&w[0].trace.visible===!0){if(k=w[0].trace,T=d.indexOf(k.xaxis+k.yaxis),E=v,z={cd:w,trace:k,xa:p[T],ya:g[T],name:t.data.length>1||-1!==k.hoverinfo.indexOf(\"name\")?k.name:void 0,index:!1,distance:Math.min(F,L.MAXDIST),color:_.Color.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},P=j.length,\"array\"===E){var N=e[x];\"pointNumber\"in N?(z.index=N.pointNumber,E=\"closest\"):(E=\"\",\"xval\"in N&&(C=N.xval,E=\"x\"),\"yval\"in N&&(S=N.yval,E=E?\"closest\":\"y\"))}else C=m[T],S=y[T];if(k._module&&k._module.hoverPoints){var B=k._module.hoverPoints(z,C,S,E);if(B)for(var U,V=0;V<B.length;V++)U=B[V],A(U.x0)&&A(U.y0)&&j.push(s(U,v))}else console.log(\"unrecognized trace type in hover\",k);\"closest\"===v&&j.length>P&&(j.splice(0,P),F=j[0].distance)}if(0===j.length)return f(t,e);var q=\"y\"===v&&O.length>1;j.sort(function(t,e){return t.distance-e.distance});var H={hovermode:v,rotateLabels:q,bgColor:_.Color.combine(a.plot_bgcolor,a.paper_bgcolor),container:a._hoverlayer,outerContainer:a._paperdiv},G=l(j,H);u(j,q?p[0]:g[0]),c(G,q);var Y=t._hoverdata,W=[];for(b=0;b<j.length;b++){var X=j[b],Z={data:X.trace._input,fullData:X.trace,curveNumber:X.trace.index,pointNumber:X.index,x:X.xVal,y:X.yVal,xaxis:X.xa,yaxis:X.ya};void 0!==X.zLabelVal&&(Z.z=X.zLabelVal),W.push(Z)}t._hoverdata=W,h(t,e,Y)&&(Y&&t.emit(\"plotly_unhover\",{points:Y}),t.emit(\"plotly_hover\",{points:t._hoverdata,xaxes:p,yaxes:g,xvals:m,yvals:y}))}function s(t,e){t.posref=\"y\"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=_.Lib.constrain(t.x0,0,t.xa._length),t.x1=_.Lib.constrain(t.x1,0,t.xa._length),t.y0=_.Lib.constrain(t.y0,0,t.ya._length),t.y1=_.Lib.constrain(t.y1,0,t.ya._length);var r;if(void 0!==t.xLabelVal){r=\"log\"===t.xa.type&&t.xLabelVal<=0;var n=_.Axes.tickText(t.xa,t.xa.c2l(r?-t.xLabelVal:t.xLabelVal),\"hover\");r?0===t.xLabelVal?t.xLabel=\"0\":t.xLabel=\"-\"+n.text:t.xLabel=n.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){r=\"log\"===t.ya.type&&t.yLabelVal<=0;var i=_.Axes.tickText(t.ya,t.ya.c2l(r?-t.yLabelVal:t.yLabelVal),\"hover\");r?0===t.yLabelVal?t.yLabel=\"0\":t.yLabel=\"-\"+i.text:t.yLabel=i.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),void 0!==t.xerr){var a=_.Axes.tickText(t.xa,t.xa.c2l(t.xerr),\"hover\").text;void 0!==t.xerrneg?t.xLabel+=\" +\"+a+\" / -\"+_.Axes.tickText(t.xa,t.xa.c2l(t.xerrneg),\"hover\").text:t.xLabel+=\" &plusmn; \"+a,\"x\"===e&&(t.distance+=1)}if(void 0!==t.yerr){var o=_.Axes.tickText(t.ya,t.ya.c2l(t.yerr),\"hover\").text;void 0!==t.yerrneg?t.yLabel+=\" +\"+o+\" / -\"+_.Axes.tickText(t.ya,t.ya.c2l(t.yerrneg),\"hover\").text:t.yLabel+=\" &plusmn; \"+o,\"y\"===e&&(t.distance+=1)}var s=t.trace.hoverinfo;return\"all\"!==s&&(s=s.split(\"+\"),-1===s.indexOf(\"x\")&&(t.xLabel=void 0),-1===s.indexOf(\"y\")&&(t.yLabel=void 0),-1===s.indexOf(\"z\")&&(t.zLabel=void 0),-1===s.indexOf(\"text\")&&(t.text=void 0),-1===s.indexOf(\"name\")&&(t.name=void 0)),t}function l(t,e){var r,n,i=e.hovermode,a=e.rotateLabels,o=e.bgColor,s=e.container,l=e.outerContainer,u=t[0],c=u.xa,h=u.ya,f=\"y\"===i?\"yLabel\":\"xLabel\",d=u[f],p=(String(d)||\"\").split(\" \")[0],g=l.node().getBoundingClientRect(),v=g.top,m=g.width,y=g.height,b=u.distance<=L.MAXDIST&&(\"x\"===i||\"y\"===i);for(r=0;r<t.length;r++)if(n=t[r].trace.hoverinfo,-1===n.indexOf(\"all\")&&-1===n.indexOf(i)){b=!1;break}var x=s.selectAll(\"g.axistext\").data(b?[0]:[]);x.enter().append(\"g\").classed(\"axistext\",!0),x.exit().remove(),x.each(function(){var e=w.select(this),r=e.selectAll(\"path\").data([0]),n=e.selectAll(\"text\").data([0]);r.enter().append(\"path\").style({fill:_.Color.defaultLine,\"stroke-width\":\"1px\",stroke:_.Color.background}),n.enter().append(\"text\").call(_.Drawing.font,D,I,_.Color.background).attr(\"data-notex\",1),n.text(d).call(_.util.convertToTspans).call(_.Drawing.setPosition,0,0).selectAll(\"tspan.line\").call(_.Drawing.setPosition,0,0),e.attr(\"transform\",\"\");var a=n.node().getBoundingClientRect();if(\"x\"===i){n.attr(\"text-anchor\",\"middle\").call(_.Drawing.setPosition,0,\"top\"===c.side?v-a.bottom-j-O:v-a.top+j+O).selectAll(\"tspan.line\").attr({x:n.attr(\"x\"),y:n.attr(\"y\")});var o=\"top\"===c.side?\"-\":\"\";r.attr(\"d\",\"M0,0L\"+j+\",\"+o+j+\"H\"+(O+a.width/2)+\"v\"+o+(2*O+a.height)+\"H-\"+(O+a.width/2)+\"V\"+o+j+\"H-\"+j+\"Z\"),e.attr(\"transform\",\"translate(\"+(c._offset+(u.x0+u.x1)/2)+\",\"+(h._offset+(\"top\"===c.side?0:h._length))+\")\")}else{n.attr(\"text-anchor\",\"right\"===h.side?\"start\":\"end\").call(_.Drawing.setPosition,(\"right\"===h.side?1:-1)*(O+j),v-a.top-a.height/2).selectAll(\"tspan.line\").attr({x:n.attr(\"x\"),y:n.attr(\"y\")});var s=\"right\"===h.side?\"\":\"-\";r.attr(\"d\",\"M0,0L\"+s+j+\",\"+j+\"V\"+(O+a.height/2)+\"h\"+s+(2*O+a.width)+\"V-\"+(O+a.height/2)+\"H\"+s+j+\"V-\"+j+\"Z\"),e.attr(\"transform\",\"translate(\"+(c._offset+(\"right\"===h.side?c._length:0))+\",\"+(h._offset+(u.y0+u.y1)/2)+\")\")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[f]||\"\").split(\" \")[0]===p})});var A=s.selectAll(\"g.hovertext\").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr||\"\"].join(\",\")});return A.enter().append(\"g\").classed(\"hovertext\",!0).each(function(){var t=w.select(this);t.append(\"rect\").call(_.Color.fill,_.Color.addOpacity(o,.8)),t.append(\"text\").classed(\"name\",!0).call(_.Drawing.font,D,I),t.append(\"path\").style(\"stroke-width\",\"1px\"),t.append(\"text\").classed(\"nums\",!0).call(_.Drawing.font,D,I)}),A.exit().remove(),A.each(function(t){var e=w.select(this).attr(\"transform\",\"\"),r=\"\",n=\"\",s=_.Color.opacity(t.color)?t.color:_.Color.defaultLine,l=_.Color.combine(s,o),u=k(l).getBrightness()>128?\"#000\":_.Color.background;if(t.name&&void 0===t.zLabelVal){var f=document.createElement(\"p\");f.innerHTML=t.name,r=f.textContent||\"\",r.length>15&&(r=r.substr(0,12)+\"...\")}void 0!==t.zLabel?(void 0!==t.xLabel&&(n+=\"x: \"+t.xLabel+\"<br>\"),void 0!==t.yLabel&&(n+=\"y: \"+t.yLabel+\"<br>\"),n+=(n?\"z: \":\"\")+t.zLabel):b&&t[i+\"Label\"]===d?n=t[(\"x\"===i?\"y\":\"x\")+\"Label\"]||\"\":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:\"(\"+t.xLabel+\", \"+t.yLabel+\")\",t.text&&(n+=(n?\"<br>\":\"\")+t.text),\"\"===n&&(\"\"===r&&e.remove(),n=r);var p=e.select(\"text.nums\").style(\"fill\",u).call(_.Drawing.setPosition,0,0).text(n).attr(\"data-notex\",1).call(_.util.convertToTspans);p.selectAll(\"tspan.line\").call(_.Drawing.setPosition,0,0);var g=e.select(\"text.name\"),x=0;r&&r!==n?(g.style(\"fill\",l).text(r).call(_.Drawing.setPosition,0,0).attr(\"data-notex\",1).call(_.util.convertToTspans),g.selectAll(\"tspan.line\").call(_.Drawing.setPosition,0,0),x=g.node().getBoundingClientRect().width+2*O):(g.remove(),e.select(\"rect\").remove()),e.select(\"path\").style({fill:l,stroke:u});var A,M,L=p.node().getBoundingClientRect(),T=c._offset+(t.x0+t.x1)/2,C=h._offset+(t.y0+t.y1)/2,S=Math.abs(t.x1-t.x0),z=Math.abs(t.y1-t.y0),P=L.width+j+O+x;t.ty0=v-L.top,t.bx=L.width+2*O,t.by=L.height+2*O,t.anchor=\"start\",t.txwidth=L.width,t.tx2width=x,t.offset=0,a?(t.pos=T,A=y>=C+z/2+P,M=C-z/2-P>=0,\"top\"!==t.idealAlign&&A||!M?A?(C+=z/2,t.anchor=\"start\"):t.anchor=\"middle\":(C-=z/2,t.anchor=\"end\")):(t.pos=C,A=m>=T+S/2+P,M=T-S/2-P>=0,\"left\"!==t.idealAlign&&A||!M?A?(T+=S/2,t.anchor=\"start\"):t.anchor=\"middle\":(T-=S/2,t.anchor=\"end\")),p.attr(\"text-anchor\",t.anchor),x&&g.attr(\"text-anchor\",t.anchor),e.attr(\"transform\",\"translate(\"+T+\",\"+C+\")\"+(a?\"rotate(\"+E+\")\":\"\"))}),A}function u(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=h-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-f,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(.01>a)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;o<t.length;o++)l=t[o],l.pos+l.dp+l.size>f&&u++;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos>f-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(0>=u);o++)if(l=t[o],l.pos<h+1)for(l.del=!0,u--,a=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos+l.dp+l.size>f&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=e._offset,f=e._offset+e._length,d=t.map(function(t,r){return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*(\"x\"===e._id.charAt(0)?S:1)/2}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o<d.length-1;){var p=d[o],g=d[o+1],v=p[p.length-1],m=g[0];if(i=v.pos+v.dp+v.size-m.pos-m.dp+m.size,i>.01){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(p.push.apply(p,g),d.splice(o+1,1),u=0,s=p.length-1;s>=0;s--)u+=p[s].dp;for(a=u/p.length,s=p.length-1;s>=0;s--)p[s].dp-=a;n=!1}else o++}d.forEach(r)}for(o=d.length-1;o>=0;o--){var y=d[o];for(s=y.length-1;s>=0;s--){var b=y[s],x=t[b.i];x.offset=b.dp,x.del=b.del}}}function c(t,e){t.each(function(t){var r=w.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*(j+O),s=o+a*(t.txwidth+O),l=0,u=t.offset;\"middle\"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-P,l=t.offset*z),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*j+l)+\",\"+(j+u)+\"v\"+(t.by/2-j)+\"h\"+n*t.bx+\"v-\"+t.by+\"H\"+(n*j+l)+\"V\"+(u-j)+\"Z\"),i.call(_.Drawing.setPosition,o+l,u+t.ty0-t.by/2+O).selectAll(\"tspan.line\").attr({x:i.attr(\"x\"),y:i.attr(\"y\")}),t.tx2width&&(r.select(\"text.name, text.name tspan.line\").call(_.Drawing.setPosition,s+a*O+l,u+t.ty0-t.by/2+O),r.select(\"rect\").call(_.Drawing.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function h(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=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}function f(t,e){var r=t._fullLayout;e||(e={}),e.target&&M.triggerHandler(t,\"plotly_beforehover\",e)===!1||(r._hoverlayer.selectAll(\"g\").remove(),e.target&&t._hoverdata&&t.emit(\"plotly_unhover\",{points:t._hoverdata}),t._hoverdata=void 0)}function d(t){if(t._hasGL3D)return[[\"toImage\",\"sendDataToCloud\"],[\"orbitRotation\",\"tableRotation\",\"zoom3d\",\"pan3d\"],[\"resetCameraDefault3d\",\"resetCameraLastSave3d\"],[\"hoverClosest3d\"]];if(t._hasGeo)return[[\"toImage\",\"sendDataToCloud\"],[\"zoomInGeo\",\"zoomOutGeo\",\"resetGeo\"],[\"hoverClosestGeo\"]];var e,r,n=_.Axes.list({_fullLayout:t},null,!0),i=!0;for(e=0;e<n.length;e++)if(!n[e].fixedrange){i=!1;break}return r=i?[[\"toImage\",\"sendDataToCloud\"]]:[[\"toImage\",\"sendDataToCloud\"],[\"zoom2d\",\"pan2d\"],[\"zoomIn2d\",\"zoomOut2d\",\"resetScale2d\",\"autoScale2d\"]],t._hasCartesian?r.push([\"hoverClosest2d\",\"hoverCompare2d\"]):t._hasPie?r.push([\"hoverClosestPie\"]):t._hasGL2D&&r.push([\"hoverClosestGl2d\"]),r}function p(t,e){return t?\"nsew\"===t?\"pan\"===e?\"move\":\"crosshair\":t.toLowerCase()+\"-resize\":\"pointer\"}function g(t,e,r,n,i,a,o,s){function l(t,e){for(E=0;E<t.length;E++)if(!t[E].fixedrange)return e;return\"\"}function u(t){t[0]=Number(t[0]),t[1]=Number(t[1])}function c(r,n,i){var a=H.getBoundingClientRect();for(Y=n-a.left,W=i-a.top,X={l:Y,r:Y,w:0,t:W,b:W,h:0},Z=t._hmpixcount?t._hmlumcount/t._hmpixcount:k(t._fullLayout.plot_bgcolor).getLuminance(),Q=Q=\"M0,0H\"+I+\"V\"+D+\"H0V0\",$=!1,K=\"xy\",J=e.plot.append(\"path\").attr(\"class\",\"zoombox\").style({fill:Z>.2?\"rgba(0,0,0,0)\":\"rgba(255,255,255,0)\",\"stroke-width\":0}).attr(\"d\",Q+\"Z\"),tt=e.plot.append(\"path\").attr(\"class\",\"zoombox-corners\").style({fill:_.Color.background,stroke:_.Color.defaultLine,\"stroke-width\":1,opacity:0}).attr(\"d\",\"M0,0Z\"),E=0;E<R.length;E++)u(R[E].range)}function h(t,e){var r=Math.max(0,Math.min(I,t+Y)),n=Math.max(0,Math.min(D,e+W)),i=Math.abs(r-Y),a=Math.abs(n-W),o=Math.floor(Math.min(a,i,L.MINZOOM)/2);X.l=Math.min(Y,r),X.r=Math.max(Y,r),X.t=Math.min(W,n),X.b=Math.max(W,n),!B||a<Math.min(Math.max(.6*i,L.MINDRAG),L.MINZOOM)?i<L.MINDRAG?(K=\"\",X.r=X.l,X.t=X.b,tt.attr(\"d\",\"M0,0Z\")):(X.t=0,X.b=D,K=\"x\",tt.attr(\"d\",\"M\"+(X.l-.5)+\",\"+(W-L.MINZOOM-.5)+\"h-3v\"+(2*L.MINZOOM+1)+\"h3ZM\"+(X.r+.5)+\",\"+(W-L.MINZOOM-.5)+\"h3v\"+(2*L.MINZOOM+1)+\"h-3Z\")):!N||i<Math.min(.6*a,L.MINZOOM)?(X.l=0,X.r=I,K=\"y\",tt.attr(\"d\",\"M\"+(Y-L.MINZOOM-.5)+\",\"+(X.t-.5)+\"v-3h\"+(2*L.MINZOOM+1)+\"v3ZM\"+(Y-L.MINZOOM-.5)+\",\"+(X.b+.5)+\"v3h\"+(2*L.MINZOOM+1)+\"v-3Z\")):(K=\"xy\",tt.attr(\"d\",\"M\"+(X.l-3.5)+\",\"+(X.t-.5+o)+\"h3v\"+-o+\"h\"+o+\"v-3h-\"+(o+3)+\"ZM\"+(X.r+3.5)+\",\"+(X.t-.5+o)+\"h-3v\"+-o+\"h\"+-o+\"v-3h\"+(o+3)+\"ZM\"+(X.r+3.5)+\",\"+(X.b+.5-o)+\"h-3v\"+o+\"h\"+-o+\"v3h\"+(o+3)+\"ZM\"+(X.l-3.5)+\",\"+(X.b+.5-o)+\"h3v\"+o+\"h\"+o+\"v3h-\"+(o+3)+\"Z\")),X.w=X.r-X.l,X.h=X.b-X.t,J.attr(\"d\",Q+\"M\"+X.l+\",\"+X.t+\"v\"+X.h+\"h\"+X.w+\"v-\"+X.h+\"h-\"+X.w+\"Z\"),$||(J.transition().style(\"fill\",Z>.2?\"rgba(0,0,0,0.4)\":\"rgba(255,255,255,0.3)\").duration(200),tt.transition().style(\"opacity\",1).duration(200),$=!0)}function f(t,e,r){var n,i,a;for(n=0;n<t.length;n++)i=t[n],i.fixedrange||(a=i.range,i.range=[a[0]+(a[1]-a[0])*e,a[0]+(a[1]-a[0])*r])}function d(e,r){return Math.min(X.h,X.w)<2*L.MINDRAG?(2===r?A():m(t),b(t)):((\"xy\"===K||\"x\"===K)&&f(j,X.l/I,X.r/I),(\"xy\"===K||\"y\"===K)&&f(O,(D-X.b)/D,(D-X.t)/D),b(t),M(K),void(F&&t.data&&t._context.showTips&&(_.Lib.notifier(\"Double-click to<br>zoom back out\",\"long\"),F=!1)))}function g(e,r){var n=1===(o+s).length;if(e)M();else if(2!==r||n)if(1===r&&n){var i=o?O[0]:j[0],a=\"s\"===o||\"w\"===s?0:1,l=i._name+\".range[\"+a+\"]\",u=v(i,a),c=\"left\",h=\"middle\";if(i.fixedrange)return;o?(h=\"n\"===o?\"top\":\"bottom\",\"right\"===i.side&&(c=\"right\")):\"e\"===s&&(c=\"right\"),q.call(_.util.makeEditable,null,{immediate:!0,background:z.paper_bgcolor,text:String(u),fill:i.tickfont?i.tickfont.color:\"#444\",horizontalAlign:c,verticalAlign:h}).on(\"edit\",function(e){var r=\"category\"===i.type?i.c2l(e):i.d2l(e);void 0!==r&&_.relayout(t,l,r)})}else m(t);else A()}function y(e){function r(t,e,r){if(!t.fixedrange){u(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||z._enablescrollzoom){var n=t.querySelector(\".plotly\");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(rt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void console.log(\"did not find wheel motion attributes\",e);var a,l=Math.exp(-Math.min(Math.max(i,-20),20)/100),c=it.draglayer.select(\".nsewdrag\").node().getBoundingClientRect(),h=(e.clientX-c.left)/c.width,f=et[0]+et[2]*h,d=(c.bottom-e.clientY)/c.height,p=et[1]+et[3]*(1-d);if(s){for(a=0;a<j.length;a++)r(j[a],h,l);et[2]*=l,et[0]=f-et[2]*h}if(o){for(a=0;a<O.length;a++)r(O[a],d,l);et[3]*=l,et[1]=p-et[3]*(1-d)}return T(et),w(o,s),rt=setTimeout(function(){et=[0,0,I,D],M()},nt),_.Lib.pauseEvent(e)}}}function x(t,e){function r(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n._r[0]-e/n._m,n._r[1]-e/n._m])}}function n(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,a=0,o=0;o<t.length;o++){var s=t[o];s.fixedrange||(a=o,s.range[e]=s._r[i]+(s._r[e]-s._r[i])/n(r/s._length))}return t[a]._length*(t[a]._r[e]-t[a].range[e])/(t[a]._r[e]-t[a]._r[i])}return\"ew\"===N||\"ns\"===B?(N&&r(j,t),B&&r(O,e),T([N?-t:0,B?-e:0,I,D]),void w(B,N)):(\"w\"===N?t=i(j,0,t):\"e\"===N?t=i(j,1,-t):N||(t=0),\"n\"===B?e=i(O,1,e):\"s\"===B?e=i(O,0,-e):B||(e=0),T([\"w\"===N?t:0,\"n\"===B?e:0,I-t,D-e]),void w(B,N))}function w(e,r){function n(t){for(a=0;a<t.length;a++)t[a].fixedrange||o.push(t[a]._id)}function i(n,i){var s;for(a=0;a<n.length;a++)s=n[a],(r&&-1!==o.indexOf(s.xref)||e&&-1!==o.indexOf(s.yref))&&i.draw(t,a)}var a,o=[];for(r&&n(j),e&&n(O),a=0;a<o.length;a++)_.Axes.doTicks(t,o[a],!0);i(z.annotations||[],_.Annotations),i(z.shapes||[],_.Shapes)}function A(){var e,r,n=t._context.doubleClick,i=(N?j:[]).concat(B?O:[]),a={};if(\"autosize\"===n)for(r=0;r<i.length;r++)e=i[r],e.fixedrange||(a[e._name+\".autorange\"]=!0);else if(\"reset\"===n)for(r=0;r<i.length;r++)e=i[r],a[e._name+\".range\"]=e._rangeInitial.slice();else if(\"reset+autosize\"===n)for(r=0;r<i.length;r++)e=i[r],e.fixedrange||(void 0===e._rangeInitial||e.range[0]===e._rangeInitial[0]&&e.range[1]===e._rangeInitial[1]?a[e._name+\".autorange\"]=!0:a[e._name+\".range\"]=e._rangeInitial.slice());_.relayout(t,a)}function M(e){for(var r={},n=0;n<R.length;n++){var i=R[n];e&&-1===e.indexOf(i._id.charAt(0))||(i._r[0]!==i.range[0]&&(r[i._name+\".range[0]\"]=i.range[0]),\n",
"i._r[1]!==i.range[1]&&(r[i._name+\".range[1]\"]=i.range[1]),i.range=i._r.slice())}T([0,0,I,D]),_.relayout(t,r)}function T(t){var e,r,n,i,a,l,u=z._plots,c=Object.keys(u);for(e=0;e<c.length;e++)if(r=u[c[e]],n=r.x(),i=r.y(),a=s&&-1!==j.indexOf(n)&&!n.fixedrange,l=o&&-1!==O.indexOf(i)&&!i.fixedrange,a||l){var h=[0,0,n._length,i._length];a&&(h[0]=t[0],h[2]=t[2]),l&&(h[1]=t[1],h[3]=t[3]),r.plot.attr(\"viewBox\",h.join(\" \"))}}var E,C,S,z=t._fullLayout,P=[e].concat(o&&s?e.overlays:[]),j=[e.x()],O=[e.y()],I=j[0]._length,D=O[0]._length;for(E=1;E<P.length;E++)C=P[E].x(),S=P[E].y(),-1===j.indexOf(C)&&j.push(C),-1===O.indexOf(S)&&O.push(S);var R=j.concat(O),N=l(j,s),B=l(O,o),U=p(B+N,z.dragmode),V=o+s+\"drag\",q=e.draglayer.selectAll(\".\"+V).data([0]);q.enter().append(\"rect\").classed(\"drag\",!0).classed(V,!0).style({fill:\"transparent\",\"stroke-width\":0}).attr(\"data-subplot\",e.id),q.call(_.Drawing.setRect,r,n,i,a).call(L.setCursor,U);var H=q.node();if(!B&&!N)return H.onmousedown=null,H.style.pointerEvents=o+s===\"nsew\"?\"all\":\"none\",H;var G={element:H,prepFn:function(t,e,r){o+s===\"nsew\"&&(\"zoom\"===z.dragmode?!t.shiftKey:t.shiftKey)?(G.moveFn=h,G.doneFn=d,c(t,e,r)):(G.moveFn=x,G.doneFn=g)}};L.dragElement(G);var Y,W,X,Z,Q,$,K,J,tt,et=[0,0,I,D],rt=null,nt=300,it=e.mainplot?z._plots[e.mainplot]:e;return o.length*s.length!==1&&(void 0!==H.onwheel?H.onwheel=y:void 0!==H.onmousewheel&&(H.onmousewheel=y)),H}function v(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return\"date\"===t.type?_.Lib.ms2DateTime(n,i):\"log\"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,w.format(\".\"+r+\"g\")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,w.format(\".\"+String(r)+\"g\")(n))}function m(t){t._dragging=!0;var e=t._replotPending;t._replotPending=!1,setTimeout(function(){t._replotPending=e,y(t)},L.DBLCLICKDELAY)}function y(t){t._dragging=!1,t._replotPending&&_.plot(t)}function b(t){w.select(t).selectAll(\".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners\").remove()}function x(){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[\"z-index\"]=999999999,e.background=\"none\",document.body.appendChild(t),t}var _=t(\"../../plotly\"),w=t(\"d3\"),k=t(\"tinycolor2\"),A=t(\"fast-isnumeric\"),M=t(\"../../lib/events\"),L=e.exports={};L.layoutAttributes={dragmode:{valType:\"enumerated\",values:[\"zoom\",\"pan\",\"orbit\",\"turntable\"]},hovermode:{valType:\"enumerated\",values:[\"x\",\"y\",\"closest\",!1]}},L.supplyLayoutDefaults=function(t,e,r){function n(r,n){return _.Lib.coerce(t,e,L.layoutAttributes,r,n)}var i,a;n(\"dragmode\",e._hasGL3D?\"turntable\":\"zoom\"),e._hasCartesian?(i=e._isHoriz=L.isHoriz(r),a=i?\"y\":\"x\"):a=\"closest\",n(\"hovermode\",a)},L.isHoriz=function(t){var e,r,n=!0;for(e=0;e<t.length;e++)if(r=t[e],\"h\"!==r.orientation){n=!1;break}return n},L.DBLCLICKDELAY=600,L.MINDRAG=8,L.MINZOOM=20;var T=20;L.init=function(t){var e=t._fullLayout;if(!(e._hasGL3D||e._hasGeo||t._context.staticPlot)){var r=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});r.forEach(function(r){var n=e._plots[r];if(e._hasCartesian){var i=n.x(),a=n.y(),o=(i._linepositions[r]||[])[3],s=(a._linepositions[r]||[])[3];if(A(o)&&\"top\"===i.side&&(o-=T),A(s)&&\"right\"!==a.side&&(s-=T),!n.mainplot){var l=g(t,n,0,0,i._length,a._length,\"ns\",\"ew\");l.onmousemove=function(n){L.hover(t,n,r),e._lasthover=l,e._hoversubplot=r},l.onmouseout=function(e){t._dragging||L.unhover(t,e)},l.onclick=function(e){L.click(t,e)},g(t,n,-T,-T,T,T,\"n\",\"w\"),g(t,n,i._length,-T,T,T,\"n\",\"e\"),g(t,n,-T,a._length,T,T,\"s\",\"w\"),g(t,n,i._length,a._length,T,T,\"s\",\"e\")}A(o)&&(\"free\"===i.anchor&&(o-=e._size.h*(1-a.domain[1])),g(t,n,.1*i._length,o,.8*i._length,T,\"\",\"ew\"),g(t,n,0,o,.1*i._length,T,\"\",\"w\"),g(t,n,.9*i._length,o,.1*i._length,T,\"\",\"e\")),A(s)&&(\"free\"===a.anchor&&(s-=e._size.w*i.domain[0]),g(t,n,s,.1*a._length,T,.8*a._length,\"ns\",\"\"),g(t,n,s,.9*a._length,T,.1*a._length,\"s\",\"\"),g(t,n,s,0,T,.1*a._length,\"n\",\"\"))}});var n=e._hoverlayer.node();n.onmousemove=function(r){r.target=e._lasthover,L.hover(t,r,e._hoversubplot)},n.onclick=function(r){r.target=e._lasthover,L.click(t,r)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}};var E=60,C=Math.PI*E/180,S=1/Math.sin(C),z=Math.cos(C),P=Math.sin(C),j=6,O=3,I=13,D=\"Arial, sans-serif\";L.MAXDIST=20;var R=100;L.hover=function(t,e,r){return\"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+R?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},R))},L.unhover=function(t,e,r){\"string\"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),f(t,e,r)},L.getDistanceFunction=function(t,e,r,n){return\"closest\"===t?n||a(e,r):\"x\"===t?e:r},L.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<r.distance&&(r.index=n,r.distance=i)}return r},L.loneHover=function(t,e){var r={color:t.color||_.Color.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,trace:{index:0,hoverinfo:\"\"},xa:{_offset:0},ya:{_offset:0},index:0},n=w.select(e.container),i=e.outerContainer?w.select(e.outerContainer):n,a={hovermode:\"closest\",rotateLabels:!1,bgColor:e.bgColor||_.Color.background,container:n,outerContainer:i},o=l([r],a);return c(o,a.rotateLabels),o.node()},L.loneUnhover=function(t){var e=t instanceof w.selection?t:w.select(t);e.selectAll(\"g.hovertext\").remove()},L.click=function(t,e){t._hoverdata&&e&&e.target&&(t.emit(\"plotly_click\",{points:t._hoverdata}),e.stopImmediatePropagation())},L.modeBar=function(t){function e(){var e=new _.ModeBar({buttons:a,container:i._paperdiv.node(),Plotly:_,graphInfo:t});return i._privateplot&&w.select(e.element).append(\"span\").classed(\"badge-private float--left\",!0).text(\"PRIVATE\"),e}function r(){_.Lib.removeElement(t.querySelector(\".modebar\"))}var n,i=t._fullLayout||{};if(!t._context.displayModeBar)return r();var a=d(i);i._modebar||(r(),i._modebar=e()),n=i._modebar,n.hasButtons(a)||(i._modebar.cleanup(),i._modebar=e())};var F=!0;L.dragAlign=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return\"left\"===i||\"bottom\"===i?a:\"center\"===i||\"middle\"===i?s:\"right\"===i||\"top\"===i?o:2/3-s>a?a:o>4/3-s?o:s};var N=[[\"sw-resize\",\"s-resize\",\"se-resize\"],[\"w-resize\",\"move\",\"e-resize\"],[\"nw-resize\",\"n-resize\",\"ne-resize\"]];L.dragCursors=function(t,e,r,n){return t=\"left\"===r?0:\"center\"===r?1:\"right\"===r?2:_.Lib.constrain(Math.floor(3*t),0,2),e=\"bottom\"===n?0:\"middle\"===n?1:\"top\"===n?2:_.Lib.constrain(Math.floor(3*e),0,2),N[e][t]},L.dragElement=function(t){function e(e){var h=document.querySelector(\".plugin-editable\");return h&&w.select(h).on(\"blur\").call(h),u._dragged=!1,u._dragging=!0,i=e.clientX,a=e.clientY,l=e.target,o=(new Date).getTime(),o-u._mouseDownTime<L.DBLCLICKDELAY?c+=1:(c=1,u._mouseDownTime=o),t.prepFn&&t.prepFn(e,i,a),s=x(),s.onmousemove=r,s.onmouseup=n,s.onmouseout=n,_.Lib.pauseEvent(e)}function r(e){var r=e.clientX-i,n=e.clientY-a;return Math.abs(r)<L.MINDRAG&&(r=0),Math.abs(n)<L.MINDRAG&&(n=0),(r||n)&&(u._dragged=!0),t.moveFn&&t.moveFn(r,n,u._dragged),_.Lib.pauseEvent(e)}function n(e){if(s.onmousemove=null,s.onmouseup=null,s.onmouseout=null,_.Lib.removeElement(s),!u._dragging)return void(u._dragged=!1);if(u._dragging=!1,(new Date).getTime()-u._mouseDownTime>L.DBLCLICKDELAY&&(c=Math.max(c-1,1)),t.doneFn&&t.doneFn(u._dragged,c),!u._dragged){var r=document.createEvent(\"MouseEvents\");r.initEvent(\"click\",!0,!0),l.dispatchEvent(r)}return y(u),u._dragged=!1,_.Lib.pauseEvent(e)}var i,a,o,s,l,u=_.Lib.getPlotDiv(t.element)||{},c=1;u._mouseDownTime||(u._mouseDownTime=0),t.element.onmousedown=e,t.element.style.pointerEvents=\"all\"},L.setCursor=function(t,e){(t.attr(\"class\")||\"\").split(\" \").forEach(function(e){0===e.indexOf(\"cursor-\")&&t.classed(e,!1)}),e&&t.classed(\"cursor-\"+e,!0)},L.inbox=function(t,e){return 0>t*e||0===t?L.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{\"../../lib/events\":309,\"../../plotly\":330,d3:53,\"fast-isnumeric\":58,tinycolor2:213}],335:[function(t,e,r){var n=t(\"../../plotly\"),i=t(\"../font_attributes\"),a=t(\"../../components/color/attributes\"),o=t(\"../../lib/extend\").extendFlat;e.exports={title:{valType:\"string\"},titlefont:o({},i,{}),type:{valType:\"enumerated\",values:[\"-\",\"linear\",\"log\",\"date\",\"category\"],dflt:\"-\"},autorange:{valType:\"enumerated\",values:[!0,!1,\"reversed\"],dflt:!0},rangemode:{valType:\"enumerated\",values:[\"normal\",\"tozero\",\"nonnegative\"],dflt:\"normal\"},range:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},fixedrange:{valType:\"boolean\",dflt:!1},tickmode:{valType:\"enumerated\",values:[\"auto\",\"linear\",\"array\"]},nticks:{valType:\"integer\",min:0,dflt:0},tick0:{valType:\"number\",dflt:0},dtick:{valType:\"any\",dflt:1},tickvals:{valType:\"data_array\"},ticktext:{valType:\"data_array\"},ticks:{valType:\"enumerated\",values:[\"outside\",\"inside\",\"\"]},mirror:{valType:\"enumerated\",values:[!0,\"ticks\",!1,\"all\",\"allticks\"],dflt:!1},ticklen:{valType:\"number\",min:0,dflt:5},tickwidth:{valType:\"number\",min:0,dflt:1},tickcolor:{valType:\"color\",dflt:a.defaultLine},showticklabels:{valType:\"boolean\",dflt:!0},tickfont:o({},i,{}),tickangle:{valType:\"angle\",dflt:\"auto\"},tickprefix:{valType:\"string\",dflt:\"\"},showtickprefix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},ticksuffix:{valType:\"string\",dflt:\"\"},showticksuffix:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},showexponent:{valType:\"enumerated\",values:[\"all\",\"first\",\"last\",\"none\"],dflt:\"all\"},exponentformat:{valType:\"enumerated\",values:[\"none\",\"e\",\"E\",\"power\",\"SI\",\"B\"],dflt:\"B\"},tickformat:{valType:\"string\",dflt:\"\"},hoverformat:{valType:\"string\",dflt:\"\"},showline:{valType:\"boolean\",dflt:!1},linecolor:{valType:\"color\",dflt:a.defaultLine},linewidth:{valType:\"number\",min:0,dflt:1},showgrid:{valType:\"boolean\"},gridcolor:{valType:\"color\",dflt:a.lightLine},gridwidth:{valType:\"number\",min:0,dflt:1},zeroline:{valType:\"boolean\"},zerolinecolor:{valType:\"color\",dflt:a.defaultLine},zerolinewidth:{valType:\"number\",dflt:1},anchor:{valType:\"enumerated\",values:[\"free\",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},side:{valType:\"enumerated\",values:[\"top\",\"bottom\",\"left\",\"right\"]},overlaying:{valType:\"enumerated\",values:[\"free\",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},domain:{valType:\"info_array\",items:[{valType:\"number\",min:0,max:1},{valType:\"number\",min:0,max:1}],dflt:[0,1]},position:{valType:\"number\",min:0,max:1,dflt:0},_deprecated:{autotick:{valType:\"boolean\"}}}},{\"../../components/color/attributes\":282,\"../../lib/extend\":310,\"../../plotly\":330,\"../font_attributes\":336}],336:[function(t,e,r){e.exports={family:{valType:\"string\",noBlank:!0,strict:!0},size:{valType:\"number\",min:1},color:{valType:\"color\"}}},{}],337:[function(t,e,r){\"use strict\";function n(t,e){this.id=t.id,this.container=t.container,this.topojsonURL=t.topojsonURL,h(),this.showHover=\"closest\"===e.hovermode,this.hoverContainer=null,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework()}function i(t,e,r){return c.geo.graticule().extent([[t[0],e[0]],[t[1],e[1]]]).step(r)}function a(t,e,r){var n=m.layerNameToAdjective[e];t.select(\".\"+e).selectAll(\"path\").attr(\"stroke\",\"none\").call(u.Color.fill,r[n+\"color\"])}function o(t,e,r){var n=m.layerNameToAdjective[e];t.select(\".\"+e).selectAll(\"path\").attr(\"fill\",\"none\").call(u.Color.stroke,r[n+\"color\"]).call(u.Drawing.dashLine,\"\",r[n+\"width\"])}function s(t,e,r){t.select(\".\"+e+\"graticule\").selectAll(\"path\").attr(\"fill\",\"none\").call(u.Color.stroke,r[e].gridcolor).call(u.Drawing.dashLine,\"\",r[e].gridwidth)}function l(t){var e={type:\"linear\",showexponent:\"all\",exponentformat:u.Axes.layoutAttributes.exponentformat.dflt,_td:{_fullLayout:t}};return u.Axes.setConvert(e),e}var u=t(\"../../plotly\"),c=t(\"d3\"),h=t(\"./projections\"),f=t(\"./set_scale\"),d=t(\"./zoom\"),p=t(\"./zoom_reset\"),g=t(\"../../traces/scattergeo/plot\"),v=t(\"../../traces/choropleth/plot\"),m=t(\"../../constants/geo_constants\"),y=t(\"../../lib/topojson_utils\"),b=t(\"topojson\").feature;e.exports=n;var x=n.prototype;x.plot=function(t,e){var r,n,i=this,a=e[i.id],o=e._size;i.projection=null,i.setScale=f(a,o),i.makeProjection(a),i.makePath(),i.adjustLayout(a,o),i.zoom=d(i,a),i.zoomReset=p(i,a),i.mockAxis=l(e),i.framework.call(i.zoom).on(\"dblclick.zoom\",i.zoomReset),r=y.getTopojsonName(a),null===i.topojson||r!==i.topojsonName?(i.topojsonName=r,void 0!==PlotlyGeoAssets.topojson[i.topojsonName]?(i.topojson=PlotlyGeoAssets.topojson[i.topojsonName],i.onceTopojsonIsLoaded(t,a)):(n=y.getTopojsonPath(i.topojsonURL,i.topojsonName),c.json(n,function(e,r){i.topojson=r,PlotlyGeoAssets.topojson[i.topojsonName]=r,i.onceTopojsonIsLoaded(t,a)}))):i.onceTopojsonIsLoaded(t,a)},x.onceTopojsonIsLoaded=function(t,e){var r,n,i=[],a=[];this.drawLayout(e);for(var o=0;o<t.length;o++)r=t[o],n=r.type,\"scattergeo\"===r.type?i.push(r):\"choropleth\"===r.type&&a.push(r);i.length>0&&g.plot(this,i),a.length>0&&v.plot(this,a,e),this.render()},x.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=c.geo[m.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(m.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-m.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},x.makePath=function(){this.path=c.geo.path().projection(this.projection)},x.makeFramework=function(){var t=this.geoDiv=c.select(this.container).append(\"div\");t.attr(\"id\",this.id).style(\"position\",\"absolute\");var e=this.hoverContainer=t.append(\"svg\");e.attr({xmlns:\"http://www.w3.org/2000/svg\",\"xmlns:xmlns:xlink\":\"http://www.w3.org/1999/xlink\"}).style({position:\"absolute\",\"z-index\":20,\"pointer-events\":\"none\"});var r=this.framework=t.append(\"svg\");r.attr({xmlns:\"http://www.w3.org/2000/svg\",\"xmlns:xmlns:xlink\":\"http://www.w3.org/1999/xlink\",position:\"absolute\",preserveAspectRatio:\"none\"}),r.append(\"g\").attr(\"class\",\"bglayer\").append(\"rect\"),r.append(\"g\").attr(\"class\",\"baselayer\"),r.append(\"g\").attr(\"class\",\"choroplethlayer\"),r.append(\"g\").attr(\"class\",\"baselayeroverchoropleth\"),r.append(\"g\").attr(\"class\",\"scattergeolayer\"),r.on(\"dblclick.zoom\",null)},x.adjustLayout=function(t,e){var r=t.domain;this.geoDiv.style({left:e.l+e.w*r.x[0]+t._marginX+\"px\",top:e.t+e.h*(1-r.y[1])+t._marginY+\"px\",width:t._width+\"px\",height:t._height+\"px\"}),this.hoverContainer.attr({width:t._width,height:t._height}),this.framework.attr({width:t._width,height:t._height}),this.framework.select(\".bglayer\").select(\"rect\").attr({width:t._width,height:t._height}).style({fill:t.bgcolor,\"stroke-width\":0})},x.drawTopo=function(t,e,r){if(r[\"show\"+e]===!0){var n=this.topojson,i=\"frame\"===e?m.sphereSVG:b(n,n.objects[e]);t.append(\"g\").datum(i).attr(\"class\",e).append(\"path\").attr(\"class\",\"basepath\")}},x.drawGraticule=function(t,e,r){var n=r[e];if(n.showgrid===!0){var a=m.scopeDefaults[r.scope],o=a.lonaxisRange,s=a.lataxisRange,l=\"lonaxis\"===e?[n.dtick]:[0,n.dtick],u=i(o,s,l);t.append(\"g\").datum(u).attr(\"class\",e+\"graticule\").append(\"path\").attr(\"class\",\"graticulepath\")}},x.drawLayout=function(t){var e,r=this.framework.select(\"g.baselayer\"),n=m.baseLayers,i=m.axesNames;r.selectAll(\"*\").remove();for(var a=0;a<n.length;a++)e=n[a],-1!==i.indexOf(e)?this.drawGraticule(r,e,t):this.drawTopo(r,e,t);this.styleLayout(t)},x.styleLayer=function(t,e,r){var n=m.fillLayers,i=m.lineLayers;-1!==n.indexOf(e)?a(t,e,r):-1!==i.indexOf(e)&&o(t,e,r)},x.styleLayout=function(t){for(var e,r=this.framework.select(\"g.baselayer\"),n=m.baseLayers,i=m.axesNames,a=0;a<n.length;a++)e=n[a],-1!==i.indexOf(e)?s(r,e,t):this.styleLayer(r,e,t)},x.render=function(){function t(t){var e=a([t.lon,t.lat]);return e?\"translate(\"+e[0]+\",\"+e[1]+\")\":null}function e(t){var e=a.rotate(),r=c.geo.distance([t.lon,t.lat],[-e[0],-e[1]]),n=s*Math.PI/180;return r>n?\"0\":\"1.0\"}var r=this.framework,n=r.select(\"g.choroplethlayer\"),i=r.select(\"g.scattergeolayer\"),a=this.projection,o=this.path,s=this.clipAngle;r.selectAll(\"path.basepath\").attr(\"d\",o),r.selectAll(\"path.graticulepath\").attr(\"d\",o),n.selectAll(\"path.choroplethlocation\").attr(\"d\",o),n.selectAll(\"path.basepath\").attr(\"d\",o),i.selectAll(\"path.js-line\").attr(\"d\",o),null!==s?(i.selectAll(\"path.point\").style(\"opacity\",e).attr(\"transform\",t),i.selectAll(\"text\").style(\"opacity\",e).attr(\"transform\",t)):(i.selectAll(\"path.point\").attr(\"transform\",t),i.selectAll(\"text\").attr(\"transform\",t))}},{\"../../constants/geo_constants\":300,\"../../lib/topojson_utils\":325,\"../../plotly\":330,\"../../traces/choropleth/plot\":384,\"../../traces/scattergeo/plot\":407,\"./projections\":344,\"./set_scale\":345,\"./zoom\":346,\"./zoom_reset\":347,d3:53,topojson:214}],338:[function(t,e,r){e.exports={geo:{valType:\"geoid\",dflt:\"geo\"}}},{}],339:[function(t,e,r){var n=t(\"../../../components/color/attributes\");e.exports={range:{valType:\"info_array\",items:[{valType:\"number\"},{valType:\"number\"}]},showgrid:{valType:\"boolean\",dflt:!1},tick0:{valType:\"number\"},dtick:{valType:\"number\"},gridcolor:{valType:\"color\",dflt:n.lightLine},gridwidth:{valType:\"number\",min:0,dflt:1}}},{\"../../../components/color/attributes\":282}],340:[function(t,e,r){\"use strict\";var n=t(\"../../../plotly\"),i=t(\"../../../constants/geo_constants\"),a=t(\"./axis_attributes\");e.exports=function(t,e){function r(t,e){return n.Lib.coerce(c,h,a,t,e)}function o(t){var r,n,a,o,s,l,u=e.scope;return\"world\"===u?(r=e.projection,n=r.type,a=r.rotation,s=i[t+\"Span\"],l=void 0!==s[n]?s[n]/2:s[\"*\"]/2,o=\"lonaxis\"===t?a.lon:a.lat,[o-l,o+l]):i.scopeDefaults[u][t+\"Range\"]}for(var s=i.axesNames,l=0;l<s.length;l++){var u=s[l],c=t[u]||{},h={},f=o(u),d=r(\"range\",f);n.Lib.noneOrA
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment