Skip to content

Instantly share code, notes, and snippets.

@do9605
Last active April 14, 2021 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save do9605/0cec9a709161fd8ac2e9b62ae0a01849 to your computer and use it in GitHub Desktop.
Save do9605/0cec9a709161fd8ac2e9b62ae0a01849 to your computer and use it in GitHub Desktop.
dohee_baseball_datastory_modified1
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:31.411315Z",
"start_time": "2021-04-14T01:39:31.403809Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<style>.container {width:1060px !important;}</style>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from IPython.core.display import display, HTML\n",
"display(HTML('<style>.container {width:1060px !important;}</style>'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" <h1>KBO에서 메이저리그로 진출할 선수 예측 (타자편 2)<br></h1>\n",
" </head>\n",
" <body>\n",
" <Blockquote>\n",
" <font size=4>목차<br><br></font>\n",
" <font size=4>1. <a href='http://www.statiz.co.kr/main.php'>STATIZ</a> 사이트 크롤링<br><br></font>\n",
" <font size=4>2. 데이터 전처리<br><br></font>\n",
" <font size=4>3. 분석<br><br></font>\n",
" </Blockquote>\n",
" <font size=2><br>출처: <a href='http://ko.yagongso.wikidok.net/Wiki'>야구공작소</a></font>\n",
" <hr />\n",
" </body>\n",
"</html>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>이전 스토리에서 타율, 타점, 안타 등의 기본 지표를 <a href='https://www.koreabaseball.com/'>KBO 공식 사이트</a>에서 얻을 수 있었지만 다른 상세 지표들(wOBA, WAR 등)은 제공을 안합니다. ㅠㅠ<br><br></font>\n",
" <font size=3>그래서! 상세 지표를 제공하는 <a href='http://www.statiz.co.kr/main.php'>STATIZ</a> 사이트를 크롤링하여 필요한 데이터를 가져오려고 합니다.<br><br></font>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" <h2>1. <a href='http://www.statiz.co.kr/main.php'>STATIZ</a> 사이트 크롤링<br></h2>\n",
" </head>\n",
" <body>\n",
" </body>\n",
"</html>\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:39.345918Z",
"start_time": "2021-04-14T01:39:32.910721Z"
}
},
"outputs": [],
"source": [
"import pandas as pd\n",
"from bs4 import BeautifulSoup as bs\n",
"import requests\n",
"import pickle\n",
"import numpy as np\n",
"import plotly.express as px\n",
"import plotly.graph_objects as go\n",
"from plotly.subplots import make_subplots\n",
"from sklearn.preprocessing import scale\n",
"from sklearn import preprocessing\n",
"\n",
"pd.set_option('display.max_columns', None)\n",
"pd.set_option('display.max_colwidth', None)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:40.380451Z",
"start_time": "2021-04-14T01:39:40.273735Z"
}
},
"outputs": [],
"source": [
"with open('korean_majorleaguer_df.pickle', 'rb') as f:\n",
" ML_df = pickle.load(f)\n",
" \n",
"with open('korean_majorleaguer_dict.pickle', 'rb') as f:\n",
" ML_dict = pickle.load(f)\n",
" \n",
"with open('top10_hitter_url_df.pickle', 'rb') as f:\n",
" KBO_df = pickle.load(f)\n",
" \n",
"with open('top10_hitter_dict.pickle', 'rb') as f:\n",
" KBO_dict = pickle.load(f)\n",
"\n",
"# 한국인 메이저리거 중 타자 데이터\n",
"ML_hitter = ML_df.query('Position != \"투수\" and info_url != \"\"').reset_index(drop=True)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:40.902183Z",
"start_time": "2021-04-14T01:39:40.899067Z"
}
},
"outputs": [],
"source": [
"# 김하성 선수의 데이터 제거\n",
"ML_hitter.drop(ML_hitter[ML_hitter['Name']=='김하성'].index, axis=0, inplace=True)\n",
"ML_hitter.reset_index(drop=True, inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:42.065464Z",
"start_time": "2021-04-14T01:39:42.063604Z"
},
"code_folding": [
0
]
},
"outputs": [],
"source": [
"# base_url = 'http://www.kbreport.com/'\n",
"\n",
"# for idx, name in enumerate(ML_hitter['Name']):\n",
"# url = f'http://www.kbreport.com/player/list?key={name}&viewmode='\n",
"# req = requests.get(url)\n",
"# soup = bs(req.text, 'html.parser')\n",
"# total_url = ''\n",
" \n",
"# for td in soup.find('div', {'class': 'dca-content-box'}).findAll('td'):\n",
"# if 'href' in str(td):\n",
"# total_url = base_url + td.a.attrs['href']\n",
" \n",
"# if td.text.endswith(ML_hitter.loc[idx]['Birth_year'], 0, 4):\n",
"# ML_hitter['info_url'][idx] = total_url"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:42.530493Z",
"start_time": "2021-04-14T01:39:42.524905Z"
}
},
"outputs": [],
"source": [
"# 선수 정보가 담긴 statiz url 가져오기\n",
"def get_statiz_url(name, dataframe):\n",
" df = dataframe.copy()\n",
" base_url = 'http://www.statiz.co.kr/'\n",
" \n",
" for idx, name in enumerate(name):\n",
" url = f'http://www.statiz.co.kr/player.php?name={name}&search='\n",
" req = requests.get(url)\n",
" soup = bs(req.text, 'html.parser')\n",
" NAME_CHECK = False\n",
" \n",
" if '선수 선택' in soup.text:\n",
" for table in soup.findAll('table', class_='table table-striped'):\n",
" for a in table.findAll('a', href=True):\n",
" if df.loc[idx]['Birth_year'] in a['href']:\n",
" df['info_url'][idx] = base_url + a['href']\n",
" NAME_CHECK = True\n",
" \n",
" if NAME_CHECK:\n",
" url = df['info_url'][idx]\n",
" req = requests.get(url)\n",
" soup = bs(req.text, 'html.parser')\n",
" \n",
" for table in soup.findAll('table', class_='table'):\n",
" for a in soup.findAll('a', href=True):\n",
" if '연도별' in a.text.strip() and 'player' in a['href']:\n",
" df['info_url'][idx] = base_url + a['href']\n",
" break\n",
" return df"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:44.827373Z",
"start_time": "2021-04-14T01:39:44.825116Z"
},
"code_folding": [
0
]
},
"outputs": [],
"source": [
"# STATIZ 사이트에서 타자 선수들의 데이터 가져오기\n",
"# def get_url_from_statiz(name_series, df):\n",
"# base_url = 'http://www.statiz.co.kr/'\n",
" \n",
"# # 동명이인인 경우 태어난 년도로 구분하여 url 가져오기\n",
"# for idx, name in enumerate(name_series):\n",
"# url = f'http://www.statiz.co.kr/player.php?name={name}&search='\n",
"# req = requests.get(url)\n",
"# soup = bs(req.text, 'html.parser')\n",
"# extra_url = ''\n",
"\n",
"# multiple_name = soup.find('table', {'class': 'table table-striped'})\n",
"\n",
"# if multiple_name is None:\n",
"# df['info_url'][idx] = url\n",
"# else:\n",
"# for td in multiple_name.findAll('td'):\n",
"# if 'href' in str(td):\n",
"# extra_url = td.a.attrs['href']\n",
"\n",
"# if td.text.endswith(df['Birth_year'][idx], 0, 4):\n",
"# df['info_url'][idx] = base_url + extra_url\n",
" \n",
"# # 연도별 데이터가 있는 url 가져오기\n",
"# for idx, url in enumerate(df['info_url']):\n",
"# req = requests.get(url)\n",
"# soup = bs(req.text, 'html.parser')\n",
" \n",
"# for check, a in enumerate(soup.find('table', {'class': 'table'}).findAll('a')):\n",
"# if check == 1:\n",
"# df['info_url'][idx] = base_url + a.attrs['href']\n",
"# break\n",
" \n",
"# return df"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:45.194770Z",
"start_time": "2021-04-14T01:39:45.190979Z"
}
},
"outputs": [],
"source": [
"# statiz에서 데이터 크롤링\n",
"def get_info_dict(url_df):\n",
" temp_dict = {}\n",
" \n",
" for name, url in zip(url_df['Name'], url_df['info_url']):\n",
" req = requests.get(url)\n",
" soup = bs(req.text, 'html.parser')\n",
"\n",
" table = soup.find('table', {'class': 'table table-striped table-responsive table-condensed no-space table-bordered'})\n",
"\n",
" df = pd.read_html(str(table), header=1)[0]\n",
" df.drop(index=[len(df.index)-3], inplace=True) # 통산기록에서 column이 중복되어 삭제\n",
" df.reset_index(drop=True, inplace=True)\n",
" temp_dict[name] = df\n",
" \n",
" return temp_dict"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:52.598276Z",
"start_time": "2021-04-14T01:39:46.136346Z"
}
},
"outputs": [],
"source": [
"ML_hitter = get_statiz_url(ML_hitter['Name'], ML_hitter)\n",
"ML_dict = get_info_dict(ML_hitter)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:39:52.767410Z",
"start_time": "2021-04-14T01:39:52.761940Z"
}
},
"outputs": [],
"source": [
"Birth_year = [\n",
" '1983', '1988', '1993', '1988', '1998',\n",
" '1990', '1988', '1999', '1987', '1989'\n",
"]\n",
"\n",
"KBO_df['Birth_year'] = Birth_year\n",
"KBO_df = KBO_df[['Name', 'Birth_year', 'info_url']]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:06.650842Z",
"start_time": "2021-04-14T01:39:57.136484Z"
}
},
"outputs": [],
"source": [
"# 김하성 선수의 데이터 추가\n",
"extra_player = {'Name': '김하성', 'Birth_year': '1995', 'info_url': ''}\n",
"KBO_df = KBO_df.append(extra_player, ignore_index=True)\n",
"\n",
"KBO_df = get_statiz_url(KBO_df['Name'], KBO_df)\n",
"KBO_dict = get_info_dict(KBO_df)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:06.851587Z",
"start_time": "2021-04-14T01:40:06.821853Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Name</th>\n",
" <th>Birth_year</th>\n",
" <th>Position</th>\n",
" <th>info_url</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>강정호</td>\n",
" <td>1987</td>\n",
" <td>내야수</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EA%B0%95%EC%A0%95%ED%98%B8&amp;birth=1987-04-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>김현수</td>\n",
" <td>1988</td>\n",
" <td>외야수</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EA%B9%80%ED%98%84%EC%88%98&amp;birth=1988-01-12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>박병호</td>\n",
" <td>1986</td>\n",
" <td>내야수</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EB%B0%95%EB%B3%91%ED%98%B8&amp;birth=1986-07-10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>이대호</td>\n",
" <td>1982</td>\n",
" <td>내야수</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EC%9D%B4%EB%8C%80%ED%98%B8&amp;birth=1982-06-21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>최희섭</td>\n",
" <td>1979</td>\n",
" <td>내야수</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EC%B5%9C%ED%9D%AC%EC%84%AD&amp;birth=1979-03-16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>황재균</td>\n",
" <td>1987</td>\n",
" <td>내야수</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%ED%99%A9%EC%9E%AC%EA%B7%A0&amp;birth=1987-07-28</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Name Birth_year Position \\\n",
"0 강정호 1987 내야수 \n",
"1 김현수 1988 외야수 \n",
"2 박병호 1986 내야수 \n",
"3 이대호 1982 내야수 \n",
"4 최희섭 1979 내야수 \n",
"5 황재균 1987 내야수 \n",
"\n",
" info_url \n",
"0 http://www.statiz.co.kr/player.php?opt=1&name=%EA%B0%95%EC%A0%95%ED%98%B8&birth=1987-04-05 \n",
"1 http://www.statiz.co.kr/player.php?opt=1&name=%EA%B9%80%ED%98%84%EC%88%98&birth=1988-01-12 \n",
"2 http://www.statiz.co.kr/player.php?opt=1&name=%EB%B0%95%EB%B3%91%ED%98%B8&birth=1986-07-10 \n",
"3 http://www.statiz.co.kr/player.php?opt=1&name=%EC%9D%B4%EB%8C%80%ED%98%B8&birth=1982-06-21 \n",
"4 http://www.statiz.co.kr/player.php?opt=1&name=%EC%B5%9C%ED%9D%AC%EC%84%AD&birth=1979-03-16 \n",
"5 http://www.statiz.co.kr/player.php?opt=1&name=%ED%99%A9%EC%9E%AC%EA%B7%A0&birth=1987-07-28 "
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ML_hitter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>위의 데이터는 한국인 메이저리거 선수 중 '타자' 선수들의 데이터이고, 'info_url'은 선수들의 데이터가 있는 사이트 주소를 나타냅니다.<br><br></font>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:07.993124Z",
"start_time": "2021-04-14T01:40:07.986776Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Name</th>\n",
" <th>Birth_year</th>\n",
" <th>info_url</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>최형우</td>\n",
" <td>1983</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EC%B5%9C%ED%98%95%EC%9A%B0&amp;birth=1983-12-16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>손아섭</td>\n",
" <td>1988</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EC%86%90%EC%95%84%EC%84%AD&amp;birth=1988-03-18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>박민우</td>\n",
" <td>1993</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EB%B0%95%EB%AF%BC%EC%9A%B0&amp;birth=1993-02-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>페르난데스</td>\n",
" <td>1988</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%ED%8E%98%EB%A5%B4%EB%82%9C%EB%8D%B0%EC%8A%A4&amp;birth=1988-04-27</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>이정후</td>\n",
" <td>1998</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EC%9D%B4%EC%A0%95%ED%9B%84&amp;birth=1998-08-20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>허경민</td>\n",
" <td>1990</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%ED%97%88%EA%B2%BD%EB%AF%BC&amp;birth=1990-08-26</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>김현수</td>\n",
" <td>1988</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EA%B9%80%ED%98%84%EC%88%98&amp;birth=1988-01-12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>강백호</td>\n",
" <td>1999</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EA%B0%95%EB%B0%B1%ED%98%B8&amp;birth=1999-07-29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>양의지</td>\n",
" <td>1987</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EC%96%91%EC%9D%98%EC%A7%80&amp;birth=1987-06-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>나성범</td>\n",
" <td>1989</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EB%82%98%EC%84%B1%EB%B2%94&amp;birth=1989-10-03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>김하성</td>\n",
" <td>1995</td>\n",
" <td>http://www.statiz.co.kr/player.php?opt=1&amp;name=%EA%B9%80%ED%95%98%EC%84%B1&amp;birth=1995-10-17</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Name Birth_year \\\n",
"0 최형우 1983 \n",
"1 손아섭 1988 \n",
"2 박민우 1993 \n",
"3 페르난데스 1988 \n",
"4 이정후 1998 \n",
"5 허경민 1990 \n",
"6 김현수 1988 \n",
"7 강백호 1999 \n",
"8 양의지 1987 \n",
"9 나성범 1989 \n",
"10 김하성 1995 \n",
"\n",
" info_url \n",
"0 http://www.statiz.co.kr/player.php?opt=1&name=%EC%B5%9C%ED%98%95%EC%9A%B0&birth=1983-12-16 \n",
"1 http://www.statiz.co.kr/player.php?opt=1&name=%EC%86%90%EC%95%84%EC%84%AD&birth=1988-03-18 \n",
"2 http://www.statiz.co.kr/player.php?opt=1&name=%EB%B0%95%EB%AF%BC%EC%9A%B0&birth=1993-02-06 \n",
"3 http://www.statiz.co.kr/player.php?opt=1&name=%ED%8E%98%EB%A5%B4%EB%82%9C%EB%8D%B0%EC%8A%A4&birth=1988-04-27 \n",
"4 http://www.statiz.co.kr/player.php?opt=1&name=%EC%9D%B4%EC%A0%95%ED%9B%84&birth=1998-08-20 \n",
"5 http://www.statiz.co.kr/player.php?opt=1&name=%ED%97%88%EA%B2%BD%EB%AF%BC&birth=1990-08-26 \n",
"6 http://www.statiz.co.kr/player.php?opt=1&name=%EA%B9%80%ED%98%84%EC%88%98&birth=1988-01-12 \n",
"7 http://www.statiz.co.kr/player.php?opt=1&name=%EA%B0%95%EB%B0%B1%ED%98%B8&birth=1999-07-29 \n",
"8 http://www.statiz.co.kr/player.php?opt=1&name=%EC%96%91%EC%9D%98%EC%A7%80&birth=1987-06-05 \n",
"9 http://www.statiz.co.kr/player.php?opt=1&name=%EB%82%98%EC%84%B1%EB%B2%94&birth=1989-10-03 \n",
"10 http://www.statiz.co.kr/player.php?opt=1&name=%EA%B9%80%ED%95%98%EC%84%B1&birth=1995-10-17 "
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"KBO_df"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>위의 데이터는 2020년 KBO 리그(대한민국 프로 야구 리그) 타율 순으로 상위 10명의 선수들 데이터입니다.<br><br></font>\n",
" <font size=3>잠깐만요!! 선수들이 11명 있는데요??<br><br></font>\n",
" <font size=3>아! '김하성' 선수는 2021년 메이저리그로 가게 되어 메이저리거 선수 데이터에 들어있어야 하지만! 이전 기록들을 분석하여 어떻게 메이저리그로 갈 수 있었는지 확인해보기 위해 KBO 데이터에 추가하였습니다!!<br><br></font>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:09.395011Z",
"start_time": "2021-04-14T01:40:09.371693Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>연도</th>\n",
" <th>팀</th>\n",
" <th>나이</th>\n",
" <th>P</th>\n",
" <th>G</th>\n",
" <th>타석</th>\n",
" <th>타수</th>\n",
" <th>득점</th>\n",
" <th>안타</th>\n",
" <th>2타</th>\n",
" <th>3타</th>\n",
" <th>홈런</th>\n",
" <th>루타</th>\n",
" <th>타점</th>\n",
" <th>도루</th>\n",
" <th>도실</th>\n",
" <th>볼넷</th>\n",
" <th>사구</th>\n",
" <th>고4</th>\n",
" <th>삼진</th>\n",
" <th>병살</th>\n",
" <th>희타</th>\n",
" <th>희비</th>\n",
" <th>타율</th>\n",
" <th>출루</th>\n",
" <th>장타</th>\n",
" <th>OPS</th>\n",
" <th>wOBA</th>\n",
" <th>wRC+</th>\n",
" <th>WAR*</th>\n",
" <th>WPA</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2014</td>\n",
" <td>넥센</td>\n",
" <td>19</td>\n",
" <td>SS</td>\n",
" <td>60</td>\n",
" <td>59</td>\n",
" <td>48</td>\n",
" <td>17</td>\n",
" <td>9</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>19</td>\n",
" <td>7</td>\n",
" <td>4</td>\n",
" <td>3</td>\n",
" <td>8</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>13</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>0.188</td>\n",
" <td>0.298</td>\n",
" <td>0.396</td>\n",
" <td>0.694</td>\n",
" <td>0.298</td>\n",
" <td>57.7</td>\n",
" <td>-0.02</td>\n",
" <td>-0.42</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2015</td>\n",
" <td>넥센</td>\n",
" <td>20</td>\n",
" <td>SS</td>\n",
" <td>140</td>\n",
" <td>582</td>\n",
" <td>511</td>\n",
" <td>89</td>\n",
" <td>148</td>\n",
" <td>35</td>\n",
" <td>5</td>\n",
" <td>19</td>\n",
" <td>250</td>\n",
" <td>73</td>\n",
" <td>22</td>\n",
" <td>4</td>\n",
" <td>56</td>\n",
" <td>5</td>\n",
" <td>2</td>\n",
" <td>115</td>\n",
" <td>10</td>\n",
" <td>4</td>\n",
" <td>6</td>\n",
" <td>0.290</td>\n",
" <td>0.362</td>\n",
" <td>0.489</td>\n",
" <td>0.851</td>\n",
" <td>0.372</td>\n",
" <td>112.9</td>\n",
" <td>4.94</td>\n",
" <td>0.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2016</td>\n",
" <td>넥센</td>\n",
" <td>21</td>\n",
" <td>SS</td>\n",
" <td>144</td>\n",
" <td>599</td>\n",
" <td>526</td>\n",
" <td>92</td>\n",
" <td>148</td>\n",
" <td>29</td>\n",
" <td>7</td>\n",
" <td>20</td>\n",
" <td>251</td>\n",
" <td>84</td>\n",
" <td>28</td>\n",
" <td>15</td>\n",
" <td>60</td>\n",
" <td>6</td>\n",
" <td>2</td>\n",
" <td>80</td>\n",
" <td>7</td>\n",
" <td>2</td>\n",
" <td>5</td>\n",
" <td>0.281</td>\n",
" <td>0.359</td>\n",
" <td>0.477</td>\n",
" <td>0.836</td>\n",
" <td>0.370</td>\n",
" <td>104.8</td>\n",
" <td>3.81</td>\n",
" <td>1.12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2017</td>\n",
" <td>넥센</td>\n",
" <td>22</td>\n",
" <td>SS</td>\n",
" <td>141</td>\n",
" <td>601</td>\n",
" <td>526</td>\n",
" <td>90</td>\n",
" <td>159</td>\n",
" <td>36</td>\n",
" <td>3</td>\n",
" <td>23</td>\n",
" <td>270</td>\n",
" <td>114</td>\n",
" <td>16</td>\n",
" <td>8</td>\n",
" <td>58</td>\n",
" <td>8</td>\n",
" <td>2</td>\n",
" <td>65</td>\n",
" <td>8</td>\n",
" <td>2</td>\n",
" <td>7</td>\n",
" <td>0.302</td>\n",
" <td>0.376</td>\n",
" <td>0.513</td>\n",
" <td>0.889</td>\n",
" <td>0.385</td>\n",
" <td>125.4</td>\n",
" <td>4.91</td>\n",
" <td>3.21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2018</td>\n",
" <td>넥센</td>\n",
" <td>23</td>\n",
" <td>SS</td>\n",
" <td>129</td>\n",
" <td>576</td>\n",
" <td>511</td>\n",
" <td>95</td>\n",
" <td>147</td>\n",
" <td>27</td>\n",
" <td>4</td>\n",
" <td>20</td>\n",
" <td>242</td>\n",
" <td>84</td>\n",
" <td>8</td>\n",
" <td>2</td>\n",
" <td>54</td>\n",
" <td>5</td>\n",
" <td>2</td>\n",
" <td>81</td>\n",
" <td>16</td>\n",
" <td>1</td>\n",
" <td>5</td>\n",
" <td>0.288</td>\n",
" <td>0.358</td>\n",
" <td>0.474</td>\n",
" <td>0.832</td>\n",
" <td>0.360</td>\n",
" <td>108.5</td>\n",
" <td>3.56</td>\n",
" <td>1.01</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2019</td>\n",
" <td>키움</td>\n",
" <td>24</td>\n",
" <td>SS</td>\n",
" <td>139</td>\n",
" <td>625</td>\n",
" <td>540</td>\n",
" <td>112</td>\n",
" <td>166</td>\n",
" <td>38</td>\n",
" <td>2</td>\n",
" <td>19</td>\n",
" <td>265</td>\n",
" <td>104</td>\n",
" <td>33</td>\n",
" <td>4</td>\n",
" <td>70</td>\n",
" <td>7</td>\n",
" <td>4</td>\n",
" <td>80</td>\n",
" <td>12</td>\n",
" <td>1</td>\n",
" <td>7</td>\n",
" <td>0.307</td>\n",
" <td>0.389</td>\n",
" <td>0.491</td>\n",
" <td>0.880</td>\n",
" <td>0.397</td>\n",
" <td>145.7</td>\n",
" <td>7.17</td>\n",
" <td>4.52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2020</td>\n",
" <td>키움</td>\n",
" <td>25</td>\n",
" <td>SS</td>\n",
" <td>136</td>\n",
" <td>612</td>\n",
" <td>525</td>\n",
" <td>110</td>\n",
" <td>161</td>\n",
" <td>24</td>\n",
" <td>1</td>\n",
" <td>29</td>\n",
" <td>274</td>\n",
" <td>105</td>\n",
" <td>23</td>\n",
" <td>2</td>\n",
" <td>74</td>\n",
" <td>8</td>\n",
" <td>3</td>\n",
" <td>68</td>\n",
" <td>12</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>0.307</td>\n",
" <td>0.398</td>\n",
" <td>0.522</td>\n",
" <td>0.920</td>\n",
" <td>0.408</td>\n",
" <td>147.7</td>\n",
" <td>6.81</td>\n",
" <td>3.89</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>연도</td>\n",
" <td>팀</td>\n",
" <td>나이</td>\n",
" <td>P</td>\n",
" <td>G</td>\n",
" <td>타석</td>\n",
" <td>타수</td>\n",
" <td>득점</td>\n",
" <td>안타</td>\n",
" <td>2타</td>\n",
" <td>3타</td>\n",
" <td>홈런</td>\n",
" <td>루타</td>\n",
" <td>타점</td>\n",
" <td>도루</td>\n",
" <td>도실</td>\n",
" <td>볼넷</td>\n",
" <td>사구</td>\n",
" <td>고4</td>\n",
" <td>삼진</td>\n",
" <td>병살</td>\n",
" <td>희타</td>\n",
" <td>희비</td>\n",
" <td>타율</td>\n",
" <td>출루</td>\n",
" <td>장타</td>\n",
" <td>OPS</td>\n",
" <td>wOBA</td>\n",
" <td>wRC+</td>\n",
" <td>WAR*</td>\n",
" <td>WPA</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>7</td>\n",
" <td>통산</td>\n",
" <td>통산</td>\n",
" <td>SS</td>\n",
" <td>889</td>\n",
" <td>3654</td>\n",
" <td>3187</td>\n",
" <td>605</td>\n",
" <td>938</td>\n",
" <td>191</td>\n",
" <td>23</td>\n",
" <td>132</td>\n",
" <td>1571</td>\n",
" <td>571</td>\n",
" <td>134</td>\n",
" <td>38</td>\n",
" <td>380</td>\n",
" <td>39</td>\n",
" <td>15</td>\n",
" <td>502</td>\n",
" <td>67</td>\n",
" <td>14</td>\n",
" <td>34</td>\n",
" <td>0.294</td>\n",
" <td>0.373</td>\n",
" <td>0.493</td>\n",
" <td>0.866</td>\n",
" <td>0.381</td>\n",
" <td>121.6</td>\n",
" <td>31.19</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" 연도 팀 나이 P G 타석 타수 득점 안타 2타 3타 홈런 루타 타점 도루 \\\n",
"0 2014 넥센 19 SS 60 59 48 17 9 2 1 2 19 7 4 \n",
"1 2015 넥센 20 SS 140 582 511 89 148 35 5 19 250 73 22 \n",
"2 2016 넥센 21 SS 144 599 526 92 148 29 7 20 251 84 28 \n",
"3 2017 넥센 22 SS 141 601 526 90 159 36 3 23 270 114 16 \n",
"4 2018 넥센 23 SS 129 576 511 95 147 27 4 20 242 84 8 \n",
"5 2019 키움 24 SS 139 625 540 112 166 38 2 19 265 104 33 \n",
"6 2020 키움 25 SS 136 612 525 110 161 24 1 29 274 105 23 \n",
"7 연도 팀 나이 P G 타석 타수 득점 안타 2타 3타 홈런 루타 타점 도루 \n",
"8 7 통산 통산 SS 889 3654 3187 605 938 191 23 132 1571 571 134 \n",
"\n",
" 도실 볼넷 사구 고4 삼진 병살 희타 희비 타율 출루 장타 OPS wOBA wRC+ \\\n",
"0 3 8 0 0 13 2 2 1 0.188 0.298 0.396 0.694 0.298 57.7 \n",
"1 4 56 5 2 115 10 4 6 0.290 0.362 0.489 0.851 0.372 112.9 \n",
"2 15 60 6 2 80 7 2 5 0.281 0.359 0.477 0.836 0.370 104.8 \n",
"3 8 58 8 2 65 8 2 7 0.302 0.376 0.513 0.889 0.385 125.4 \n",
"4 2 54 5 2 81 16 1 5 0.288 0.358 0.474 0.832 0.360 108.5 \n",
"5 4 70 7 4 80 12 1 7 0.307 0.389 0.491 0.880 0.397 145.7 \n",
"6 2 74 8 3 68 12 2 3 0.307 0.398 0.522 0.920 0.408 147.7 \n",
"7 도실 볼넷 사구 고4 삼진 병살 희타 희비 타율 출루 장타 OPS wOBA wRC+ \n",
"8 38 380 39 15 502 67 14 34 0.294 0.373 0.493 0.866 0.381 121.6 \n",
"\n",
" WAR* WPA \n",
"0 -0.02 -0.42 \n",
"1 4.94 0.99 \n",
"2 3.81 1.12 \n",
"3 4.91 3.21 \n",
"4 3.56 1.01 \n",
"5 7.17 4.52 \n",
"6 6.81 3.89 \n",
"7 WAR* WPA \n",
"8 31.19 NaN "
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"KBO_dict['김하성']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>위의 데이터는 '김하성' 선수의 데이터입니다. column을 보면 안타, 홈런, 도루 이외에도 출루, 장타, OPS, 등 상세 지표까지 나와있는 것을 확인 할 수 있습니다.<br><br></font>\n",
" <font size=3>\"선수별로 저러한 데이터를 통해 분석이 되는구나~\" 라고 참고하시면 됩니다!<br><br><br><br></font> \n",
" <font size=3>* 편리성을 위해 아래와 같이 명칭을 정하려고 합니다.<br></font>\n",
" <Blockquote>\n",
" <font style=\"font-style: italic; font-size: 1.5em;\">한국인 메이저리거 타자 선수들&emsp;-->&emsp; 메이저리거 선수들<br><br>2020년 KBO 타율순으로 상위 10명의 타자 (+김하성 선수) &emsp;-->&emsp; KBO 상위 선수들</font>\n",
" </Blockquote>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>자! 이제 데이터도 가져왔으니 다음 메이저리그로 향할 선수는 누군지 예측하러 가기 전에!!<br><br></font>\n",
" <font size=3>데이터는 가져왔지만 아직 정제가 되어있지 않습니다. 즉, 데이터에 여러 문제점들이 있는데요.<br><br></font>\n",
" <font size=3>첫 번째, '타석' 값이 현저히 적은 경우가 있는데 한국프로야구에선 시즌이 마무리된 시점에서 총 경기수의 3.1배에서 소수점을 버린 수 만큼 타석에 들어서야만 타율, 출루율, 장타율 등의 지표가 기록으로 인정됩니다. 쉽게 말해 타석 수가 적으면 공식 기록으로 인정되지 않는다는 말입니다. 지표가 기록되기 위해 채워야 되는 타석을 '규정타석'이라고 하고 <span style=\" background: linear-gradient(to top, #FFE400 50%, transparent 50%)\">규정타석에 해당되지 않는 데이터의 삭제</span>가 필요합니다. &ensp; (출처 : <a href='https://namu.wiki/w/%EA%B7%9C%EC%A0%95%ED%83%80%EC%84%9D'>나무위키-규정타석</a>)<br><br></font>\n",
" <font size=3>두 번째, 규정타석에 해당하지 않는 데이터가 삭제되고 남은 데이터들에 해당하는 <span style=\" background: linear-gradient(to top, #FFE400 50%, transparent 50%)\">'통산 기록'이 갱신</span>되어야 합니다. 위에 '김하성' 선수의 데이터를 보면 마지막 행에 '통산'이라고 자신이 뛴 모든 경기의 평균 기록들이 있는데 이 부분이 갱신되어야 합니다.</font>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" <h2>2. 데이터 전처리<br></h2>\n",
" </head>\n",
" <body>\n",
" </body>\n",
"</html>\n"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:11.721553Z",
"start_time": "2021-04-14T01:40:11.675906Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>year</th>\n",
" <th>game_number</th>\n",
" <th>Rab</th>\n",
" <th>url</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2020</td>\n",
" <td>144</td>\n",
" <td>446</td>\n",
" <td>http://www.statiz.co.kr/league.php?opt=2020</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2019</td>\n",
" <td>144</td>\n",
" <td>446</td>\n",
" <td>http://www.statiz.co.kr/league.php?opt=2019</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2018</td>\n",
" <td>144</td>\n",
" <td>446</td>\n",
" <td>http://www.statiz.co.kr/league.php?opt=2018</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2017</td>\n",
" <td>144</td>\n",
" <td>446</td>\n",
" <td>http://www.statiz.co.kr/league.php?opt=2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2016</td>\n",
" <td>144</td>\n",
" <td>446</td>\n",
" <td>http://www.statiz.co.kr/league.php?opt=2016</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" year game_number Rab url\n",
"0 2020 144 446 http://www.statiz.co.kr/league.php?opt=2020\n",
"1 2019 144 446 http://www.statiz.co.kr/league.php?opt=2019\n",
"2 2018 144 446 http://www.statiz.co.kr/league.php?opt=2018\n",
"3 2017 144 446 http://www.statiz.co.kr/league.php?opt=2017\n",
"4 2016 144 446 http://www.statiz.co.kr/league.php?opt=2016"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Rab_data = pd.read_csv('./Rab_data.csv')\n",
"Rab_data.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>위의 데이터는 연도별 Rab(규정 타석) 데이터입니다. 해당 연도에 Rab(규정 타석)값보다 타석 수가 적으면 그 데이터는 제거되야 합니다.</font>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:14.995801Z",
"start_time": "2021-04-14T01:40:14.987346Z"
}
},
"outputs": [],
"source": [
"def data_preprocessing(df_dict, ML_CHECK=False):\n",
" ML_period = {'강정호': ['2015', '2016', '2017', '2018'], '김현수': ['2016', '2017'], '박병호': ['2016'],\n",
" '이대호': ['2016'], '최희섭': ['2002', '2003', '2004', '2005'], '황재균': ['2017']}\n",
" \n",
" # 통산기록 지우기\n",
" for name in df_dict.keys():\n",
" df_dict[name] = df_dict[name].iloc[:-2]\n",
" \n",
" # 중간 결측치 들어있는 행, 2021년 행 삭제\n",
" df_dict[name] = df_dict[name].dropna(subset=['연도'], axis=0)\n",
" df_dict[name] = df_dict[name].drop(df_dict[name][df_dict[name]['연도']=='2021'].index, axis=0)\n",
" \n",
" # 규정타석이 아닌 행 삭제\n",
" temp_df_dict = df_dict[name]\n",
"\n",
" for idx in df_dict[name].index:\n",
" if int(df_dict[name].loc[idx]['타석']) < Rab_data[Rab_data['year']==int(df_dict[name]['연도'][idx])].iloc[0][2]:\n",
" temp_df_dict = temp_df_dict.drop(idx, axis=0) \n",
"\n",
" df_dict[name] = temp_df_dict.reset_index(drop=True)\n",
" \n",
" # 메이저리거 선수 데이터에서 KBO 리그로 복귀 후의 KBO데이터 삭제\n",
" if ML_CHECK:\n",
" year = int(ML_period[name][-1])\n",
" df_dict[name] = df_dict[name].drop(df_dict[name][df_dict[name]['연도'].astype(int)>=year].index, axis=0)\n",
" \n",
" # 새로운 통산기록과 한 경기당 통산기록 추가\n",
" if not df_dict[name].empty:\n",
" df_dict[name].reset_index(drop=True, inplace=True) \n",
" \n",
" # 통산기록 추가\n",
" year_data_len = len(df_dict[name])\n",
" career_ls1 = [year_data_len, '통산', '통산', '']\n",
" career_ls2 = [year_data_len, '경기당', '통산', '']\n",
"\n",
" career_ls1.extend(df_dict[name].loc[:, 'G':'희비'].astype(int).sum().to_list())\n",
" career_ls1.extend(np.round(df_dict[name].loc[:, '타율':'WAR*'].astype(float).mean().to_list(), 3))\n",
" career_ls1.append('')\n",
" df_dict[name] = df_dict[name].append(df_dict[name].iloc[-1], ignore_index=True)\n",
" df_dict[name].iloc[-1] = career_ls1\n",
" \n",
" # 한 경기당 통산기록 추가\n",
" career_ls2.extend((df_dict[name].loc[year_data_len, 'G':'희비'] / df_dict[name].loc[year_data_len, 'G']).to_list())\n",
" career_ls2.extend(df_dict[name].loc[year_data_len, '타율':'WAR*'].to_list())\n",
" career_ls2.append('')\n",
" df_dict[name] = df_dict[name].append(df_dict[name].iloc[-1], ignore_index=True)\n",
" df_dict[name].iloc[-1] = career_ls2\n",
" \n",
" return df_dict"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:16.352356Z",
"start_time": "2021-04-14T01:40:16.211419Z"
}
},
"outputs": [],
"source": [
"ML_dict = data_preprocessing(ML_dict, True)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:19.204124Z",
"start_time": "2021-04-14T01:40:18.919594Z"
}
},
"outputs": [],
"source": [
"KBO_dict = data_preprocessing(KBO_dict)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:20.194127Z",
"start_time": "2021-04-14T01:40:20.171939Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>연도</th>\n",
" <th>팀</th>\n",
" <th>나이</th>\n",
" <th>P</th>\n",
" <th>G</th>\n",
" <th>타석</th>\n",
" <th>타수</th>\n",
" <th>득점</th>\n",
" <th>안타</th>\n",
" <th>2타</th>\n",
" <th>3타</th>\n",
" <th>홈런</th>\n",
" <th>루타</th>\n",
" <th>타점</th>\n",
" <th>도루</th>\n",
" <th>도실</th>\n",
" <th>볼넷</th>\n",
" <th>사구</th>\n",
" <th>고4</th>\n",
" <th>삼진</th>\n",
" <th>병살</th>\n",
" <th>희타</th>\n",
" <th>희비</th>\n",
" <th>타율</th>\n",
" <th>출루</th>\n",
" <th>장타</th>\n",
" <th>OPS</th>\n",
" <th>wOBA</th>\n",
" <th>wRC+</th>\n",
" <th>WAR*</th>\n",
" <th>WPA</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2015</td>\n",
" <td>넥센</td>\n",
" <td>20</td>\n",
" <td>SS</td>\n",
" <td>140</td>\n",
" <td>582</td>\n",
" <td>511</td>\n",
" <td>89</td>\n",
" <td>148</td>\n",
" <td>35</td>\n",
" <td>5</td>\n",
" <td>19</td>\n",
" <td>250</td>\n",
" <td>73</td>\n",
" <td>22</td>\n",
" <td>4</td>\n",
" <td>56</td>\n",
" <td>5</td>\n",
" <td>2</td>\n",
" <td>115</td>\n",
" <td>10</td>\n",
" <td>4</td>\n",
" <td>6</td>\n",
" <td>0.290</td>\n",
" <td>0.362</td>\n",
" <td>0.489</td>\n",
" <td>0.851</td>\n",
" <td>0.372</td>\n",
" <td>112.9</td>\n",
" <td>4.94</td>\n",
" <td>0.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2016</td>\n",
" <td>넥센</td>\n",
" <td>21</td>\n",
" <td>SS</td>\n",
" <td>144</td>\n",
" <td>599</td>\n",
" <td>526</td>\n",
" <td>92</td>\n",
" <td>148</td>\n",
" <td>29</td>\n",
" <td>7</td>\n",
" <td>20</td>\n",
" <td>251</td>\n",
" <td>84</td>\n",
" <td>28</td>\n",
" <td>15</td>\n",
" <td>60</td>\n",
" <td>6</td>\n",
" <td>2</td>\n",
" <td>80</td>\n",
" <td>7</td>\n",
" <td>2</td>\n",
" <td>5</td>\n",
" <td>0.281</td>\n",
" <td>0.359</td>\n",
" <td>0.477</td>\n",
" <td>0.836</td>\n",
" <td>0.370</td>\n",
" <td>104.8</td>\n",
" <td>3.81</td>\n",
" <td>1.12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2017</td>\n",
" <td>넥센</td>\n",
" <td>22</td>\n",
" <td>SS</td>\n",
" <td>141</td>\n",
" <td>601</td>\n",
" <td>526</td>\n",
" <td>90</td>\n",
" <td>159</td>\n",
" <td>36</td>\n",
" <td>3</td>\n",
" <td>23</td>\n",
" <td>270</td>\n",
" <td>114</td>\n",
" <td>16</td>\n",
" <td>8</td>\n",
" <td>58</td>\n",
" <td>8</td>\n",
" <td>2</td>\n",
" <td>65</td>\n",
" <td>8</td>\n",
" <td>2</td>\n",
" <td>7</td>\n",
" <td>0.302</td>\n",
" <td>0.376</td>\n",
" <td>0.513</td>\n",
" <td>0.889</td>\n",
" <td>0.385</td>\n",
" <td>125.4</td>\n",
" <td>4.91</td>\n",
" <td>3.21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2018</td>\n",
" <td>넥센</td>\n",
" <td>23</td>\n",
" <td>SS</td>\n",
" <td>129</td>\n",
" <td>576</td>\n",
" <td>511</td>\n",
" <td>95</td>\n",
" <td>147</td>\n",
" <td>27</td>\n",
" <td>4</td>\n",
" <td>20</td>\n",
" <td>242</td>\n",
" <td>84</td>\n",
" <td>8</td>\n",
" <td>2</td>\n",
" <td>54</td>\n",
" <td>5</td>\n",
" <td>2</td>\n",
" <td>81</td>\n",
" <td>16</td>\n",
" <td>1</td>\n",
" <td>5</td>\n",
" <td>0.288</td>\n",
" <td>0.358</td>\n",
" <td>0.474</td>\n",
" <td>0.832</td>\n",
" <td>0.360</td>\n",
" <td>108.5</td>\n",
" <td>3.56</td>\n",
" <td>1.01</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2019</td>\n",
" <td>키움</td>\n",
" <td>24</td>\n",
" <td>SS</td>\n",
" <td>139</td>\n",
" <td>625</td>\n",
" <td>540</td>\n",
" <td>112</td>\n",
" <td>166</td>\n",
" <td>38</td>\n",
" <td>2</td>\n",
" <td>19</td>\n",
" <td>265</td>\n",
" <td>104</td>\n",
" <td>33</td>\n",
" <td>4</td>\n",
" <td>70</td>\n",
" <td>7</td>\n",
" <td>4</td>\n",
" <td>80</td>\n",
" <td>12</td>\n",
" <td>1</td>\n",
" <td>7</td>\n",
" <td>0.307</td>\n",
" <td>0.389</td>\n",
" <td>0.491</td>\n",
" <td>0.880</td>\n",
" <td>0.397</td>\n",
" <td>145.7</td>\n",
" <td>7.17</td>\n",
" <td>4.52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2020</td>\n",
" <td>키움</td>\n",
" <td>25</td>\n",
" <td>SS</td>\n",
" <td>136</td>\n",
" <td>612</td>\n",
" <td>525</td>\n",
" <td>110</td>\n",
" <td>161</td>\n",
" <td>24</td>\n",
" <td>1</td>\n",
" <td>29</td>\n",
" <td>274</td>\n",
" <td>105</td>\n",
" <td>23</td>\n",
" <td>2</td>\n",
" <td>74</td>\n",
" <td>8</td>\n",
" <td>3</td>\n",
" <td>68</td>\n",
" <td>12</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>0.307</td>\n",
" <td>0.398</td>\n",
" <td>0.522</td>\n",
" <td>0.920</td>\n",
" <td>0.408</td>\n",
" <td>147.7</td>\n",
" <td>6.81</td>\n",
" <td>3.89</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>6</td>\n",
" <td>통산</td>\n",
" <td>통산</td>\n",
" <td></td>\n",
" <td>829</td>\n",
" <td>3595</td>\n",
" <td>3139</td>\n",
" <td>588</td>\n",
" <td>929</td>\n",
" <td>189</td>\n",
" <td>22</td>\n",
" <td>130</td>\n",
" <td>1552</td>\n",
" <td>564</td>\n",
" <td>130</td>\n",
" <td>35</td>\n",
" <td>372</td>\n",
" <td>39</td>\n",
" <td>15</td>\n",
" <td>489</td>\n",
" <td>65</td>\n",
" <td>12</td>\n",
" <td>33</td>\n",
" <td>0.296</td>\n",
" <td>0.374</td>\n",
" <td>0.494</td>\n",
" <td>0.868</td>\n",
" <td>0.382</td>\n",
" <td>124.167</td>\n",
" <td>5.2</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>6</td>\n",
" <td>경기당</td>\n",
" <td>통산</td>\n",
" <td></td>\n",
" <td>1.0</td>\n",
" <td>4.33655</td>\n",
" <td>3.78649</td>\n",
" <td>0.709288</td>\n",
" <td>1.120627</td>\n",
" <td>0.227986</td>\n",
" <td>0.026538</td>\n",
" <td>0.156815</td>\n",
" <td>1.872135</td>\n",
" <td>0.680338</td>\n",
" <td>0.156815</td>\n",
" <td>0.04222</td>\n",
" <td>0.448733</td>\n",
" <td>0.047045</td>\n",
" <td>0.018094</td>\n",
" <td>0.589867</td>\n",
" <td>0.078408</td>\n",
" <td>0.014475</td>\n",
" <td>0.039807</td>\n",
" <td>0.296</td>\n",
" <td>0.374</td>\n",
" <td>0.494</td>\n",
" <td>0.868</td>\n",
" <td>0.382</td>\n",
" <td>124.167</td>\n",
" <td>5.2</td>\n",
" <td></td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" 연도 팀 나이 P G 타석 타수 득점 안타 2타 \\\n",
"0 2015 넥센 20 SS 140 582 511 89 148 35 \n",
"1 2016 넥센 21 SS 144 599 526 92 148 29 \n",
"2 2017 넥센 22 SS 141 601 526 90 159 36 \n",
"3 2018 넥센 23 SS 129 576 511 95 147 27 \n",
"4 2019 키움 24 SS 139 625 540 112 166 38 \n",
"5 2020 키움 25 SS 136 612 525 110 161 24 \n",
"6 6 통산 통산 829 3595 3139 588 929 189 \n",
"7 6 경기당 통산 1.0 4.33655 3.78649 0.709288 1.120627 0.227986 \n",
"\n",
" 3타 홈런 루타 타점 도루 도실 볼넷 \\\n",
"0 5 19 250 73 22 4 56 \n",
"1 7 20 251 84 28 15 60 \n",
"2 3 23 270 114 16 8 58 \n",
"3 4 20 242 84 8 2 54 \n",
"4 2 19 265 104 33 4 70 \n",
"5 1 29 274 105 23 2 74 \n",
"6 22 130 1552 564 130 35 372 \n",
"7 0.026538 0.156815 1.872135 0.680338 0.156815 0.04222 0.448733 \n",
"\n",
" 사구 고4 삼진 병살 희타 희비 타율 출루 \\\n",
"0 5 2 115 10 4 6 0.290 0.362 \n",
"1 6 2 80 7 2 5 0.281 0.359 \n",
"2 8 2 65 8 2 7 0.302 0.376 \n",
"3 5 2 81 16 1 5 0.288 0.358 \n",
"4 7 4 80 12 1 7 0.307 0.389 \n",
"5 8 3 68 12 2 3 0.307 0.398 \n",
"6 39 15 489 65 12 33 0.296 0.374 \n",
"7 0.047045 0.018094 0.589867 0.078408 0.014475 0.039807 0.296 0.374 \n",
"\n",
" 장타 OPS wOBA wRC+ WAR* WPA \n",
"0 0.489 0.851 0.372 112.9 4.94 0.99 \n",
"1 0.477 0.836 0.370 104.8 3.81 1.12 \n",
"2 0.513 0.889 0.385 125.4 4.91 3.21 \n",
"3 0.474 0.832 0.360 108.5 3.56 1.01 \n",
"4 0.491 0.880 0.397 145.7 7.17 4.52 \n",
"5 0.522 0.920 0.408 147.7 6.81 3.89 \n",
"6 0.494 0.868 0.382 124.167 5.2 \n",
"7 0.494 0.868 0.382 124.167 5.2 "
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"KBO_dict['김하성']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>위의 데이터가 수정된 '김하성' 선수의 데이터입니다.<br><br></font>\n",
" <font size=3>'타석' 값이 어느정도 큰 것을 볼 수 있고 통산 기록이 바뀐 것을 알 수 있습니다.<br><br></font>\n",
" <font size=3>그리고 마지막 행에 '경기당' 이라는 단어를 보실 수 있는데 지표들을 전체 경기로 나눈 데이터들이 들어있습니다. 즉, '한 경기당 안타를 얼마나 쳤는지? 도루를 얼마나 성공했는지?' 를 나타낸다고 보시면 됩니다.</font> \n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:21.509252Z",
"start_time": "2021-04-14T01:40:21.506633Z"
}
},
"outputs": [],
"source": [
"# 파일로 저장!\n",
"\n",
"# with open('ML_dict_final.pickle', 'wb') as f:\n",
"# pickle.dump(ML_dict, f)\n",
" \n",
"# with open('KBO_dict_final.pickle', 'wb') as f:\n",
"# pickle.dump(KBO_dict, f)\n",
"\n",
"# with open('KBO_url_df.pickle', 'wb') as f:\n",
"# pickle.dump(KBO_df, f)\n",
" \n",
"# with open('ML_hitter_url_df.pickle', 'wb') as f:\n",
"# pickle.dump(ML_hitter, f)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:22.736035Z",
"start_time": "2021-04-14T01:40:22.687487Z"
}
},
"outputs": [],
"source": [
"ML_indicator_df = pd.DataFrame()\n",
"KBO_indicator_df = pd.DataFrame()\n",
"\n",
"for name in ML_dict.keys():\n",
" if not ML_dict[name].empty:\n",
" temp_df = ML_dict[name].loc[len(ML_dict[name])-1, 'G':'WAR*'].to_frame().transpose()\n",
" temp_df.insert(loc=0, column='이름', value=name)\n",
" ML_indicator_df = ML_indicator_df.append(temp_df, ignore_index=True) \n",
" \n",
"for name in KBO_dict.keys():\n",
" if not KBO_dict[name].empty:\n",
" temp_df = KBO_dict[name].loc[len(KBO_dict[name])-1, 'G':'WAR*'].to_frame().transpose()\n",
" temp_df.insert(loc=0, column='이름', value=name)\n",
" KBO_indicator_df = KBO_indicator_df.append(temp_df, ignore_index=True)\n",
"\n",
"modified_columns = {'도실': '도루 실패', '고4': '고의사구', '병살': '병살타', '희타': '희생번트', '희비': '희생플라이', '출루': '출루율', '장타': '장타율', 'WAR*': 'WAR'}\n",
"ML_indicator_df.rename(columns=modified_columns, inplace=True)\n",
"KBO_indicator_df.rename(columns=modified_columns, inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:23.371920Z",
"start_time": "2021-04-14T01:40:23.358714Z"
}
},
"outputs": [],
"source": [
"detailed_columns = ['이름', '타율', '출루율', '장타율', 'OPS', 'wOBA', 'wRC+', 'WAR']\n",
"temp_dict = {'이름': 'ML평균'}\n",
"temp_dict.update(ML_indicator_df.mean().to_dict())\n",
"ML_indicator_df = ML_indicator_df.append(temp_dict, ignore_index=True)\n",
"#ML_indicator_df.loc[:, detailed_columns]"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:23.780011Z",
"start_time": "2021-04-14T01:40:23.762947Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>이름</th>\n",
" <th>타율</th>\n",
" <th>출루율</th>\n",
" <th>장타율</th>\n",
" <th>OPS</th>\n",
" <th>wOBA</th>\n",
" <th>wRC+</th>\n",
" <th>WAR</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>최형우</td>\n",
" <td>0.318</td>\n",
" <td>0.406</td>\n",
" <td>0.55</td>\n",
" <td>0.956</td>\n",
" <td>0.42</td>\n",
" <td>150.446</td>\n",
" <td>5.032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>손아섭</td>\n",
" <td>0.328</td>\n",
" <td>0.403</td>\n",
" <td>0.477</td>\n",
" <td>0.88</td>\n",
" <td>0.398</td>\n",
" <td>135.218</td>\n",
" <td>4.68</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>박민우</td>\n",
" <td>0.332</td>\n",
" <td>0.406</td>\n",
" <td>0.436</td>\n",
" <td>0.842</td>\n",
" <td>0.384</td>\n",
" <td>124.829</td>\n",
" <td>4.157</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>페르난데스</td>\n",
" <td>0.342</td>\n",
" <td>0.406</td>\n",
" <td>0.492</td>\n",
" <td>0.898</td>\n",
" <td>0.408</td>\n",
" <td>151.1</td>\n",
" <td>4.745</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>이정후</td>\n",
" <td>0.337</td>\n",
" <td>0.398</td>\n",
" <td>0.469</td>\n",
" <td>0.867</td>\n",
" <td>0.389</td>\n",
" <td>129.925</td>\n",
" <td>4.492</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>허경민</td>\n",
" <td>0.31</td>\n",
" <td>0.368</td>\n",
" <td>0.406</td>\n",
" <td>0.774</td>\n",
" <td>0.352</td>\n",
" <td>105.02</td>\n",
" <td>2.826</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>김현수</td>\n",
" <td>0.325</td>\n",
" <td>0.406</td>\n",
" <td>0.5</td>\n",
" <td>0.906</td>\n",
" <td>0.405</td>\n",
" <td>145.818</td>\n",
" <td>4.914</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>강백호</td>\n",
" <td>0.318</td>\n",
" <td>0.395</td>\n",
" <td>0.523</td>\n",
" <td>0.916</td>\n",
" <td>0.404</td>\n",
" <td>140.8</td>\n",
" <td>3.843</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>양의지</td>\n",
" <td>0.317</td>\n",
" <td>0.394</td>\n",
" <td>0.505</td>\n",
" <td>0.899</td>\n",
" <td>0.398</td>\n",
" <td>140.971</td>\n",
" <td>5.069</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>나성범</td>\n",
" <td>0.314</td>\n",
" <td>0.381</td>\n",
" <td>0.537</td>\n",
" <td>0.918</td>\n",
" <td>0.4</td>\n",
" <td>133.743</td>\n",
" <td>4.769</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>김하성</td>\n",
" <td>0.296</td>\n",
" <td>0.374</td>\n",
" <td>0.494</td>\n",
" <td>0.868</td>\n",
" <td>0.382</td>\n",
" <td>124.167</td>\n",
" <td>5.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>ML평균</td>\n",
" <td>0.3086</td>\n",
" <td>0.396</td>\n",
" <td>0.5278</td>\n",
" <td>0.9238</td>\n",
" <td>0.4096</td>\n",
" <td>145.7396</td>\n",
" <td>5.3124</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" 이름 타율 출루율 장타율 OPS wOBA wRC+ WAR\n",
"0 최형우 0.318 0.406 0.55 0.956 0.42 150.446 5.032\n",
"1 손아섭 0.328 0.403 0.477 0.88 0.398 135.218 4.68\n",
"2 박민우 0.332 0.406 0.436 0.842 0.384 124.829 4.157\n",
"3 페르난데스 0.342 0.406 0.492 0.898 0.408 151.1 4.745\n",
"4 이정후 0.337 0.398 0.469 0.867 0.389 129.925 4.492\n",
"5 허경민 0.31 0.368 0.406 0.774 0.352 105.02 2.826\n",
"6 김현수 0.325 0.406 0.5 0.906 0.405 145.818 4.914\n",
"7 강백호 0.318 0.395 0.523 0.916 0.404 140.8 3.843\n",
"8 양의지 0.317 0.394 0.505 0.899 0.398 140.971 5.069\n",
"9 나성범 0.314 0.381 0.537 0.918 0.4 133.743 4.769\n",
"10 김하성 0.296 0.374 0.494 0.868 0.382 124.167 5.2\n",
"11 ML평균 0.3086 0.396 0.5278 0.9238 0.4096 145.7396 5.3124"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"detailed_columns = ['이름', '타율', '출루율', '장타율', 'OPS', 'wOBA', 'wRC+', 'WAR']\n",
"temp_dict = ML_indicator_df.iloc[-1].to_dict()\n",
"KBO_indicator_df = KBO_indicator_df.append(temp_dict, ignore_index=True)\n",
"KBO_indicator_df.loc[:, detailed_columns]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>이제 분석에 필요한 KBO 상위 선수들의 데이터와 메이저리거 평균 데이터를 가져왔는데...<br><br></font>\n",
" <font size=3>분산형 그래프를 그려 비교하려 하려던 찰나! <span style=\" background: linear-gradient(to top, #FFE400 50%, transparent 50%)\">wRC+의 값이 다른 지표들에 비해 확연히 큰게</span> 발견되었습니다.<br><br></font>\n",
" <font size=3>'정규화'를 통해 값의 크기를 맞추고자 합니다.<br><br></font>\n",
" <font size=3>정규화 방법에는 여러가지가 있지만 <span style=\" background: linear-gradient(to top, #FFE400 50%, transparent 50%)\">'최소 최대 정규화'</span>를 적용하고자 합니다.<br><br></font>\n",
" <font size=3><span style=\" background: linear-gradient(to top, #FFE400 50%, transparent 50%)\">'최소 최대 정규화'는 최솟값을 0으로 최댓값을 1로 나머지 값들을 0과 1사이의 값으로 변환하는 것을 말합니다.</span><br><br></font>\n",
" <font size=3>(예시 -> '타율' 지표에서 값이 제일 작은 김하성 선수의 값은 0으로 값이 제일 큰 페르난데스 선수의 값을 1로 두고 나머지 값들을 0에서 1사이로 분포한다)</font>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:27.699222Z",
"start_time": "2021-04-14T01:40:27.686636Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>이름</th>\n",
" <th>타율</th>\n",
" <th>출루율</th>\n",
" <th>장타율</th>\n",
" <th>OPS</th>\n",
" <th>wOBA</th>\n",
" <th>wRC+</th>\n",
" <th>WAR</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>최형우</td>\n",
" <td>0.478261</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.985807</td>\n",
" <td>0.887227</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>손아섭</td>\n",
" <td>0.695652</td>\n",
" <td>0.921053</td>\n",
" <td>0.493056</td>\n",
" <td>0.582418</td>\n",
" <td>0.676471</td>\n",
" <td>0.655339</td>\n",
" <td>0.745656</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>박민우</td>\n",
" <td>0.782609</td>\n",
" <td>1.0</td>\n",
" <td>0.208333</td>\n",
" <td>0.373626</td>\n",
" <td>0.470588</td>\n",
" <td>0.429883</td>\n",
" <td>0.535312</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>페르난데스</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.597222</td>\n",
" <td>0.681319</td>\n",
" <td>0.823529</td>\n",
" <td>1.0</td>\n",
" <td>0.771799</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>이정후</td>\n",
" <td>0.891304</td>\n",
" <td>0.789474</td>\n",
" <td>0.4375</td>\n",
" <td>0.510989</td>\n",
" <td>0.544118</td>\n",
" <td>0.540473</td>\n",
" <td>0.670045</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>허경민</td>\n",
" <td>0.304348</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>김현수</td>\n",
" <td>0.630435</td>\n",
" <td>1.0</td>\n",
" <td>0.652778</td>\n",
" <td>0.725275</td>\n",
" <td>0.779412</td>\n",
" <td>0.885373</td>\n",
" <td>0.839768</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>강백호</td>\n",
" <td>0.478261</td>\n",
" <td>0.710526</td>\n",
" <td>0.8125</td>\n",
" <td>0.78022</td>\n",
" <td>0.764706</td>\n",
" <td>0.776476</td>\n",
" <td>0.409025</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>양의지</td>\n",
" <td>0.456522</td>\n",
" <td>0.684211</td>\n",
" <td>0.6875</td>\n",
" <td>0.686813</td>\n",
" <td>0.676471</td>\n",
" <td>0.780187</td>\n",
" <td>0.902107</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>나성범</td>\n",
" <td>0.391304</td>\n",
" <td>0.342105</td>\n",
" <td>0.909722</td>\n",
" <td>0.791209</td>\n",
" <td>0.705882</td>\n",
" <td>0.623329</td>\n",
" <td>0.781451</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>김하성</td>\n",
" <td>0.0</td>\n",
" <td>0.157895</td>\n",
" <td>0.611111</td>\n",
" <td>0.516484</td>\n",
" <td>0.441176</td>\n",
" <td>0.415516</td>\n",
" <td>0.954794</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>ML평균</td>\n",
" <td>0.273913</td>\n",
" <td>0.736842</td>\n",
" <td>0.845833</td>\n",
" <td>0.823077</td>\n",
" <td>0.847059</td>\n",
" <td>0.883672</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" 이름 타율 출루율 장타율 OPS wOBA wRC+ \\\n",
"0 최형우 0.478261 1.0 1.0 1.0 1.0 0.985807 \n",
"1 손아섭 0.695652 0.921053 0.493056 0.582418 0.676471 0.655339 \n",
"2 박민우 0.782609 1.0 0.208333 0.373626 0.470588 0.429883 \n",
"3 페르난데스 1.0 1.0 0.597222 0.681319 0.823529 1.0 \n",
"4 이정후 0.891304 0.789474 0.4375 0.510989 0.544118 0.540473 \n",
"5 허경민 0.304348 0.0 0.0 0.0 0.0 0.0 \n",
"6 김현수 0.630435 1.0 0.652778 0.725275 0.779412 0.885373 \n",
"7 강백호 0.478261 0.710526 0.8125 0.78022 0.764706 0.776476 \n",
"8 양의지 0.456522 0.684211 0.6875 0.686813 0.676471 0.780187 \n",
"9 나성범 0.391304 0.342105 0.909722 0.791209 0.705882 0.623329 \n",
"10 김하성 0.0 0.157895 0.611111 0.516484 0.441176 0.415516 \n",
"11 ML평균 0.273913 0.736842 0.845833 0.823077 0.847059 0.883672 \n",
"\n",
" WAR \n",
"0 0.887227 \n",
"1 0.745656 \n",
"2 0.535312 \n",
"3 0.771799 \n",
"4 0.670045 \n",
"5 0.0 \n",
"6 0.839768 \n",
"7 0.409025 \n",
"8 0.902107 \n",
"9 0.781451 \n",
"10 0.954794 \n",
"11 1.0 "
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"detailed_columns = ['이름', '타율', '출루율', '장타율', 'OPS', 'wOBA', 'wRC+', 'WAR']\n",
"scaler = preprocessing.MinMaxScaler()\n",
"\n",
"KBO_indicator_df_norm = KBO_indicator_df.copy()\n",
"KBO_indicator_df_norm.iloc[:, 1:] = scaler.fit_transform(KBO_indicator_df_norm.iloc[:, 1:])\n",
"KBO_indicator_df_norm.loc[:, detailed_columns]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<html>\n",
" <head>\n",
" <meta charset='utf-8'>\n",
" </head>\n",
" <body>\n",
" <font size=3>'최소 최대 정규화'를 적용후 값의 스케일이 통일되었으니 분산형 그래프를 그려보겠습니다!<br><br></font>\n",
" </body>\n",
" <hr />\n",
"</html>"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"ExecuteTime": {
"end_time": "2021-04-14T01:40:31.684183Z",
"start_time": "2021-04-14T01:40:30.401167Z"
},
"code_folding": [
28
]
},
"outputs": [
{
"data": {
"text/html": [
" <script type=\"text/javascript\">\n",
" window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
" if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
" if (typeof require !== 'undefined') {\n",
" require.undef(\"plotly\");\n",
" define('plotly', function(require, exports, module) {\n",
" /**\n",
"* plotly.js v1.58.4\n",
"* Copyright 2012-2020, Plotly, Inc.\n",
"* All rights reserved.\n",
"* Licensed under the MIT license\n",
"*/\n",
"!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l=\"function\"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,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/lib\"),i={\"X,X div\":\"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\"X input,X button\":\"font-family:'Open Sans', verdana, arial, sans-serif;\",\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .cursor-grab\":\"cursor:-webkit-grab;cursor:grab;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;\",\"X .ease-bg\":\"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;\",\"X .modebar--hover>:not(.watermark)\":\"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 .modebar-group\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar.vertical\":\"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;\",\"X .modebar.vertical svg\":\"top:-1px;\",\"X .modebar.vertical .modebar-group\":\"display:block;float:none;padding-left:0px;padding-bottom:8px;\",\"X .modebar.vertical .modebar-group .modebar-btn\":\"display:block;text-align:center;\",\"X [data-title]:before,X [data-title]:after\":\"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\"X [data-title]:hover:before,X [data-title]:hover:after\":\"display:block;opacity:1;\",\"X [data-title]:before\":\"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;\",\"X [data-title]:after\":\"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;\",\"X .vertical [data-title]:before,X .vertical [data-title]:after\":\"top:0%;right:200%;\",\"X .vertical [data-title]:before\":\"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;\",\"X .select-outline\":\"fill:none;stroke-width:1;shape-rendering:crispEdges;\",\"X .select-outline-1\":\"stroke:white;\",\"X .select-outline-2\":\"stroke:black;stroke-dasharray:2px 2px;\",Y:\"font-family:'Open Sans', verdana, arial, sans-serif;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;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;\",\"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.addStyleRule(o,i[a])}},{\"../src/lib\":778}],2:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/aggregate\")},{\"../src/transforms/aggregate\":1365}],3:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/bar\")},{\"../src/traces/bar\":929}],4:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/barpolar\")},{\"../src/traces/barpolar\":942}],5:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/box\")},{\"../src/traces/box\":952}],6:[function(t,e,r){\"use strict\";e.exports=t(\"../src/components/calendars\")},{\"../src/components/calendars\":641}],7:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/candlestick\")},{\"../src/traces/candlestick\":961}],8:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/carpet\")},{\"../src/traces/carpet\":980}],9:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/choropleth\")},{\"../src/traces/choropleth\":994}],10:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/choroplethmapbox\")},{\"../src/traces/choroplethmapbox\":1001}],11:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/cone\")},{\"../src/traces/cone\":1007}],12:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contour\")},{\"../src/traces/contour\":1022}],13:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contourcarpet\")},{\"../src/traces/contourcarpet\":1033}],14:[function(t,e,r){\"use strict\";e.exports=t(\"../src/core\")},{\"../src/core\":755}],15:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/densitymapbox\")},{\"../src/traces/densitymapbox\":1041}],16:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/filter\")},{\"../src/transforms/filter\":1366}],17:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/funnel\")},{\"../src/traces/funnel\":1051}],18:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/funnelarea\")},{\"../src/traces/funnelarea\":1060}],19:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/groupby\")},{\"../src/transforms/groupby\":1367}],20:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmap\")},{\"../src/traces/heatmap\":1073}],21:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmapgl\")},{\"../src/traces/heatmapgl\":1083}],22:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram\")},{\"../src/traces/histogram\":1095}],23:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2d\")},{\"../src/traces/histogram2d\":1101}],24:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2dcontour\")},{\"../src/traces/histogram2dcontour\":1105}],25:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/image\")},{\"../src/traces/image\":1113}],26:[function(t,e,r){\"use strict\";var n=t(\"./core\");n.register([t(\"./bar\"),t(\"./box\"),t(\"./heatmap\"),t(\"./histogram\"),t(\"./histogram2d\"),t(\"./histogram2dcontour\"),t(\"./contour\"),t(\"./scatterternary\"),t(\"./violin\"),t(\"./funnel\"),t(\"./waterfall\"),t(\"./image\"),t(\"./pie\"),t(\"./sunburst\"),t(\"./treemap\"),t(\"./funnelarea\"),t(\"./scatter3d\"),t(\"./surface\"),t(\"./isosurface\"),t(\"./volume\"),t(\"./mesh3d\"),t(\"./cone\"),t(\"./streamtube\"),t(\"./scattergeo\"),t(\"./choropleth\"),t(\"./scattergl\"),t(\"./splom\"),t(\"./pointcloud\"),t(\"./heatmapgl\"),t(\"./parcoords\"),t(\"./parcats\"),t(\"./scattermapbox\"),t(\"./choroplethmapbox\"),t(\"./densitymapbox\"),t(\"./sankey\"),t(\"./indicator\"),t(\"./table\"),t(\"./carpet\"),t(\"./scattercarpet\"),t(\"./contourcarpet\"),t(\"./ohlc\"),t(\"./candlestick\"),t(\"./scatterpolar\"),t(\"./scatterpolargl\"),t(\"./barpolar\")]),n.register([t(\"./aggregate\"),t(\"./filter\"),t(\"./groupby\"),t(\"./sort\")]),n.register([t(\"./calendars\")]),e.exports=n},{\"./aggregate\":2,\"./bar\":3,\"./barpolar\":4,\"./box\":5,\"./calendars\":6,\"./candlestick\":7,\"./carpet\":8,\"./choropleth\":9,\"./choroplethmapbox\":10,\"./cone\":11,\"./contour\":12,\"./contourcarpet\":13,\"./core\":14,\"./densitymapbox\":15,\"./filter\":16,\"./funnel\":17,\"./funnelarea\":18,\"./groupby\":19,\"./heatmap\":20,\"./heatmapgl\":21,\"./histogram\":22,\"./histogram2d\":23,\"./histogram2dcontour\":24,\"./image\":25,\"./indicator\":27,\"./isosurface\":28,\"./mesh3d\":29,\"./ohlc\":30,\"./parcats\":31,\"./parcoords\":32,\"./pie\":33,\"./pointcloud\":34,\"./sankey\":35,\"./scatter3d\":36,\"./scattercarpet\":37,\"./scattergeo\":38,\"./scattergl\":39,\"./scattermapbox\":40,\"./scatterpolar\":41,\"./scatterpolargl\":42,\"./scatterternary\":43,\"./sort\":44,\"./splom\":45,\"./streamtube\":46,\"./sunburst\":47,\"./surface\":48,\"./table\":49,\"./treemap\":50,\"./violin\":51,\"./volume\":52,\"./waterfall\":53}],27:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/indicator\")},{\"../src/traces/indicator\":1121}],28:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/isosurface\")},{\"../src/traces/isosurface\":1127}],29:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/mesh3d\")},{\"../src/traces/mesh3d\":1132}],30:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/ohlc\")},{\"../src/traces/ohlc\":1137}],31:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/parcats\")},{\"../src/traces/parcats\":1146}],32:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/parcoords\")},{\"../src/traces/parcoords\":1156}],33:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pie\")},{\"../src/traces/pie\":1167}],34:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pointcloud\")},{\"../src/traces/pointcloud\":1176}],35:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/sankey\")},{\"../src/traces/sankey\":1182}],36:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatter3d\")},{\"../src/traces/scatter3d\":1220}],37:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattercarpet\")},{\"../src/traces/scattercarpet\":1227}],38:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergeo\")},{\"../src/traces/scattergeo\":1235}],39:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergl\")},{\"../src/traces/scattergl\":1248}],40:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattermapbox\")},{\"../src/traces/scattermapbox\":1258}],41:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterpolar\")},{\"../src/traces/scatterpolar\":1266}],42:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterpolargl\")},{\"../src/traces/scatterpolargl\":1273}],43:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterternary\")},{\"../src/traces/scatterternary\":1281}],44:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/sort\")},{\"../src/transforms/sort\":1369}],45:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/splom\")},{\"../src/traces/splom\":1290}],46:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/streamtube\")},{\"../src/traces/streamtube\":1298}],47:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/sunburst\")},{\"../src/traces/sunburst\":1306}],48:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/surface\")},{\"../src/traces/surface\":1315}],49:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/table\")},{\"../src/traces/table\":1323}],50:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/treemap\")},{\"../src/traces/treemap\":1332}],51:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/violin\")},{\"../src/traces/violin\":1344}],52:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/volume\")},{\"../src/traces/volume\":1352}],53:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/waterfall\")},{\"../src/traces/waterfall\":1360}],54:[function(t,e,r){\"use strict\";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||\"turntable\",u=n(),f=i(),h=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:u,orbit:f,matrix:h},c)};var n=t(\"turntable-camera-controller\"),i=t(\"orbit-camera-controller\"),a=t(\"matrix-camera-controller\");function o(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}var s=o.prototype;[[\"flush\",1],[\"idle\",1],[\"lookAt\",4],[\"rotate\",4],[\"pan\",4],[\"translate\",4],[\"setMatrix\",2],[\"setDistanceLimits\",2],[\"setDistance\",2]].forEach((function(t){for(var e=t[0],r=[],n=0;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()+\")}\";s[e]=Function.apply(null,r.concat(i))})),s.recalcMatrix=function(t){this._active.recalcMatrix(t)},s.getDistance=function(t){return this._active.getDistance(t)},s.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},s.lastT=function(){return this._active.lastT()},s.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){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}}},s.getMode=function(){return this._mode}},{\"matrix-camera-controller\":480,\"orbit-camera-controller\":501,\"turntable-camera-controller\":581}],55:[function(t,e,r){!function(n,i){\"object\"==typeof r&&\"undefined\"!=typeof e?i(r,t(\"d3-array\"),t(\"d3-collection\"),t(\"d3-shape\"),t(\"elementary-circuits-directed-graph\")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3,null)}(this,(function(t,e,r,n,i){\"use strict\";function a(t){return t.target.depth}function o(t,e){return t.sourceLinks.length?t.depth:e-1}function s(t){return function(){return t}}i=i&&i.hasOwnProperty(\"default\")?i.default:i;var l=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t};function c(t,e){return f(t.source,e.source)||t.index-e.index}function u(t,e){return f(t.target,e.target)||t.index-e.index}function f(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:\"top\"===t.circularLinkType||\"bottom\"===e.circularLinkType?-1:1}function h(t){return t.value}function p(t){return(t.y0+t.y1)/2}function d(t){return p(t.source)}function g(t){return p(t.target)}function m(t){return t.index}function v(t){return t.nodes}function y(t){return t.links}function x(t,e){var r=t.get(e);if(!r)throw new Error(\"missing: \"+e);return r}function b(t,e){return e(t)}function _(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o<t.links.length;o++){var s=t.links[o],l=s.source.index,c=s.target.index;a[l]||(a[l]=[]),a[c]||(a[c]=[]),-1===a[l].indexOf(c)&&a[l].push(c)}var u=i(a);u.sort((function(t,e){return t.length-e.length}));var f={};for(o=0;o<u.length;o++){var h=u[o].slice(-2);f[h[0]]||(f[h[0]]={}),f[h[0]][h[1]]=!0}t.links.forEach((function(t){var e=t.target.index,r=t.source.index;e===r||f[r]&&f[r][e]?(t.circular=!0,t.circularLinkID=n,n+=1):t.circular=!1}))}else t.links.forEach((function(t){t.source[r]<t.target[r]?t.circular=!1:(t.circular=!0,t.circularLinkID=n,n+=1)}))}function w(t,e){var r=0,n=0;t.links.forEach((function(i){i.circular&&(i.source.circularLinkType||i.target.circularLinkType?i.circularLinkType=i.source.circularLinkType?i.source.circularLinkType:i.target.circularLinkType:i.circularLinkType=r<n?\"top\":\"bottom\",\"top\"==i.circularLinkType?r+=1:n+=1,t.nodes.forEach((function(t){b(t,e)!=b(i.source,e)&&b(t,e)!=b(i.target,e)||(t.circularLinkType=i.circularLinkType)})))})),t.links.forEach((function(t){t.circular&&(t.source.circularLinkType==t.target.circularLinkType&&(t.circularLinkType=t.source.circularLinkType),H(t,e)&&(t.circularLinkType=t.source.circularLinkType))}))}function T(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function k(t,e){var r=0;t.sourceLinks.forEach((function(t){r=t.circular&&!H(t,e)?r+1:r}));var n=0;return t.targetLinks.forEach((function(t){n=t.circular&&!H(t,e)?n+1:n})),r+n}function M(t){var e=t.source.sourceLinks,r=0;e.forEach((function(t){r=t.circular?r+1:r}));var n=t.target.targetLinks,i=0;return n.forEach((function(t){i=t.circular?i+1:i})),!(r>1||i>1)}function A(t,e,r){return t.sort(E),t.forEach((function(n,i){var a,o,s=0;if(H(n,r)&&M(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;l<i;l++)if(a=t[i],o=t[l],!(a.source.column<o.target.column||a.target.column>o.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function S(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),A(t.links.filter((function(t){return\"top\"==t.circularLinkType})),r,a),A(t.links.filter((function(t){return\"bottom\"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+10,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,H(e,a)&&M(e))e.circularPathData.leftSmallArcRadius=10+e.width/2,e.circularPathData.leftLargeArcRadius=10+e.width/2,e.circularPathData.rightSmallArcRadius=10+e.width/2,e.circularPathData.rightLargeArcRadius=10+e.width/2,\"bottom\"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));\"bottom\"==e.circularLinkType?c.sort(L):c.sort(C);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=10+e.width/2+u,e.circularPathData.leftLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),\"bottom\"==e.circularLinkType?c.sort(P):c.sort(I),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=10+e.width/2+u,e.circularPathData.rightLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),\"bottom\"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){var e=\"\";e=\"top\"==t.circularLinkType?\"M\"+t.circularPathData.sourceX+\" \"+t.circularPathData.sourceY+\" L\"+t.circularPathData.leftInnerExtent+\" \"+t.circularPathData.sourceY+\" A\"+t.circularPathData.leftLargeArcRadius+\" \"+t.circularPathData.leftSmallArcRadius+\" 0 0 0 \"+t.circularPathData.leftFullExtent+\" \"+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+\" L\"+t.circularPathData.leftFullExtent+\" \"+t.circularPathData.verticalLeftInnerExtent+\" A\"+t.circularPathData.leftLargeArcRadius+\" \"+t.circularPathData.leftLargeArcRadius+\" 0 0 0 \"+t.circularPathData.leftInnerExtent+\" \"+t.circularPathData.verticalFullExtent+\" L\"+t.circularPathData.rightInnerExtent+\" \"+t.circularPathData.verticalFullExtent+\" A\"+t.circularPathData.rightLargeArcRadius+\" \"+t.circularPathData.rightLargeArcRadius+\" 0 0 0 \"+t.circularPathData.rightFullExtent+\" \"+t.circularPathData.verticalRightInnerExtent+\" L\"+t.circularPathData.rightFullExtent+\" \"+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+\" A\"+t.circularPathData.rightLargeArcRadius+\" \"+t.circularPathData.rightSmallArcRadius+\" 0 0 0 \"+t.circularPathData.rightInnerExtent+\" \"+t.circularPathData.targetY+\" L\"+t.circularPathData.targetX+\" \"+t.circularPathData.targetY:\"M\"+t.circularPathData.sourceX+\" \"+t.circularPathData.sourceY+\" L\"+t.circularPathData.leftInnerExtent+\" \"+t.circularPathData.sourceY+\" A\"+t.circularPathData.leftLargeArcRadius+\" \"+t.circularPathData.leftSmallArcRadius+\" 0 0 1 \"+t.circularPathData.leftFullExtent+\" \"+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+\" L\"+t.circularPathData.leftFullExtent+\" \"+t.circularPathData.verticalLeftInnerExtent+\" A\"+t.circularPathData.leftLargeArcRadius+\" \"+t.circularPathData.leftLargeArcRadius+\" 0 0 1 \"+t.circularPathData.leftInnerExtent+\" \"+t.circularPathData.verticalFullExtent+\" L\"+t.circularPathData.rightInnerExtent+\" \"+t.circularPathData.verticalFullExtent+\" A\"+t.circularPathData.rightLargeArcRadius+\" \"+t.circularPathData.rightLargeArcRadius+\" 0 0 1 \"+t.circularPathData.rightFullExtent+\" \"+t.circularPathData.verticalRightInnerExtent+\" L\"+t.circularPathData.rightFullExtent+\" \"+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+\" A\"+t.circularPathData.rightLargeArcRadius+\" \"+t.circularPathData.rightSmallArcRadius+\" 0 0 1 \"+t.circularPathData.rightInnerExtent+\" \"+t.circularPathData.targetY+\" L\"+t.circularPathData.targetX+\" \"+t.circularPathData.targetY;return e}(e);else{var f=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=f(e)}}))}function E(t,e){return z(t)==z(e)?\"bottom\"==t.circularLinkType?L(t,e):C(t,e):z(e)-z(t)}function C(t,e){return t.y0-e.y0}function L(t,e){return e.y0-t.y0}function I(t,e){return t.y1-e.y1}function P(t,e){return e.y1-t.y1}function z(t){return t.target.column-t.source.column}function O(t){return t.target.x0-t.source.x1}function D(t,e){var r=T(t),n=O(e)/Math.tan(r);return\"up\"==q(t)?t.y1+n:t.y1-n}function R(t,e){var r=T(t),n=O(e)/Math.tan(r);return\"up\"==q(t)?t.y1-n:t.y1+n}function F(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),f=Math.pow(1-u,3),h=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),g=f*i.y0+h*i.y0+p*i.y1+d*i.y1,m=g-i.width/2,v=g+i.width/2;m>o.y0&&m<o.y1?(c=o.y1-m+10,c=\"bottom\"==o.circularLinkType?c:-c,o=N(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&B(o,t)&&N(t,c,e,r)}))):(v>o.y0&&v<o.y1||m<o.y0&&v>o.y1)&&(c=v-o.y0+10,o=N(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0<o.y1&&t.y1>o.y1&&N(t,c,e,r)})))}}))}}))}function B(t,e){return t.y0>e.y0&&t.y0<e.y1||(t.y1>e.y0&&t.y1<e.y1||t.y0<e.y0&&t.y1>e.y1)}function N(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function j(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return b(t.source,r)==b(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=R(e,t);return t.y1-r}if(e.target.column>t.target.column)return R(t,e)-e.y1}return t.circular&&!e.circular?\"top\"==t.circularLinkType?-1:1:e.circular&&!t.circular?\"top\"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&\"top\"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&\"bottom\"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:\"top\"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if(\"bottom\"==t.circularLinkType){for(var r=e+1,n=0;r<o;r++)n+=a[r].width;t.y0=i.y1-n-t.width/2}}))}))}function U(t,e,r){t.nodes.forEach((function(e){var n=t.links.filter((function(t){return b(t.target,r)==b(e,r)})),i=n.length;i>1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column<t.source.column){var r=D(e,t);return t.y0-r}if(t.source.column<e.source.column)return D(t,e)-e.y0}return t.circular&&!e.circular?\"top\"==t.circularLinkType?-1:1:e.circular&&!t.circular?\"top\"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&\"top\"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:t.source.column-e.source.column:t.circularLinkType===e.circularLinkType&&\"bottom\"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:e.source.column-t.source.column:\"top\"==t.circularLinkType?-1:1:void 0}));var a=e.y0;n.forEach((function(t){t.y1=a+t.width/2,a+=t.width})),n.forEach((function(t,r){if(\"bottom\"==t.circularLinkType){for(var a=r+1,o=0;a<i;a++)o+=n[a].width;t.y1=e.y1-o-t.width/2}}))}))}function V(t,e){return q(t)==q(e)}function q(t){return t.y0-t.y1>0?\"up\":\"down\"}function H(t,e){return b(t.source,e)==b(t.target,e)}function G(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){\"top\"==t.circularLinkType?o=!0:\"bottom\"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=(n-r)/(e.max(i,(function(t){return t.y1}))-l);i.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}t.sankeyCircular=function(){var t,n,i=0,a=0,b=1,T=1,M=24,A=m,E=o,C=v,L=y,I=32,P=2,z=null;function O(){var t={nodes:C.apply(null,arguments),links:L.apply(null,arguments)};D(t),_(t,A,z),R(t),B(t),w(t,A),N(t,I,A),V(t);for(var e=4,r=0;r<e;r++)j(t,T,A),U(t,T,A),F(t,a,T,A),j(t,T,A),U(t,T,A);return G(t,a,T),S(t,P,T,A),t}function D(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,A);return t.links.forEach((function(t,r){t.index=r;var n=t.source,i=t.target;\"object\"!==(\"undefined\"==typeof n?\"undefined\":l(n))&&(n=t.source=x(e,n)),\"object\"!==(\"undefined\"==typeof i?\"undefined\":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)})),t}function R(t){t.nodes.forEach((function(t){t.partOfCycle=!1,t.value=Math.max(e.sum(t.sourceLinks,h),e.sum(t.targetLinks,h)),t.sourceLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)})),t.targetLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)}))}))}function B(t){var e,r,n;for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.depth=n,t.sourceLinks.forEach((function(t){r.indexOf(t.target)<0&&!t.circular&&r.push(t.target)}))}));for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.height=n,t.targetLinks.forEach((function(t){r.indexOf(t.source)<0&&!t.circular&&r.push(t.source)}))}));t.nodes.forEach((function(t){t.column=Math.floor(E.call(null,t,n))}))}function N(o,s,l){var c=r.nest().key((function(t){return t.column})).sortKeys(e.ascending).entries(o.nodes).map((function(t){return t.values}));!function(r){if(n){var s=1/0;c.forEach((function(t){var e=T*n/(t.length+1);s=e<s?e:s})),t=s}var l=e.min(c,(function(r){return(T-a-(r.length-1)*t)/e.sum(r,h)}));l*=.3,o.links.forEach((function(t){t.width=t.value*l}));var u=function(t){var r=0,n=0,i=0,a=0,o=e.max(t.nodes,(function(t){return t.column}));return t.links.forEach((function(t){t.circular&&(\"top\"==t.circularLinkType?r+=t.width:n+=t.width,0==t.target.column&&(a+=t.width),t.source.column==o&&(i+=t.width))})),{top:r=r>0?r+25+10:r,bottom:n=n>0?n+25+10:n,left:a=a>0?a+25+10:a,right:i=i>0?i+25+10:i}}(o),f=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),o=b-i,s=T-a,l=o/(o+r.right+r.left),c=s/(s+r.top+r.bottom);return i=i*l+r.left,b=0==r.right?b:b*l,a=a*c+r.top,T*=c,t.nodes.forEach((function(t){t.x0=i+t.column*((b-i-M)/n),t.x1=t.x0+M})),c}(o,u);l*=f,o.links.forEach((function(t){t.width=t.value*l})),c.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==c.length-1&&1==e||0==t.depth&&1==e?(t.y0=T/2-t.value*l,t.y1=t.y0+t.value*l):t.partOfCycle?0==k(t,r)?(t.y0=T/2+n,t.y1=t.y0+t.value*l):\"top\"==t.circularLinkType?(t.y0=a+n,t.y1=t.y0+t.value*l):(t.y0=T-t.value*l-n,t.y1=t.y0+t.value*l):0==u.top||0==u.bottom?(t.y0=(T-a)/e*n,t.y1=t.y0+t.value*l):(t.y0=(T-a)/2-e/2+n,t.y1=t.y0+t.value*l)}))}))}(l),y();for(var u=1,m=s;m>0;--m)v(u*=.99,l),y();function v(t,r){var n=c.length;c.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&k(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else{var l=e.mean(i.sourceLinks,g),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function y(){c.forEach((function(e){var r,n,i,o=a,s=e.length;for(e.sort(f),i=0;i<s;++i)(n=o-(r=e[i]).y0)>0&&(r.y0+=n,r.y1+=n),o=r.y1+t;if((n=o-t-T)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=e[i]).y1+t-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}function V(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return O.nodeId=function(t){return arguments.length?(A=\"function\"==typeof t?t:s(t),O):A},O.nodeAlign=function(t){return arguments.length?(E=\"function\"==typeof t?t:s(t),O):E},O.nodeWidth=function(t){return arguments.length?(M=+t,O):M},O.nodePadding=function(e){return arguments.length?(t=+e,O):t},O.nodes=function(t){return arguments.length?(C=\"function\"==typeof t?t:s(t),O):C},O.links=function(t){return arguments.length?(L=\"function\"==typeof t?t:s(t),O):L},O.size=function(t){return arguments.length?(i=a=0,b=+t[0],T=+t[1],O):[b-i,T-a]},O.extent=function(t){return arguments.length?(i=+t[0][0],b=+t[1][0],a=+t[0][1],T=+t[1][1],O):[[i,a],[b,T]]},O.iterations=function(t){return arguments.length?(I=+t,O):I},O.circularLinkGap=function(t){return arguments.length?(P=+t,O):P},O.nodePaddingRatio=function(t){return arguments.length?(n=+t,O):n},O.sortNodes=function(t){return arguments.length?(z=t,O):z},O.update=function(t){return w(t,A),V(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1<T?\"top\":\"bottom\",t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)})),j(t,T,A,!1),U(t,T,A),S(t,P,T,A),t},O},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,a)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=o,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{\"d3-array\":156,\"d3-collection\":157,\"d3-shape\":165,\"elementary-circuits-directed-graph\":179}],56:[function(t,e,r){!function(n,i){\"object\"==typeof r&&\"undefined\"!=typeof e?i(r,t(\"d3-array\"),t(\"d3-collection\"),t(\"d3-shape\")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3)}(this,(function(t,e,r,n){\"use strict\";function i(t){return t.target.depth}function a(t,e){return t.sourceLinks.length?t.depth:e-1}function o(t){return function(){return t}}function s(t,e){return c(t.source,e.source)||t.index-e.index}function l(t,e){return c(t.target,e.target)||t.index-e.index}function c(t,e){return t.y0-e.y0}function u(t){return t.value}function f(t){return(t.y0+t.y1)/2}function h(t){return f(t.source)*t.value}function p(t){return f(t.target)*t.value}function d(t){return t.index}function g(t){return t.nodes}function m(t){return t.links}function v(t,e){var r=t.get(e);if(!r)throw new Error(\"missing: \"+e);return r}function y(t){return[t.source.x1,t.y0]}function x(t){return[t.target.x0,t.y1]}t.sankey=function(){var t=0,n=0,i=1,y=1,x=24,b=8,_=d,w=a,T=g,k=m,M=32;function A(){var t={nodes:T.apply(null,arguments),links:k.apply(null,arguments)};return S(t),E(t),C(t),L(t),I(t),t}function S(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,_);t.links.forEach((function(t,r){t.index=r;var n=t.source,i=t.target;\"object\"!=typeof n&&(n=t.source=v(e,n)),\"object\"!=typeof i&&(i=t.target=v(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)}))}function E(t){t.nodes.forEach((function(t){t.value=Math.max(e.sum(t.sourceLinks,u),e.sum(t.targetLinks,u))}))}function C(e){var r,n,a;for(r=e.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(t){t.depth=a,t.sourceLinks.forEach((function(t){n.indexOf(t.target)<0&&n.push(t.target)}))}));for(r=e.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(t){t.height=a,t.targetLinks.forEach((function(t){n.indexOf(t.source)<0&&n.push(t.source)}))}));var o=(i-t-x)/(a-1);e.nodes.forEach((function(e){e.x1=(e.x0=t+Math.max(0,Math.min(a-1,Math.floor(w.call(null,e,a))))*o)+x}))}function L(t){var i=r.nest().key((function(t){return t.x0})).sortKeys(e.ascending).entries(t.nodes).map((function(t){return t.values}));!function(){var r=e.max(i,(function(t){return t.length})),a=2/3*(y-n)/(r-1);b>a&&(b=a);var o=e.min(i,(function(t){return(y-n-(t.length-1)*b)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}(),d();for(var a=1,o=M;o>0;--o)l(a*=.99),d(),s(a),d();function s(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,h)/e.sum(r.targetLinks,u)-f(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-f(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i<o;++i)(r=a-(e=t[i]).y0)>0&&(e.y0+=r,e.y1+=r),a=e.y1+b;if((r=a-b-y)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+b-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}function I(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return A.update=function(t){return I(t),t},A.nodeId=function(t){return arguments.length?(_=\"function\"==typeof t?t:o(t),A):_},A.nodeAlign=function(t){return arguments.length?(w=\"function\"==typeof t?t:o(t),A):w},A.nodeWidth=function(t){return arguments.length?(x=+t,A):x},A.nodePadding=function(t){return arguments.length?(b=+t,A):b},A.nodes=function(t){return arguments.length?(T=\"function\"==typeof t?t:o(t),A):T},A.links=function(t){return arguments.length?(k=\"function\"==typeof t?t:o(t),A):k},A.size=function(e){return arguments.length?(t=n=0,i=+e[0],y=+e[1],A):[i-t,y-n]},A.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],y=+e[1][1],A):[[t,n],[i,y]]},A.iterations=function(t){return arguments.length?(M=+t,A):M},A},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(y).target(x)},Object.defineProperty(t,\"__esModule\",{value:!0})}))},{\"d3-array\":156,\"d3-collection\":157,\"d3-shape\":165}],57:[function(t,e,r){\"use strict\";e.exports=t(\"./quad\")},{\"./quad\":58}],58:[function(t,e,r){\"use strict\";var n=t(\"binary-search-bounds\"),i=t(\"clamp\"),a=t(\"parse-rect\"),o=t(\"array-bounds\"),s=t(\"pick-by-alias\"),l=t(\"defined\"),c=t(\"flatten-vertex-data\"),u=t(\"is-obj\"),f=t(\"dtype\"),h=t(\"math-log2\");function p(t,e){for(var r=e[0],n=e[1],a=1/(e[2]-r),o=1/(e[3]-n),s=new Array(t.length),l=0,c=t.length/2;l<c;l++)s[2*l]=i((t[2*l]-r)*a,0,1),s[2*l+1]=i((t[2*l+1]-n)*o,0,1);return s}e.exports=function(t,e){e||(e={}),t=c(t,\"float64\"),e=s(e,{bounds:\"range bounds dataBox databox\",maxDepth:\"depth maxDepth maxdepth level maxLevel maxlevel levels\",dtype:\"type dtype format out dst output destination\"});var r=l(e.maxDepth,255),i=l(e.bounds,o(t,2));i[0]===i[2]&&i[2]++,i[1]===i[3]&&i[3]++;var d,g=p(t,i),m=t.length>>>1;e.dtype||(e.dtype=\"array\"),\"string\"==typeof e.dtype?d=new(f(e.dtype))(m):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=m));for(var v=0;v<m;++v)d[v]=v;var y=[],x=[],b=[],_=[];!function t(e,n,i,a,o,s){if(!a.length)return null;var l=y[o]||(y[o]=[]),c=b[o]||(b[o]=[]),u=x[o]||(x[o]=[]),f=l.length;if(++o>r||s>1073741824){for(var h=0;h<a.length;h++)l.push(a[h]),c.push(s),u.push(null,null,null,null);return f}if(l.push(a[0]),c.push(s),a.length<=1)return u.push(null,null,null,null),f;for(var p=.5*i,d=e+p,m=n+p,v=[],_=[],w=[],T=[],k=1,M=a.length;k<M;k++){var A=a[k],S=g[2*A],E=g[2*A+1];S<d?E<m?v.push(A):_.push(A):E<m?w.push(A):T.push(A)}return s<<=2,u.push(t(e,n,p,v,o,s),t(e,m,p,_,o,s+1),t(d,n,p,w,o,s+2),t(d,m,p,T,o,s+3)),f}(0,0,1,d,0,1);for(var w=0,T=0;T<y.length;T++){var k=y[T];if(d.set)d.set(k,w);else for(var M=0,A=k.length;M<A;M++)d[M+w]=k[M];var S=w+y[T].length;_[T]=[w,S],w=S}return d.range=function(){var e,r=[],n=arguments.length;for(;n--;)r[n]=arguments[n];if(u(r[r.length-1])){var o=r.pop();r.length||null==o.x&&null==o.l&&null==o.left||(r=[o],e={}),e=s(o,{level:\"level maxLevel\",d:\"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize\",lod:\"lod details ranges offsets\"})}else e={};r.length||(r=i);var c=a.apply(void 0,r),f=[Math.min(c.x,c.x+c.width),Math.min(c.y,c.y+c.height),Math.max(c.x,c.x+c.width),Math.max(c.y,c.y+c.height)],d=f[0],g=f[1],m=f[2],v=f[3],b=p([d,g,m,v],i),_=b[0],w=b[1],T=b[2],k=b[3],M=l(e.level,y.length);if(null!=e.d){var A;\"number\"==typeof e.d?A=[e.d,e.d]:e.d.length&&(A=e.d),M=Math.min(Math.max(Math.ceil(-h(Math.abs(A[0])/(i[2]-i[0]))),Math.ceil(-h(Math.abs(A[1])/(i[3]-i[1])))),M)}if(M=Math.min(M,y.length),e.lod)return E(_,w,T,k,M);var S=[];function C(e,r,n,i,a,o){if(null!==a&&null!==o&&!(_>e+n||w>r+n||T<e||k<r||i>=M||a===o)){var s=y[i];void 0===o&&(o=s.length);for(var l=a;l<o;l++){var c=s[l],u=t[2*c],f=t[2*c+1];u>=d&&u<=m&&f>=g&&f<=v&&S.push(c)}var h=x[i],p=h[4*a+0],b=h[4*a+1],A=h[4*a+2],E=h[4*a+3],I=L(h,a+1),P=.5*n,z=i+1;C(e,r,P,z,p,b||A||E||I),C(e,r+P,P,z,b,A||E||I),C(e+P,r,P,z,A,E||I),C(e+P,r+P,P,z,E,I)}}function L(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}return C(0,0,1,0,0,1),S},d;function E(t,e,r,i,a){for(var o=[],s=0;s<a;s++){var l=b[s],c=_[s][0],u=C(t,e,s),f=C(r,i,s),h=n.ge(l,u),p=n.gt(l,f,h,l.length-1);o[s]=[h+c,p+c]}return o}function C(t,e,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s<r;s++)n<<=2,n+=t<i?e<a?0:1:e<a?2:3,o*=.5,i+=t<i?-o:o,a+=e<a?-o:o;return n}}},{\"array-bounds\":70,\"binary-search-bounds\":96,clamp:120,defined:170,dtype:175,\"flatten-vertex-data\":244,\"is-obj\":468,\"math-log2\":479,\"parse-rect\":504,\"pick-by-alias\":511}],59:[function(t,e,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0});var n=t(\"@turf/meta\");function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e,r,n,i,a,s,l=0,c=t.length;if(c>2){for(s=0;s<c;s++)s===c-2?(n=c-2,i=c-1,a=0):s===c-1?(n=c-1,i=0,a=1):(n=s,i=s+1,a=s+2),e=t[n],r=t[i],l+=(o(t[a][0])-o(e[0]))*Math.sin(o(r[1]));l=6378137*l*6378137/2}return l}function o(t){return t*Math.PI/180}r.default=function(t){return n.geomReduce(t,(function(t,e){return t+function(t){var e,r=0;switch(t.type){case\"Polygon\":return i(t.coordinates);case\"MultiPolygon\":for(e=0;e<t.coordinates.length;e++)r+=i(t.coordinates[e]);return r;case\"Point\":case\"MultiPoint\":case\"LineString\":case\"MultiLineString\":return 0}return 0}(e)}),0)}},{\"@turf/meta\":63}],60:[function(t,e,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0});var n=t(\"@turf/meta\");r.default=function(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}},{\"@turf/meta\":63}],61:[function(t,e,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0});var n=t(\"@turf/meta\"),i=t(\"@turf/helpers\");r.default=function(t,e){void 0===e&&(e={});var r=0,a=0,o=0;return n.coordEach(t,(function(t){r+=t[0],a+=t[1],o++})),i.point([r/o,a/o],e.properties)}},{\"@turf/helpers\":62,\"@turf/meta\":63}],62:[function(t,e,r){\"use strict\";function n(t,e,r){void 0===r&&(r={});var n={type:\"Feature\"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function i(t,e,r){return void 0===r&&(r={}),n({type:\"Point\",coordinates:t},e,r)}function a(t,e,r){void 0===r&&(r={});for(var i=0,a=t;i<a.length;i++){var o=a[i];if(o.length<4)throw new Error(\"Each LinearRing of a Polygon must have 4 or more Positions.\");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error(\"First and last Position are not equivalent.\")}return n({type:\"Polygon\",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error(\"coordinates must be an array of two or more positions\");return n({type:\"LineString\",coordinates:t},e,r)}function s(t,e){void 0===e&&(e={});var r={type:\"FeatureCollection\"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function l(t,e,r){return void 0===r&&(r={}),n({type:\"MultiLineString\",coordinates:t},e,r)}function c(t,e,r){return void 0===r&&(r={}),n({type:\"MultiPoint\",coordinates:t},e,r)}function u(t,e,r){return void 0===r&&(r={}),n({type:\"MultiPolygon\",coordinates:t},e,r)}function f(t,e){void 0===e&&(e=\"kilometers\");var n=r.factors[e];if(!n)throw new Error(e+\" units is invalid\");return t*n}function h(t,e){void 0===e&&(e=\"kilometers\");var n=r.factors[e];if(!n)throw new Error(e+\" units is invalid\");return t/n}function p(t){return 180*(t%(2*Math.PI))/Math.PI}function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\\s*$/.test(t)}Object.defineProperty(r,\"__esModule\",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius/1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1/1.0936},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=n,r.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case\"Point\":return i(e).geometry;case\"LineString\":return o(e).geometry;case\"Polygon\":return a(e).geometry;case\"MultiPoint\":return c(e).geometry;case\"MultiLineString\":return l(e).geometry;case\"MultiPolygon\":return u(e).geometry;default:throw new Error(t+\" is invalid\")}},r.point=i,r.points=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return i(t,e)})),r)},r.polygon=a,r.polygons=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return a(t,e)})),r)},r.lineString=o,r.lineStrings=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return o(t,e)})),r)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=c,r.multiPolygon=u,r.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:\"GeometryCollection\",geometries:t},e,r)},r.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error(\"precision must be a positive number\");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=f,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return p(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e=\"kilometers\"),void 0===r&&(r=\"kilometers\"),!(t>=0))throw new Error(\"length must be a positive number\");return f(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e=\"meters\"),void 0===n&&(n=\"kilometers\"),!(t>=0))throw new Error(\"area must be a positive number\");var i=r.areaFactors[e];if(!i)throw new Error(\"invalid original units\");var a=r.areaFactors[n];if(!a)throw new Error(\"invalid final units\");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error(\"bbox is required\");if(!Array.isArray(t))throw new Error(\"bbox must be an Array\");if(4!==t.length&&6!==t.length)throw new Error(\"bbox must be an Array of 4 or 6 numbers\");t.forEach((function(t){if(!d(t))throw new Error(\"bbox must only contain numbers\")}))},r.validateId=function(t){if(!t)throw new Error(\"id is required\");if(-1===[\"string\",\"number\"].indexOf(typeof t))throw new Error(\"id must be a number or a string\")},r.radians2degrees=function(){throw new Error(\"method has been renamed to `radiansToDegrees`\")},r.degrees2radians=function(){throw new Error(\"method has been renamed to `degreesToRadians`\")},r.distanceToDegrees=function(){throw new Error(\"method has been renamed to `lengthToDegrees`\")},r.distanceToRadians=function(){throw new Error(\"method has been renamed to `lengthToRadians`\")},r.radiansToDistance=function(){throw new Error(\"method has been renamed to `radiansToLength`\")},r.bearingToAngle=function(){throw new Error(\"method has been renamed to `bearingToAzimuth`\")},r.convertDistance=function(){throw new Error(\"method has been renamed to `convertLength`\")}},{}],63:[function(t,e,r){\"use strict\";Object.defineProperty(r,\"__esModule\",{value:!0});var n=t(\"@turf/helpers\");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,c,u,f,h=0,p=0,d=t.type,g=\"FeatureCollection\"===d,m=\"Feature\"===d,v=g?t.features.length:1,y=0;y<v;y++){l=(f=!!(u=g?t.features[y].geometry:m?t.geometry:t)&&\"GeometryCollection\"===u.type)?u.geometries.length:1;for(var x=0;x<l;x++){var b=0,_=0;if(null!==(s=f?u.geometries[x]:u)){c=s.coordinates;var w=s.type;switch(h=!r||\"Polygon\"!==w&&\"MultiPolygon\"!==w?0:1,w){case null:break;case\"Point\":if(!1===e(c,p,y,b,_))return!1;p++,b++;break;case\"LineString\":case\"MultiPoint\":for(n=0;n<c.length;n++){if(!1===e(c[n],p,y,b,_))return!1;p++,\"MultiPoint\"===w&&b++}\"LineString\"===w&&b++;break;case\"Polygon\":case\"MultiLineString\":for(n=0;n<c.length;n++){for(a=0;a<c[n].length-h;a++){if(!1===e(c[n][a],p,y,b,_))return!1;p++}\"MultiLineString\"===w&&b++,\"Polygon\"===w&&_++}\"Polygon\"===w&&b++;break;case\"MultiPolygon\":for(n=0;n<c.length;n++){for(_=0,a=0;a<c[n].length;a++){for(o=0;o<c[n][a].length-h;o++){if(!1===e(c[n][a][o],p,y,b,_))return!1;p++}_++}b++}break;case\"GeometryCollection\":for(n=0;n<s.geometries.length;n++)if(!1===i(s.geometries[n],e,r))return!1;break;default:throw new Error(\"Unknown Geometry Type\")}}}}}function a(t,e){var r;switch(t.type){case\"FeatureCollection\":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case\"Feature\":e(t.properties,0)}}function o(t,e){if(\"Feature\"===t.type)e(t,0);else if(\"FeatureCollection\"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function s(t,e){var r,n,i,a,o,s,l,c,u,f,h=0,p=\"FeatureCollection\"===t.type,d=\"Feature\"===t.type,g=p?t.features.length:1;for(r=0;r<g;r++){for(s=p?t.features[r].geometry:d?t.geometry:t,c=p?t.features[r].properties:d?t.properties:{},u=p?t.features[r].bbox:d?t.bbox:void 0,f=p?t.features[r].id:d?t.id:void 0,o=(l=!!s&&\"GeometryCollection\"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(a=l?s.geometries[i]:s))switch(a.type){case\"Point\":case\"LineString\":case\"MultiPoint\":case\"Polygon\":case\"MultiLineString\":case\"MultiPolygon\":if(!1===e(a,h,c,u,f))return!1;break;case\"GeometryCollection\":for(n=0;n<a.geometries.length;n++)if(!1===e(a.geometries[n],h,c,u,f))return!1;break;default:throw new Error(\"Unknown Geometry Type\")}else if(!1===e(null,h,c,u,f))return!1;h++}}function l(t,e){s(t,(function(t,r,i,a,o){var s,l=null===t?null:t.type;switch(l){case null:case\"Point\":case\"LineString\":case\"Polygon\":return!1!==e(n.feature(t,i,{bbox:a,id:o}),r,0)&&void 0}switch(l){case\"MultiPoint\":s=\"Point\";break;case\"MultiLineString\":s=\"LineString\";break;case\"MultiPolygon\":s=\"Polygon\"}for(var c=0;c<t.coordinates.length;c++){var u={type:s,coordinates:t.coordinates[c]};if(!1===e(n.feature(u,i),r,c))return!1}}))}function c(t,e){l(t,(function(t,r,a){var o=0;if(t.geometry){var s=t.geometry.type;if(\"Point\"!==s&&\"MultiPoint\"!==s){var l,c=0,u=0,f=0;return!1!==i(t,(function(i,s,h,p,d){if(void 0===l||r>c||p>u||d>f)return l=i,c=r,u=p,f=d,void(o=0);var g=n.lineString([l,i],t.properties);if(!1===e(g,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error(\"geojson is required\");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case\"LineString\":if(!1===e(t,r,i,0,0))return!1;break;case\"Polygon\":for(var s=0;s<o.length;s++)if(!1===e(n.lineString(o[s],t.properties),r,i,s))return!1}}}))}r.coordEach=i,r.coordReduce=function(t,e,r,n){var a=r;return i(t,(function(t,n,i,o,s){a=0===n&&void 0===r?t:e(a,t,n,i,o,s)}),n),a},r.propEach=a,r.propReduce=function(t,e,r){var n=r;return a(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},r.featureEach=o,r.featureReduce=function(t,e,r){var n=r;return o(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},r.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},r.geomEach=s,r.geomReduce=function(t,e,r){var n=r;return s(t,(function(t,i,a,o,s){n=0===i&&void 0===r?t:e(n,t,i,a,o,s)})),n},r.flattenEach=l,r.flattenReduce=function(t,e,r){var n=r;return l(t,(function(t,i,a){n=0===i&&0===a&&void 0===r?t:e(n,t,i,a)})),n},r.segmentEach=c,r.segmentReduce=function(t,e,r){var n=r,i=!1;return c(t,(function(t,a,o,s,l){n=!1===i&&void 0===r?t:e(n,t,a,o,s,l),i=!0})),n},r.lineEach=u,r.lineReduce=function(t,e,r){var n=r;return u(t,(function(t,i,a,o){n=0===i&&void 0===r?t:e(n,t,i,a,o)})),n},r.findSegment=function(t,e){if(e=e||{},!n.isObject(e))throw new Error(\"options is invalid\");var r,i=e.featureIndex||0,a=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,l=e.properties;switch(t.type){case\"FeatureCollection\":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case\"Feature\":l=l||t.properties,r=t.geometry;break;case\"Point\":case\"MultiPoint\":return null;case\"LineString\":case\"Polygon\":case\"MultiLineString\":case\"MultiPolygon\":r=t;break;default:throw new Error(\"geojson is invalid\")}if(null===r)return null;var c=r.coordinates;switch(r.type){case\"Point\":case\"MultiPoint\":return null;case\"LineString\":return s<0&&(s=c.length+s-1),n.lineString([c[s],c[s+1]],l,e);case\"Polygon\":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),n.lineString([c[o][s],c[o][s+1]],l,e);case\"MultiLineString\":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s-1),n.lineString([c[a][s],c[a][s+1]],l,e);case\"MultiPolygon\":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s-1),n.lineString([c[a][o][s],c[a][o][s+1]],l,e)}throw new Error(\"geojson is invalid\")},r.findPoint=function(t,e){if(e=e||{},!n.isObject(e))throw new Error(\"options is invalid\");var r,i=e.featureIndex||0,a=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,l=e.properties;switch(t.type){case\"FeatureCollection\":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case\"Feature\":l=l||t.properties,r=t.geometry;break;case\"Point\":case\"MultiPoint\":return null;case\"LineString\":case\"Polygon\":case\"MultiLineString\":case\"MultiPolygon\":r=t;break;default:throw new Error(\"geojson is invalid\")}if(null===r)return null;var c=r.coordinates;switch(r.type){case\"Point\":return n.point(c,l,e);case\"MultiPoint\":return a<0&&(a=c.length+a),n.point(c[a],l,e);case\"LineString\":return s<0&&(s=c.length+s),n.point(c[s],l,e);case\"Polygon\":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),n.point(c[o][s],l,e);case\"MultiLineString\":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s),n.point(c[a][s],l,e);case\"MultiPolygon\":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s),n.point(c[a][o][s],l,e)}throw new Error(\"geojson is invalid\")}},{\"@turf/helpers\":62}],64:[function(t,e,r){\"use strict\";var n=\"undefined\"==typeof WeakMap?t(\"weak-map\"):WeakMap,i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{\"gl-buffer\":259,\"gl-vao\":358,\"weak-map\":602}],65:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map((function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case\"a\":t[6]+=n,t[7]+=i;break;case\"v\":t[1]+=i;break;case\"h\":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=i}switch(o){case\"Z\":n=e,i=r;break;case\"H\":n=t[1];break;case\"V\":i=t[1];break;case\"M\":n=e=t[1],i=r=t[2];break;default:n=t[t.length-2],i=t[t.length-1]}return t}))}},{}],66:[function(t,e,r){var n=t(\"pad-left\");e.exports=function(t,e,r){e=\"number\"==typeof e?e:1,r=r||\": \";var i=t.split(/\\r?\\n/),a=String(i.length+e-1).length;return i.map((function(t,i){var o=i+e,s=String(o).length;return n(o,a-s)+r+t})).join(\"\\n\")}},{\"pad-left\":502}],67:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],a=[0],o=1;o<e;++o)if(n.push(t[o]),i(n,r)){if(a.push(o),a.length===r+1)return a}else n.pop();return a};var n=t(\"robust-orientation\");function i(t,e){for(var r=new Array(e+1),i=0;i<t.length;++i)r[i]=t[i];for(i=0;i<=t.length;++i){for(var a=t.length;a<=e;++a){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(a+1-i,s);r[a]=o}if(n.apply(void 0,r))return!0}return!1}},{\"robust-orientation\":548}],68:[function(t,e,r){\"use strict\";e.exports=function(t,e){return n(e).filter((function(r){for(var n=new Array(r.length),a=0;a<r.length;++a)n[a]=e[r[a]];return i(n)*t<1}))};var n=t(\"delaunay-triangulate\"),i=t(\"circumradius\")},{circumradius:119,\"delaunay-triangulate\":171}],69:[function(t,e,r){e.exports=function(t,e){return i(n(t,e))};var n=t(\"alpha-complex\"),i=t(\"simplicial-complex-boundary\")},{\"alpha-complex\":68,\"simplicial-complex-boundary\":555}],70:[function(t,e,r){\"use strict\";e.exports=function(t,e){if(!t||null==t.length)throw Error(\"Argument should be an array\");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var i=-1/0,a=1/0,o=n,s=t.length;o<s;o+=e)t[o]>i&&(i=t[o]),t[o]<a&&(a=t[o]);r[n]=a,r[e+n]=i}return r}},{}],71:[function(t,e,r){\"use strict\";var n=t(\"array-bounds\");e.exports=function(t,e,r){if(!t||null==t.length)throw Error(\"Argument should be an array\");null==e&&(e=1);null==r&&(r=n(t,e));for(var i=0;i<e;i++){var a=r[e+i],o=r[i],s=i,l=t.length;if(a===1/0&&o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:t[s]===o?0:.5;else if(a===1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:0;else if(o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===o?0:1;else{var c=a-o;for(s=i;s<l;s+=e)isNaN(t[s])||(t[s]=0===c?.5:(t[s]-o)/c)}}return t}},{\"array-bounds\":70}],72:[function(t,e,r){e.exports=function(t,e){var r=\"number\"==typeof t,n=\"number\"==typeof e;r&&!n?(e=t,t=0):r||n||(t=0,e=0);var i=(e|=0)-(t|=0);if(i<0)throw new Error(\"array length must be positive\");for(var a=new Array(i),o=0,s=t;o<i;o++,s++)a[o]=s;return a}},{}],73:[function(t,e,r){(function(r){(function(){\"use strict\";var n=t(\"object-assign\");\n",
"/*!\n",
" * The buffer module from node.js, for the browser.\n",
" *\n",
" * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n",
" * @license MIT\n",
" */function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function a(t){return r.Buffer&&\"function\"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var o=t(\"util/\"),s=Object.prototype.hasOwnProperty,l=Array.prototype.slice,c=\"foo\"===function(){}.name;function u(t){return Object.prototype.toString.call(t)}function f(t){return!a(t)&&(\"function\"==typeof r.ArrayBuffer&&(\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var h=e.exports=y,p=/\\s*function\\s+([^\\(\\s]*)\\s*/;function d(t){if(o.isFunction(t)){if(c)return t.name;var e=t.toString().match(p);return e&&e[1]}}function g(t,e){return\"string\"==typeof t?t.length<e?t:t.slice(0,e):t}function m(t){if(c||!o.isFunction(t))return o.inspect(t);var e=d(t);return\"[Function\"+(e?\": \"+e:\"\")+\"]\"}function v(t,e,r,n,i){throw new h.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function y(t,e){t||v(t,!0,e,\"==\",h.ok)}function x(t,e,r,n){if(t===e)return!0;if(a(t)&&a(e))return 0===i(t,e);if(o.isDate(t)&&o.isDate(e))return t.getTime()===e.getTime();if(o.isRegExp(t)&&o.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&\"object\"==typeof t||null!==e&&\"object\"==typeof e){if(f(t)&&f(e)&&u(t)===u(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(a(t)!==a(e))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(o.isPrimitive(t)||o.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=b(t),a=b(e);if(i&&!a||!i&&a)return!1;if(i)return t=l.call(t),e=l.call(e),x(t,e,r);var s,c,u=T(t),f=T(e);if(u.length!==f.length)return!1;for(u.sort(),f.sort(),c=u.length-1;c>=0;c--)if(u[c]!==f[c])return!1;for(c=u.length-1;c>=0;c--)if(s=u[c],!x(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function b(t){return\"[object Arguments]\"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if(\"[object RegExp]\"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var i;if(\"function\"!=typeof e)throw new TypeError('\"block\" argument must be a function');\"string\"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?\" (\"+r.name+\").\":\".\")+(n?\" \"+n:\".\"),t&&!i&&v(i,r,\"Missing expected exception\"+n);var a=\"string\"==typeof n,s=!t&&i&&!r;if((!t&&o.isError(i)&&a&&_(i,r)||s)&&v(i,r,\"Got unwanted exception\"+n),t&&i&&r&&!_(i,r)||!t&&i)throw i}h.AssertionError=function(t){this.name=\"AssertionError\",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(m(t.actual),128)+\" \"+t.operator+\" \"+g(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=d(e),a=n.indexOf(\"\\n\"+i);if(a>=0){var o=n.indexOf(\"\\n\",a+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=v,h.ok=y,h.equal=function(t,e,r){t!=e&&v(t,e,r,\"==\",h.equal)},h.notEqual=function(t,e,r){t==e&&v(t,e,r,\"!=\",h.notEqual)},h.deepEqual=function(t,e,r){x(t,e,!1)||v(t,e,r,\"deepEqual\",h.deepEqual)},h.deepStrictEqual=function(t,e,r){x(t,e,!0)||v(t,e,r,\"deepStrictEqual\",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){x(t,e,!1)&&v(t,e,r,\"notDeepEqual\",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&v(e,r,n,\"notDeepStrictEqual\",t)},h.strictEqual=function(t,e,r){t!==e&&v(t,e,r,\"===\",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,\"!==\",h.notStrictEqual)},h.throws=function(t,e,r){w(!0,t,e,r)},h.doesNotThrow=function(t,e,r){w(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||v(e,!0,r,\"==\",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var T=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"object-assign\":499,\"util/\":76}],74:[function(t,e,r){\"function\"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],75:[function(t,e,r){e.exports=function(t){return t&&\"object\"==typeof t&&\"function\"==typeof t.copy&&\"function\"==typeof t.fill&&\"function\"==typeof t.readUInt8}},{}],76:[function(t,e,r){(function(e,n){(function(){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(s(arguments[r]));return e.join(\" \")}r=1;for(var n=arguments,a=n.length,o=String(t).replace(i,(function(t){if(\"%%\"===t)return\"%\";if(r>=a)return t;switch(t){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(t){return\"[Circular]\"}default:return t}})),l=n[r];r<a;l=n[++r])g(l)||!b(l)?o+=\" \"+l:o+=\" \"+s(l);return o},r.deprecate=function(t,i){if(y(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(!0===e.noDeprecation)return t;var a=!1;return function(){if(!a){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),a=!0}return t.apply(this,arguments)}};var a,o={};function s(t,e){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?\"\\x1b[\"+s.colors[r][0]+\"m\"+t+\"\\x1b[\"+s.colors[r][1]+\"m\":t}function c(t,e){return t}function u(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return v(i)||(i=u(t,i,n)),i}var a=function(t,e){if(y(e))return t.stylize(\"undefined\",\"undefined\");if(v(e)){var r=\"'\"+JSON.stringify(e).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return t.stylize(r,\"string\")}if(m(e))return t.stylize(\"\"+e,\"number\");if(d(e))return t.stylize(\"\"+e,\"boolean\");if(g(e))return t.stylize(\"null\",\"null\")}(t,e);if(a)return a;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf(\"message\")>=0||o.indexOf(\"description\")>=0))return f(e);if(0===o.length){if(T(e)){var l=e.name?\": \"+e.name:\"\";return t.stylize(\"[Function\"+l+\"]\",\"special\")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),\"regexp\");if(_(e))return t.stylize(Date.prototype.toString.call(e),\"date\");if(w(e))return f(e)}var c,b=\"\",k=!1,M=[\"{\",\"}\"];(p(e)&&(k=!0,M=[\"[\",\"]\"]),T(e))&&(b=\" [Function\"+(e.name?\": \"+e.name:\"\")+\"]\");return x(e)&&(b=\" \"+RegExp.prototype.toString.call(e)),_(e)&&(b=\" \"+Date.prototype.toUTCString.call(e)),w(e)&&(b=\" \"+f(e)),0!==o.length||k&&0!=e.length?n<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),\"regexp\"):t.stylize(\"[Object]\",\"special\"):(t.seen.push(e),c=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)E(e,String(o))?a.push(h(t,e,r,n,String(o),!0)):a.push(\"\");return i.forEach((function(i){i.match(/^\\d+$/)||a.push(h(t,e,r,n,i,!0))})),a}(t,e,n,s,o):o.map((function(r){return h(t,e,n,s,r,k)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf(\"\\n\")>=0&&0,t+e.replace(/\\u001b\\[\\d\\d?m/g,\"\").length+1}),0)>60)return r[0]+(\"\"===e?\"\":e+\"\\n \")+\" \"+t.join(\",\\n \")+\" \"+r[1];return r[0]+e+\" \"+t.join(\", \")+\" \"+r[1]}(c,b,M)):M[0]+b+M[1]}function f(t){return\"[\"+Error.prototype.toString.call(t)+\"]\"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize(\"[Getter/Setter]\",\"special\"):t.stylize(\"[Getter]\",\"special\"):l.set&&(s=t.stylize(\"[Setter]\",\"special\")),E(n,i)||(o=\"[\"+i+\"]\"),s||(t.seen.indexOf(l.value)<0?(s=g(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf(\"\\n\")>-1&&(s=a?s.split(\"\\n\").map((function(t){return\" \"+t})).join(\"\\n\").substr(2):\"\\n\"+s.split(\"\\n\").map((function(t){return\" \"+t})).join(\"\\n\")):s=t.stylize(\"[Circular]\",\"special\")),y(o)){if(a&&i.match(/^\\d+$/))return s;(o=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,\"name\")):(o=o.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),o=t.stylize(o,\"string\"))}return o+\": \"+s}function p(t){return Array.isArray(t)}function d(t){return\"boolean\"==typeof t}function g(t){return null===t}function m(t){return\"number\"==typeof t}function v(t){return\"string\"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&\"[object RegExp]\"===k(t)}function b(t){return\"object\"==typeof t&&null!==t}function _(t){return b(t)&&\"[object Date]\"===k(t)}function w(t){return b(t)&&(\"[object Error]\"===k(t)||t instanceof Error)}function T(t){return\"function\"==typeof t}function k(t){return Object.prototype.toString.call(t)}function M(t){return t<10?\"0\"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(a)&&(a=e.env.NODE_DEBUG||\"\"),t=t.toUpperCase(),!o[t])if(new RegExp(\"\\\\b\"+t+\"\\\\b\",\"i\").test(a)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error(\"%s %d: %s\",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},r.isArray=p,r.isBoolean=d,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=m,r.isString=v,r.isSymbol=function(t){return\"symbol\"==typeof t},r.isUndefined=y,r.isRegExp=x,r.isObject=b,r.isDate=_,r.isError=w,r.isFunction=T,r.isPrimitive=function(t){return null===t||\"boolean\"==typeof t||\"number\"==typeof t||\"string\"==typeof t||\"symbol\"==typeof t||\"undefined\"==typeof t},r.isBuffer=t(\"./support/isBuffer\");var A=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function S(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(\":\");return[t.getDate(),A[t.getMonth()],e].join(\" \")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log(\"%s - %s\",S(),r.format.apply(r,arguments))},r.inherits=t(\"inherits\"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t(\"_process\"),\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"./support/isBuffer\":75,_process:526,inherits:74}],77:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],78:[function(t,e,r){\"use strict\";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];a[o]=s}a[r]=new Array(r+1);for(o=0;o<=r;++o)a[r][o]=1;var c=new Array(r+1);for(o=0;o<r;++o)c[o]=e[o];c[r]=1;var u=n(a,c),f=i(u[r+1]);0===f&&(f=1);var h=new Array(r+1);for(o=0;o<=r;++o)h[o]=i(u[o])/f;return h};var n=t(\"robust-linear-solve\");function i(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}},{\"robust-linear-solve\":547}],79:[function(t,e,r){\"use strict\";r.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=c(t),o=n[0],s=n[1],l=new a(function(t,e,r){return 3*(e+r)/4-r}(0,o,s)),u=0,f=s>0?o-4:o;for(r=0;r<f;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;o<s;o+=16383)a.push(u(t,o,o+16383>s?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+\"==\")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+\"=\"));return a.join(\"\")};for(var n=[],i=[],a=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,l=o.length;s<l;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=t.indexOf(\"=\");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var i,a,o=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join(\"\")}i[\"-\".charCodeAt(0)]=62,i[\"_\".charCodeAt(0)]=63},{}],80:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{\"./lib/rationalize\":90}],81:[function(t,e,r){\"use strict\";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],82:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{\"./lib/rationalize\":90}],83:[function(t,e,r){\"use strict\";var n=t(\"./is-rat\"),i=t(\"./lib/is-bn\"),a=t(\"./lib/num-to-bn\"),o=t(\"./lib/str-to-bn\"),s=t(\"./lib/rationalize\"),l=t(\"./div\");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,f=0;if(i(e))c=e.clone();else if(\"string\"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if(\"string\"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;u=a(r)}else u=a(1);f>0?c=c.ushln(f):f<0&&(u=u.ushln(-f));return s(c,u)}},{\"./div\":82,\"./is-rat\":84,\"./lib/is-bn\":88,\"./lib/num-to-bn\":89,\"./lib/rationalize\":90,\"./lib/str-to-bn\":91}],84:[function(t,e,r){\"use strict\";var n=t(\"./lib/is-bn\");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{\"./lib/is-bn\":88}],85:[function(t,e,r){\"use strict\";var n=t(\"bn.js\");e.exports=function(t){return t.cmp(new n(0))}},{\"bn.js\":99}],86:[function(t,e,r){\"use strict\";var n=t(\"./bn-sign\");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a<e;a++){var o=r[a];i+=o*Math.pow(67108864,a)}return n(t)*i}},{\"./bn-sign\":85}],87:[function(t,e,r){\"use strict\";var n=t(\"double-bits\"),i=t(\"bit-twiddle\").countTrailingZeros;e.exports=function(t){var e=i(n.lo(t));if(e<32)return e;var r=i(n.hi(t));if(r>20)return 52;return r+32}},{\"bit-twiddle\":97,\"double-bits\":173}],88:[function(t,e,r){\"use strict\";t(\"bn.js\");e.exports=function(t){return t&&\"object\"==typeof t&&Boolean(t.words)}},{\"bn.js\":99}],89:[function(t,e,r){\"use strict\";var n=t(\"bn.js\"),i=t(\"double-bits\");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{\"bn.js\":99,\"double-bits\":173}],90:[function(t,e,r){\"use strict\";var n=t(\"./num-to-bn\"),i=t(\"./bn-sign\");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{\"./bn-sign\":85,\"./num-to-bn\":89}],91:[function(t,e,r){\"use strict\";var n=t(\"bn.js\");e.exports=function(t){return new n(t)}},{\"bn.js\":99}],92:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{\"./lib/rationalize\":90}],93:[function(t,e,r){\"use strict\";var n=t(\"./lib/bn-sign\");e.exports=function(t){return n(t[0])*n(t[1])}},{\"./lib/bn-sign\":85}],94:[function(t,e,r){\"use strict\";var n=t(\"./lib/rationalize\");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{\"./lib/rationalize\":90}],95:[function(t,e,r){\"use strict\";var n=t(\"./lib/bn-to-num\"),i=t(\"./lib/ctz\");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{\"./lib/bn-to-num\":86,\"./lib/ctz\":87}],96:[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){return new Function([n(\"A\",\"x\"+t+\"y\",e,[\"y\"],i),n(\"P\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],i),\"function dispatchBsearch\",r,\"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch\",r].join(\"\"))()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],97:[function(t,e,r){\"use strict\";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(i),r.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],98:[function(t,e,r){\"use strict\";var n=t(\"clamp\");e.exports=function(t,e){e||(e={});var r,o,s,l,c,u,f,h,p,d,g,m=null==e.cutoff?.25:e.cutoff,v=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error(\"For raw data width and height should be provided by options\");r=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext(\"2d\"),r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,r=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),d=0,g=c.length;d<g;d++)l[d]=c[d*u+y]/255;else if(1!==u)throw Error(\"Raw data can have only 1 value per pixel\");var x=Array(r*o),b=Array(r*o),_=Array(s),w=Array(s),T=Array(s+1),k=Array(s);for(d=0,g=r*o;d<g;d++){var M=l[d];x[d]=1===M?0:0===M?i:Math.pow(Math.max(0,.5-M),2),b[d]=1===M?i:0===M?0:Math.pow(Math.max(0,M-.5),2)}a(x,r,o,_,w,k,T),a(b,r,o,_,w,k,T);var A=window.Float32Array?new Float32Array(r*o):new Array(r*o);for(d=0,g=r*o;d<g;d++)A[d]=n(1-((x[d]-b[d])/v+m),0,1);return A};var i=1e20;function a(t,e,r,n,i,a,s){for(var l=0;l<e;l++){for(var c=0;c<r;c++)n[c]=t[c*e+l];for(o(n,i,a,s,r),c=0;c<r;c++)t[c*e+l]=i[c]}for(c=0;c<r;c++){for(l=0;l<e;l++)n[l]=t[c*e+l];for(o(n,i,a,s,e),l=0;l<e;l++)t[c*e+l]=Math.sqrt(i[l])}}function o(t,e,r,n,a){r[0]=0,n[0]=-i,n[1]=+i;for(var o=1,s=0;o<a;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=n[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,n[s]=l,n[s+1]=+i}for(o=0,s=0;o<a;o++){for(;n[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}},{clamp:120}],99:[function(t,e,r){!function(e,r){\"use strict\";function n(t,e){if(!t)throw new Error(e||\"Assertion failed\")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(\"le\"!==e&&\"be\"!==e||(r=e,e=10),this._init(t||0,e||10,r||\"be\"))}var o;\"object\"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o=t(\"buffer\").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a<i;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&\"object\"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if(\"number\"==typeof t)return this._initNumber(t,e,r);if(\"object\"==typeof t)return this._initArray(t,e,r);\"hex\"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;\"-\"===(t=t.toString().replace(/\\s+/g,\"\"))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),\"-\"===t[0]&&(this.negative=1),this.strip(),\"le\"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),\"le\"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n(\"number\"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if(\"be\"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if(\"le\"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=t.length-6,n=0;r>=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,u=r;u<s;u+=n)c=l(t,u,u+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var f=1;for(c=l(t,u,t.length,e),u=0;u<o;u++)f*=e;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},a.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.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?\"<BN-R: \":\"<BN: \")+this.toString(16)+\">\"};var c=[\"\",\"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\"],u=[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],f=[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];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,f=67108863&l,h=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=h;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||\"hex\"===t){r=\"\";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);r=0!==(a=s>>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=u[t],p=f[t];r=\"\";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?g+r:c[h-g.length]+g+r}for(this.isZero()&&(r=\"0\"+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}n(!1,\"Base should be between 2 and 36\")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,\"Number can only safely store up to 53 bits\"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(\"undefined\"!=typeof o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,\"byte array longer than desired length\"),n(a>0,\"Requested array length <= 0\"),this.strip();var o,s,l=\"le\"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.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},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;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()},a.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;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()},a.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n(\"number\"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n(\"number\"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|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},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o<n.length;o++)a=(e=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&e;for(;0!==a&&o<r.length;o++)a=(e=(0|r.words[o])+a)>>26,this.words[o]=67108863&e;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,c=0,u=0|o[0],f=8191&u,h=u>>>13,p=0|o[1],d=8191&p,g=p>>>13,m=0|o[2],v=8191&m,y=m>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,M=0|o[5],A=8191&M,S=M>>>13,E=0|o[6],C=8191&E,L=E>>>13,I=0|o[7],P=8191&I,z=I>>>13,O=0|o[8],D=8191&O,R=O>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,pt=0|s[9],dt=8191&pt,gt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(g,U)|0,a=Math.imul(g,V);var vt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,J)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(L,U)|0,a=Math.imul(L,V),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(g,rt)|0,a=a+Math.imul(g,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(L,H)|0,a=a+Math.imul(L,G)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(g,at)|0,a=a+Math.imul(g,ot)|0;var Tt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(L,W)|0,a=a+Math.imul(L,X)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(g,lt)|0,a=a+Math.imul(g,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(z,W)|0,a=a+Math.imul(z,X)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(g,ft)|0,a=a+Math.imul(g,ht)|0;var Mt=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,dt)|0))<<13)|0;c=((a=a+Math.imul(h,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,G))+Math.imul(N,H)|0,a=Math.imul(N,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(z,J)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var At=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,gt)|0)+Math.imul(g,dt)|0))<<13)|0;c=((a=a+Math.imul(g,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,X))+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,gt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((a=a+Math.imul(y,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((a=a+Math.imul(_,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(L,lt)|0,a=a+Math.imul(L,ct)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Ct=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,gt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ct)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(L,ft)|0,a=a+Math.imul(L,ht)|0;var Lt=(c+(n=n+Math.imul(A,dt)|0)|0)+((8191&(i=(i=i+Math.imul(A,gt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,gt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(P,ft)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(z,ft)|0,a=a+Math.imul(z,ht)|0;var It=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(i=(i=i+Math.imul(C,gt)|0)+Math.imul(L,dt)|0))<<13)|0;c=((a=a+Math.imul(L,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var Pt=(c+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(z,dt)|0))<<13)|0;c=((a=a+Math.imul(z,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,ft),i=(i=Math.imul(B,ht))+Math.imul(N,ft)|0,a=Math.imul(N,ht);var zt=(c+(n=n+Math.imul(D,dt)|0)|0)+((8191&(i=(i=i+Math.imul(D,gt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,gt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Ot=(c+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,gt))+Math.imul(N,dt)|0))<<13)|0;return c=((a=Math.imul(N,gt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,l[0]=mt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=Mt,l[10]=At,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=Lt,l[15]=It,l[16]=Pt,l[17]=zt,l[18]=Ot,0!==c&&(l[19]=c,r.length++),r};function d(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=l;c++){var u=a-c,f=(0|t.words[u])*(0|e.words[c]),h=67108863&f;s=67108863&(h=h+s|0),i+=(o=(o=o+(f/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},g.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var f=l,h=c,p=0;p<o;p++){var d=r[u+p],g=n[u+p],m=r[u+p+o],v=n[u+p+o],y=f*m-h*v;v=f*v+h*m,m=y,r[u+p]=d+m,n[u+p]=g+v,r[u+p+o]=d-m,n[u+p+o]=g-v,p!==s&&(y=l*f-c*h,h=l*h+c*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0==(-8192&a))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=new Array(n),f=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,c,n),this.transform(o,a,s,l,n,i),this.transform(c,a,u,f,n,i);for(var p=0;p<n;p++){var d=s[p]*u[p]-l[p]*f[p];l[p]=s[p]*f[p]+l[p]*u[p],s[p]=d}return this.conjugate(s,l,n),this.transform(s,l,h,a,n,i),this.conjugate(h,a,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),d(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n(\"number\"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n(\"number\"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var i;n(\"number\"==typeof t&&t>=0),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=r;if(i-=o,i=Math.max(0,i),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n(\"number\"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(t){n(\"number\"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,\"imaskn works only with positive numbers\"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n(\"number\"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.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},a.prototype.isubn=function(t){if(n(\"number\"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a,o=t.length+r;this._expand(o);var s=0;for(i=0;i<t.length;i++){a=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;s=((a-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if(\"mod\"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var f=l-1;f>=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),\"div\"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),\"mod\"!==e&&(i=s.div.neg()),\"div\"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),\"mod\"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),\"div\"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?\"div\"===e?{div:this.divn(t.words[0]),mod:null}:\"mod\"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,\"div\",!1).div},a.prototype.mod=function(t){return this.divmod(t,\"mod\",!1).mod},a.prototype.umod=function(t){return this.divmod(t,\"mod\",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,g=1;0==(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n(\"number\"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,\"Number is too big\");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.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=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,\"Already a number in reduction context\"),n(0===this.negative,\"red works only with positives\"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,\"fromRed works only with numbers in reduction context\"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,\"Already a number in reduction context\"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,\"redAdd works only with red numbers\"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,\"redIAdd works only with red numbers\"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,\"redSub works only with red numbers\"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,\"redISub works only with red numbers\"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,\"redShl works only with red numbers\"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,\"redSqr works only with red numbers\"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,\"redISqr works only with red numbers\"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,\"redSqrt works only with red numbers\"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,\"redInvm works only with red numbers\"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,\"redNeg works only with red numbers\"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,\"redPow(normalNum)\"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,\"k256\",\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\")}function x(){v.call(this,\"p224\",\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\")}function b(){v.call(this,\"p192\",\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\")}function _(){v.call(this,\"25519\",\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\")}function w(t){if(\"string\"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),\"modulus must be greater than 1\"),this.m=t,this.prime=null}function T(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).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},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var a=0|t.words[n];t.words[n-10]=(4194303&a)<<4|i>>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(x,v),i(b,v),i(_,v),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(m[t])return m[t];var e;if(\"k256\"===t)e=new y;else if(\"p224\"===t)e=new x;else if(\"p192\"===t)e=new b;else{if(\"p25519\"!==t)throw new Error(\"Unknown prime \"+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,\"red works only with positives\"),n(t.red,\"red works only with red numbers\")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),\"red works only with positives\"),n(t.red&&t.red===e.red,\"red works only with red numbers\")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<d);var v=this.pow(f,new a(1).iushln(d-m-1));h=h.redMul(v),f=v.redSqr(),p=p.redMul(f),d=m}return h},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new T(t)},i(T,w),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(\"undefined\"==typeof e||e,this)},{buffer:108}],100:[function(t,e,r){\"use strict\";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),f=0;for(n=0;n<c;++n)n!==r&&(u[f++]=l[n]);if(1&r){var h=u[1];u[1]=u[0],u[0]=h}}}return o}},{}],101:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){switch(arguments.length){case 1:return f(t);case 2:return\"function\"==typeof e?c(t,t,e,!0):h(t,e);case 3:return c(t,e,r,!1);default:throw new Error(\"box-intersect: Invalid arguments\")}};var n,i=t(\"typedarray-pool\"),a=t(\"./lib/sweep\"),o=t(\"./lib/intersect\");function s(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var i=0,a=0,o=0,l=t.length;o<l;++o){var c=t[o];if(!s(e,c)){for(var u=0;u<2*e;++u)r[i++]=c[u];n[a++]=o}}return a}function c(t,e,r,n){var s=t.length,c=e.length;if(!(s<=0||c<=0)){var u=t[0].length>>>1;if(!(u<=0)){var f,h=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,h,p))>0){if(1===u&&n)a.init(s),f=a.sweepComplete(u,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*u*c),g=i.mallocInt32(c);(c=l(e,u,d,g))>0&&(a.init(s+c),f=1===u?a.sweepBipartite(u,r,0,s,h,p,0,c,d,g):o(u,r,n,s,h,p,c,d,g),i.free(d),i.free(g))}i.free(h),i.free(p)}return f}}}function u(t,e){n.push([t,e])}function f(t){return n=[],c(t,t,u,!0),n}function h(t,e){return n=[],c(t,e,u,!1),n}},{\"./lib/intersect\":103,\"./lib/sweep\":107,\"typedarray-pool\":595}],102:[function(t,e,r){\"use strict\";var n=[\"d\",\"ax\",\"vv\",\"rs\",\"re\",\"rb\",\"ri\",\"bs\",\"be\",\"bb\",\"bi\"];function i(t){var e=\"bruteForce\"+(t?\"Full\":\"Partial\"),r=[],i=n.slice();t||i.splice(3,0,\"fp\");var a=[\"function \"+e+\"(\"+i.join()+\"){\"];function o(e,i){var o=function(t,e,r){var i=\"bruteForce\"+(t?\"Red\":\"Blue\")+(e?\"Flip\":\"\")+(r?\"Full\":\"\"),a=[\"function \",i,\"(\",n.join(),\"){\",\"var \",\"es\",\"=2*\",\"d\",\";\"],o=\"for(var i=rs,rp=es*rs;i<re;++i,rp+=es){var x0=rb[ax+rp],x1=rb[ax+rp+d],xi=ri[i];\",s=\"for(var j=bs,bp=es*bs;j<be;++j,bp+=es){var y0=bb[ax+bp],\"+(r?\"y1=bb[ax+bp+d],\":\"\")+\"yi=bi[j];\";return t?a.push(o,\"Q\",\":\",s):a.push(s,\"Q\",\":\",o),r?a.push(\"if(y1<x0||x1<y0)continue;\"):e?a.push(\"if(y0<=x0||x1<y0)continue;\"):a.push(\"if(y0<x0||x1<y0)continue;\"),a.push(\"for(var k=ax+1;k<d;++k){var r0=rb[k+rp],r1=rb[k+d+rp],b0=bb[k+bp],b1=bb[k+d+bp];if(r1<b0||b1<r0)continue Q;}var rv=vv(\"),e?a.push(\"yi,xi\"):a.push(\"xi,yi\"),a.push(\");if(rv!==void 0)return rv;}}}\"),{name:i,code:a.join(\"\")}}(e,i,t);r.push(o.code),a.push(\"return \"+o.name+\"(\"+n.join()+\");\")}a.push(\"if(re-rs>be-bs){\"),t?(o(!0,!1),a.push(\"}else{\"),o(!1,!1)):(a.push(\"if(fp){\"),o(!0,!0),a.push(\"}else{\"),o(!0,!1),a.push(\"}}else{if(fp){\"),o(!1,!0),a.push(\"}else{\"),o(!1,!1),a.push(\"}\")),a.push(\"}}return \"+e);var s=r.join(\"\")+a.join(\"\");return new Function(s)()}r.partial=i(!1),r.full=i(!0)},{}],103:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,a,u,w,T,k,M){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(6*r);v.length<a&&(n.free(v),v=n.mallocInt32(a));var o=i.nextPow2(2*r);y.length<o&&(n.free(y),y=n.mallocDouble(o))}(t,a+T);var A,S=0,E=2*t;x(S++,0,0,a,0,T,r?16:0,-1/0,1/0),r||x(S++,0,0,T,0,a,1,-1/0,1/0);for(;S>0;){var C=6*(S-=1),L=v[C],I=v[C+1],P=v[C+2],z=v[C+3],O=v[C+4],D=v[C+5],R=2*S,F=y[R],B=y[R+1],N=1&D,j=!!(16&D),U=u,V=w,q=k,H=M;if(N&&(U=k,V=M,q=u,H=w),!(2&D&&(P=p(t,L,I,P,U,V,B),I>=P)||4&D&&(I=d(t,L,I,P,U,V,F))>=P)){var G=P-I,Y=O-z;if(j){if(t*G*(G+Y)<1<<22){if(void 0!==(A=l.scanComplete(t,L,e,I,P,U,V,z,O,q,H)))return A;continue}}else{if(t*Math.min(G,Y)<128){if(void 0!==(A=o(t,L,e,N,I,P,U,V,z,O,q,H)))return A;continue}if(t*G*Y<1<<22){if(void 0!==(A=l.scanBipartite(t,L,e,N,I,P,U,V,z,O,q,H)))return A;continue}}var W=f(t,L,I,P,U,V,F,B);if(I<W)if(t*(W-I)<128){if(void 0!==(A=s(t,L+1,e,I,W,U,V,z,O,q,H)))return A}else if(L===t-2){if(void 0!==(A=N?l.sweepBipartite(t,e,z,O,q,H,I,W,U,V):l.sweepBipartite(t,e,I,W,U,V,z,O,q,H)))return A}else x(S++,L+1,I,W,z,O,N,-1/0,1/0),x(S++,L+1,z,O,I,W,1^N,-1/0,1/0);if(W<P){var X=c(t,L,z,O,q,H),Z=q[E*X+L],J=h(t,L,X,O,q,H,Z);if(J<O&&x(S++,L,W,P,J,O,(4|N)+(j?16:0),Z,B),z<X&&x(S++,L,W,P,z,X,(2|N)+(j?16:0),F,Z),X+1===J){if(void 0!==(A=j?_(t,L,e,W,P,U,V,X,q,H[X]):b(t,L,e,N,W,P,U,V,X,q,H[X])))return A}else if(X<J){var K;if(j){if(K=g(t,L,W,P,U,V,Z),W<K){var Q=h(t,L,W,K,U,V,Z);if(L===t-2){if(W<Q&&void 0!==(A=l.sweepComplete(t,e,W,Q,U,V,X,J,q,H)))return A;if(Q<K&&void 0!==(A=l.sweepBipartite(t,e,Q,K,U,V,X,J,q,H)))return A}else W<Q&&x(S++,L+1,W,Q,X,J,16,-1/0,1/0),Q<K&&(x(S++,L+1,Q,K,X,J,0,-1/0,1/0),x(S++,L+1,X,J,Q,K,1,-1/0,1/0))}}else K=N?m(t,L,W,P,U,V,Z):g(t,L,W,P,U,V,Z),W<K&&(L===t-2?A=N?l.sweepBipartite(t,e,X,J,q,H,W,K,U,V):l.sweepBipartite(t,e,W,K,U,V,X,J,q,H):(x(S++,L+1,W,K,X,J,N,-1/0,1/0),x(S++,L+1,X,J,W,K,1^N,-1/0,1/0)))}}}}};var n=t(\"typedarray-pool\"),i=t(\"bit-twiddle\"),a=t(\"./brute\"),o=a.partial,s=a.full,l=t(\"./sweep\"),c=t(\"./median\"),u=t(\"./partition\"),f=u(\"!(lo>=p0)&&!(p1>=hi)\",[\"p0\",\"p1\"]),h=u(\"lo===p0\",[\"p0\"]),p=u(\"lo<p0\",[\"p0\"]),d=u(\"hi<=p0\",[\"p0\"]),g=u(\"lo<=p0&&p0<=hi\",[\"p0\"]),m=u(\"lo<p0&&p0<=hi\",[\"p0\"]),v=n.mallocInt32(1024),y=n.mallocDouble(1024);function x(t,e,r,n,i,a,o,s,l){var c=6*t;v[c]=e,v[c+1]=r,v[c+2]=n,v[c+3]=i,v[c+4]=a,v[c+5]=o;var u=2*t;y[u]=s,y[u+1]=l}function b(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,p=c[h+e];t:for(var d=i,g=i*f;d<a;++d,g+=f){var m=o[g+e],v=o[g+e+t];if(!(p<m||v<p)&&(!n||p!==m)){for(var y,x=s[d],b=e+1;b<t;++b){m=o[g+b],v=o[g+b+t];var _=c[h+b],w=c[h+b+t];if(v<_||w<m)continue t}if(void 0!==(y=n?r(u,x):r(x,u)))return y}}}function _(t,e,r,n,i,a,o,s,l,c){var u=2*t,f=s*u,h=l[f+e];t:for(var p=n,d=n*u;p<i;++p,d+=u){var g=o[p];if(g!==c){var m=a[d+e],v=a[d+e+t];if(!(h<m||v<h)){for(var y=e+1;y<t;++y){m=a[d+y],v=a[d+y+t];var x=l[f+y],b=l[f+y+t];if(v<x||b<m)continue t}var _=r(g,c);if(void 0!==_)return _}}}}},{\"./brute\":102,\"./median\":104,\"./partition\":105,\"./sweep\":107,\"bit-twiddle\":97,\"typedarray-pool\":595}],104:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,a,o,s){if(a<=r+1)return r;var l=r,c=a,u=a+r>>>1,f=2*t,h=u,p=o[f*u+e];for(;l<c;){if(c-l<8){i(t,e,l,c,o,s),p=o[f*u+e];break}var d=c-l,g=Math.random()*d+l|0,m=o[f*g+e],v=Math.random()*d+l|0,y=o[f*v+e],x=Math.random()*d+l|0,b=o[f*x+e];m<=y?b>=y?(h=v,p=y):m>=b?(h=g,p=m):(h=x,p=b):y>=b?(h=v,p=y):b>=m?(h=g,p=m):(h=x,p=b);for(var _=f*(c-1),w=f*h,T=0;T<f;++T,++_,++w){var k=o[_];o[_]=o[w],o[w]=k}var M=s[c-1];s[c-1]=s[h],s[h]=M,h=n(t,e,l,c-1,o,s,p);for(_=f*(c-1),w=f*h,T=0;T<f;++T,++_,++w){k=o[_];o[_]=o[w],o[w]=k}M=s[c-1];if(s[c-1]=s[h],s[h]=M,u<h){for(c=h-1;l<c&&o[f*(c-1)+e]===p;)c-=1;c+=1}else{if(!(h<u))break;for(l=h+1;l<c&&o[f*l+e]===p;)l+=1}}return n(t,e,r,u,o,s,o[f*u+e])};var n=t(\"./partition\")(\"lo<p0\",[\"p0\"]);function i(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var c=i[s],u=l,f=o*(l-1);u>r&&i[f+e]>c;--u,f-=o){for(var h=f,p=f+o,d=0;d<o;++d,++h,++p){var g=i[h];i[h]=i[p],i[p]=g}var m=a[u];a[u]=a[u-1],a[u-1]=m}}},{\"./partition\":105}],105:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=\"abcdef\".split(\"\").concat(e),n=[];t.indexOf(\"lo\")>=0&&n.push(\"lo=e[k+n]\");t.indexOf(\"hi\")>=0&&n.push(\"hi=e[k+o]\");return r.push(\"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\".replace(\"_\",n.join()).replace(\"$\",t)),Function.apply(void 0,r)}},{}],106:[function(t,e,r){\"use strict\";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,u){var f=(r-e+1)/6|0,h=e+f,p=r-f,d=e+r>>1,g=d-f,m=d+f,v=h,y=g,x=d,b=m,_=p,w=e+1,T=r-1,k=0;l(v,y,u)&&(k=v,v=y,y=k);l(b,_,u)&&(k=b,b=_,_=k);l(v,x,u)&&(k=v,v=x,x=k);l(y,x,u)&&(k=y,y=x,x=k);l(v,b,u)&&(k=v,v=b,b=k);l(x,b,u)&&(k=x,x=b,b=k);l(y,_,u)&&(k=y,y=_,_=k);l(y,x,u)&&(k=y,y=x,x=k);l(b,_,u)&&(k=b,b=_,_=k);for(var M=u[2*y],A=u[2*y+1],S=u[2*b],E=u[2*b+1],C=2*v,L=2*x,I=2*_,P=2*h,z=2*d,O=2*p,D=0;D<2;++D){var R=u[C+D],F=u[L+D],B=u[I+D];u[P+D]=R,u[z+D]=F,u[O+D]=B}a(g,e,u),a(m,r,u);for(var N=w;N<=T;++N)if(c(N,M,A,u))N!==w&&i(N,w,u),++w;else if(!c(N,S,E,u))for(;;){if(c(T,S,E,u)){c(T,M,A,u)?(o(N,w,T,u),++w,--T):(i(N,T,u),--T);break}if(--T<N)break}s(e,w-1,M,A,u),s(r,T+1,S,E,u),w-2-e<=32?n(e,w-2,u):t(e,w-2,u);r-(T+2)<=32?n(T+2,r,u):t(T+2,r,u);T-w<=32?n(w,T,u):t(w,T,u)}(0,e-1,t)};function n(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(c<a)break;if(c===a&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=a,r[l+1]=o}}function i(t,e,r){e*=2;var n=r[t*=2],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function a(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function o(t,e,r,n){e*=2,r*=2;var i=n[t*=2],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 s(t,e,r,n,i){e*=2,i[t*=2]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function l(t,e,r){e*=2;var n=r[t*=2],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function c(t,e,r,n){var i=n[t*=2];return i<e||i===e&&n[t+1]<r}},{}],107:[function(t,e,r){\"use strict\";e.exports={init:function(t){var e=i.nextPow2(t);o.length<e&&(n.free(o),o=n.mallocInt32(e));s.length<e&&(n.free(s),s=n.mallocInt32(e));l.length<e&&(n.free(l),l=n.mallocInt32(e));c.length<e&&(n.free(c),c=n.mallocInt32(e));u.length<e&&(n.free(u),u=n.mallocInt32(e));f.length<e&&(n.free(f),f=n.mallocInt32(e));var r=8*e;h.length<r&&(n.free(h),h=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,i,u,f,g,m,v){for(var y=0,x=2*t,b=t-1,_=x-1,w=r;w<n;++w){var T=u[w],k=x*w;h[y++]=i[k+b],h[y++]=-(T+1),h[y++]=i[k+_],h[y++]=T}for(w=f;w<g;++w){T=v[w]+(1<<28);var M=x*w;h[y++]=m[M+b],h[y++]=-T,h[y++]=m[M+_],h[y++]=T}var A=y>>>1;a(h,A);var S=0,E=0;for(w=0;w<A;++w){var C=0|h[2*w+1];if(C>=1<<28)p(l,c,E--,C=C-(1<<28)|0);else if(C>=0)p(o,s,S--,C);else if(C<=-(1<<28)){C=-C-(1<<28)|0;for(var L=0;L<S;++L){if(void 0!==(I=e(o[L],C)))return I}d(l,c,E++,C)}else{C=-C-1|0;for(L=0;L<E;++L){var I;if(void 0!==(I=e(C,l[L])))return I}d(o,s,S++,C)}}},sweepComplete:function(t,e,r,n,i,g,m,v,y,x){for(var b=0,_=2*t,w=t-1,T=_-1,k=r;k<n;++k){var M=g[k]+1<<1,A=_*k;h[b++]=i[A+w],h[b++]=-M,h[b++]=i[A+T],h[b++]=M}for(k=m;k<v;++k){M=x[k]+1<<1;var S=_*k;h[b++]=y[S+w],h[b++]=1|-M,h[b++]=y[S+T],h[b++]=1|M}var E=b>>>1;a(h,E);var C=0,L=0,I=0;for(k=0;k<E;++k){var P=0|h[2*k+1],z=1&P;if(k<E-1&&P>>1==h[2*k+3]>>1&&(z=2,k+=1),P<0){for(var O=-(P>>1)-1,D=0;D<I;++D){if(void 0!==(R=e(u[D],O)))return R}if(0!==z)for(D=0;D<C;++D){if(void 0!==(R=e(o[D],O)))return R}if(1!==z)for(D=0;D<L;++D){var R;if(void 0!==(R=e(l[D],O)))return R}0===z?d(o,s,C++,O):1===z?d(l,c,L++,O):2===z&&d(u,f,I++,O)}else{O=(P>>1)-1;0===z?p(o,s,C--,O):1===z?p(l,c,L--,O):2===z&&p(u,f,I--,O)}}},scanBipartite:function(t,e,r,n,i,l,c,u,f,g,m,v){var y=0,x=2*t,b=e,_=e+t,w=1,T=1;n?T=1<<28:w=1<<28;for(var k=i;k<l;++k){var M=k+w,A=x*k;h[y++]=c[A+b],h[y++]=-M,h[y++]=c[A+_],h[y++]=M}for(k=f;k<g;++k){M=k+T;var S=x*k;h[y++]=m[S+b],h[y++]=-M}var E=y>>>1;a(h,E);var C=0;for(k=0;k<E;++k){var L=0|h[2*k+1];if(L<0){var I=!1;if((M=-L)>=1<<28?(I=!n,M-=1<<28):(I=!!n,M-=1),I)d(o,s,C++,M);else{var P=v[M],z=x*M,O=m[z+e+1],D=m[z+e+1+t];t:for(var R=0;R<C;++R){var F=o[R],B=x*F;if(!(D<c[B+e+1]||c[B+e+1+t]<O)){for(var N=e+2;N<t;++N)if(m[z+N+t]<c[B+N]||c[B+N+t]<m[z+N])continue t;var j,U=u[F];if(void 0!==(j=n?r(P,U):r(U,P)))return j}}}}else p(o,s,C--,L-w)}},scanComplete:function(t,e,r,n,i,s,l,c,u,f,p){for(var d=0,g=2*t,m=e,v=e+t,y=n;y<i;++y){var x=y+(1<<28),b=g*y;h[d++]=s[b+m],h[d++]=-x,h[d++]=s[b+v],h[d++]=x}for(y=c;y<u;++y){x=y+1;var _=g*y;h[d++]=f[_+m],h[d++]=-x}var w=d>>>1;a(h,w);var T=0;for(y=0;y<w;++y){var k=0|h[2*y+1];if(k<0){if((x=-k)>=1<<28)o[T++]=x-(1<<28);else{var M=p[x-=1],A=g*x,S=f[A+e+1],E=f[A+e+1+t];t:for(var C=0;C<T;++C){var L=o[C],I=l[L];if(I===M)break;var P=g*L;if(!(E<s[P+e+1]||s[P+e+1+t]<S)){for(var z=e+2;z<t;++z)if(f[A+z+t]<s[P+z]||s[P+z+t]<f[A+z])continue t;var O=r(I,M);if(void 0!==O)return O}}}}else{for(x=k-(1<<28),C=T-1;C>=0;--C)if(o[C]===x){for(z=C+1;z<T;++z)o[z-1]=o[z];break}--T}}}};var n=t(\"typedarray-pool\"),i=t(\"bit-twiddle\"),a=t(\"./sort\"),o=n.mallocInt32(1024),s=n.mallocInt32(1024),l=n.mallocInt32(1024),c=n.mallocInt32(1024),u=n.mallocInt32(1024),f=n.mallocInt32(1024),h=n.mallocDouble(8192);function p(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function d(t,e,r,n){t[r]=n,e[n]=r}},{\"./sort\":106,\"bit-twiddle\":97,\"typedarray-pool\":595}],108:[function(t,e,r){},{}],109:[function(t,e,r){arguments[4][108][0].apply(r,arguments)},{dup:108}],110:[function(t,e,r){\"use strict\";var n,i=\"object\"==typeof Reflect?Reflect:null,a=i&&\"function\"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&\"function\"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(t,e){return new Promise((function(r,n){function i(){void 0!==a&&t.removeListener(\"error\",a),r([].slice.call(arguments))}var a;\"error\"!==e&&(a=function(r){t.removeListener(e,i),n(r)},t.once(\"error\",a)),t.once(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function c(t){if(\"function\"!=typeof t)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var i,a,o,s;if(c(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit(\"newListener\",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if(\"function\"==typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=u(t))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error(\"Possible EventEmitter memory leak detected. \"+o.length+\" \"+String(e)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");l.name=\"MaxListenersExceededWarning\",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):m(i,i.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if(\"function\"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(s,\"defaultMaxListeners\",{enumerable:!0,get:function(){return l},set:function(t){if(\"number\"!=typeof t||t<0||o(t))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+t+\".\");l=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if(\"number\"!=typeof t||t<0||o(t))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+t+\".\");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n=\"error\"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error(\"Unhandled error.\"+(o?\" (\"+o.message+\")\":\"\"));throw s.context=o,s}var l=i[t];if(void 0===l)return!1;if(\"function\"==typeof l)a(l,this,e);else{var c=l.length,u=m(l,c);for(r=0;r<c;++r)a(u[r],this,e)}return!0},s.prototype.addListener=function(t,e){return f(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return f(this,t,e,!0)},s.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,i,a,o;if(c(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit(\"removeListener\",t,r.listener||e));else if(\"function\"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit(\"removeListener\",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)\"removeListener\"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners(\"removeListener\"),this._events=Object.create(null),this._eventsCount=0,this}if(\"function\"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return\"function\"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],111:[function(t,e,r){(function(e){(function(){\n",
"/*!\n",
" * The buffer module from node.js, for the browser.\n",
" *\n",
" * @author Feross Aboukhadijeh <https://feross.org>\n",
" * @license MIT\n",
" */\n",
"\"use strict\";var e=t(\"base64-js\"),n=t(\"ieee754\");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value \"'+t+'\" is invalid for option \"size\"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,r){if(\"number\"==typeof t){if(\"string\"==typeof e)throw new TypeError('The \"string\" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if(\"string\"==typeof t)return function(t,e){\"string\"==typeof e&&\"\"!==e||(e=\"utf8\");if(!a.isEncoding(e))throw new TypeError(\"Unknown encoding: \"+e);var r=0|f(t,e),n=i(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('\"offset\" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('\"length\" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=a.prototype,n}(t,e,r);if(\"number\"==typeof t)throw new TypeError('The \"value\" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);var o=function(t){if(a.isBuffer(t)){var e=0|u(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return\"number\"!=typeof t.length||N(t.length)?i(0):c(t);if(\"Buffer\"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive](\"string\"),e,r);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof t)}function s(t){if(\"number\"!=typeof t)throw new TypeError('\"size\" argument must be of type number');if(t<0)throw new RangeError('The value \"'+t+'\" is invalid for option \"size\"')}function l(t){return s(t),i(t<0?0:0|u(t))}function c(t){for(var e=t.length<0?0:0|u(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function u(t){if(t>=2147483647)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+2147483647..toString(16)+\" bytes\");return 0|t}function f(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if(\"string\"!=typeof t)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":return D(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return R(t).length;default:if(i)return n?-1:D(t).length;e=(\"\"+e).toLowerCase(),i=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(e>>>=0))return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return A(this,e,r);case\"utf8\":case\"utf-8\":return T(this,e,r);case\"ascii\":return k(this,e,r);case\"latin1\":case\"binary\":return M(this,e,r);case\"base64\":return w(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return S(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),N(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if(\"number\"==typeof e)return e&=255,\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function g(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;h<l;h++)if(c(t,a+h)!==c(e,h)){f=!1;break}if(f)return a}return-1}function m(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(N(s))return o;t[r+o]=s}return o}function v(t,e,r,n){return F(D(e,t.length-r),t,r,n)}function y(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return y(t,e,r,n)}function b(t,e,r,n){return F(R(e),t,r,n)}function _(t,e,r,n){return F(function(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}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a,o,s,l,c=t[i],u=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r=\"\",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}r.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(a.prototype,\"parent\",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,\"offset\",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),\"undefined\"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(t,e,r){return o(t,e,r)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(t,e,r){return function(t,e,r){return s(t),t<=0?i(t):void 0!==e?\"string\"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},a.allocUnsafe=function(t){return l(t)},a.allocUnsafeSlow=function(t){return l(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(B(o,Uint8Array)&&(o=a.from(o)),!a.isBuffer(o))throw new TypeError('\"list\" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=f,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?\"\":0===arguments.length?T(this,0,t):h.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t=\"\",e=r.INSPECT_MAX_BYTES;return t=this.toString(\"hex\",0,e).replace(/(.{2})/g,\"$1 \").trim(),this.length>e&&(t+=\" ... \"),\"<Buffer \"+t+\">\"},a.prototype.compare=function(t,e,r,n,i){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),c=this.slice(n,i),u=t.slice(e,r),f=0;f<l;++f)if(c[f]!==u[f]){o=c[f],s=u[f];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)},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))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var a=!1;;)switch(n){case\"hex\":return m(this,t,e,r);case\"utf8\":case\"utf-8\":return v(this,t,e,r);case\"ascii\":return y(this,t,e,r);case\"latin1\":case\"binary\":return x(this,t,e,r);case\"base64\":return b(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return _(this,t,e,r);default:if(a)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function M(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function A(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i=\"\",a=e;a<r;++a)i+=O(t[a]);return i}function S(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 E(t,e,r){if(t%1!=0||t<0)throw new RangeError(\"offset is not uint\");if(t+e>r)throw new RangeError(\"Trying to access beyond buffer length\")}function C(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('\"value\" argument is out of bounds');if(r+n>t.length)throw new RangeError(\"Index out of range\")}function L(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function I(t,e,r,i,a){return e=+e,r>>>=0,a||L(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function P(t,e,r,i,a){return e=+e,r>>>=0,a||L(t,0,r,8),n.write(t,e,r,i,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=a.prototype,n},a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(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,e>>>=0,r||E(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 t>>>=0,e||E(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(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 t>>>=0,e||E(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,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||E(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 t>>>=0,e||E(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 t>>>=0,e||E(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 t>>>=0,e||E(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,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,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError(\"argument should be a Buffer\");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"Index out of range\");if(n<0)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=n-r;if(this===t&&\"function\"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},a.prototype.fill=function(t,e,r,n){if(\"string\"==typeof t){if(\"string\"==typeof e?(n=e,e=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!a.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n);if(1===t.length){var i=t.charCodeAt(0);(\"utf8\"===n&&i<128||\"latin1\"===n)&&(t=i)}}else\"number\"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError(\"Out of range index\");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),\"number\"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=a.isBuffer(t)?t:a.from(t,n),l=s.length;if(0===l)throw new TypeError('The value \"'+t+'\" is invalid for argument \"value\"');for(o=0;o<r-e;++o)this[o+e]=s[o%l]}return this};var z=/[^+/0-9A-Za-z-_]/g;function O(t){return t<16?\"0\"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function R(t){return e.toByteArray(function(t){if((t=(t=t.split(\"=\")[0]).trim().replace(z,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}(t))}function F(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function N(t){return t!=t}}).call(this)}).call(this,t(\"buffer\").Buffer)},{\"base64-js\":79,buffer:111,ieee754:442}],112:[function(t,e,r){\"use strict\";var n=t(\"./lib/monotone\"),i=t(\"./lib/triangulation\"),a=t(\"./lib/delaunay\"),o=t(\"./lib/filter\");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,\"delaunay\",!0),f=!!c(r,\"interior\",!0),h=!!c(r,\"exterior\",!0),p=!!c(r,\"infinity\",!1);if(!f&&!h||0===t.length)return[];var d=n(t,e);if(u||f!==h||p){for(var g=i(t.length,function(t){return t.map(s).sort(l)}(e)),m=0;m<d.length;++m){var v=d[m];g.addTriangle(v[0],v[1],v[2])}return u&&a(t,g),h?f?p?o(g,0,p):g.cells():o(g,1,p):o(g,-1)}return d}},{\"./lib/delaunay\":113,\"./lib/filter\":114,\"./lib/monotone\":115,\"./lib/triangulation\":116}],113:[function(t,e,r){\"use strict\";var n=t(\"robust-in-sphere\")[4];t(\"binary-search-bounds\");function i(t,e,r,i,a,o){var s=e.opposite(i,a);if(!(s<0)){if(a<i){var l=i;i=a,a=l,l=o,o=s,s=l}e.isConstraint(i,a)||n(t[i],t[a],t[o],t[s])<0&&r.push(i,a)}}e.exports=function(t,e){for(var r=[],a=t.length,o=e.stars,s=0;s<a;++s)for(var l=o[s],c=1;c<l.length;c+=2){if(!((p=l[c])<s)&&!e.isConstraint(s,p)){for(var u=l[c-1],f=-1,h=1;h<l.length;h+=2)if(l[h-1]===p){f=l[h];break}f<0||n(t[s],t[p],t[u],t[f])<0&&r.push(s,p)}}for(;r.length>0;){for(var p=r.pop(),d=(s=r.pop(),u=-1,f=-1,l=o[s],1);d<l.length;d+=2){var g=l[d-1],m=l[d];g===p?f=m:m===p&&(u=g)}u<0||f<0||(n(t[s],t[p],t[u],t[f])>=0||(e.flip(s,p),i(t,e,r,u,s,f),i(t,e,r,s,f,u),i(t,e,r,f,p,u),i(t,e,r,p,u,f)))}}},{\"binary-search-bounds\":96,\"robust-in-sphere\":546}],114:[function(t,e,r){\"use strict\";var n,i=t(\"binary-search-bounds\");function a(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 o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i<n;++i){var s=(v=r[i])[0],l=v[1],c=v[2];l<c?l<s&&(v[0]=l,v[1]=c,v[2]=s):c<s&&(v[0]=c,v[1]=s,v[2]=l)}r.sort(o);var u=new Array(n);for(i=0;i<u.length;++i)u[i]=0;var f=[],h=[],p=new Array(3*n),d=new Array(3*n),g=null;e&&(g=[]);var m=new a(r,p,d,u,f,h,g);for(i=0;i<n;++i)for(var v=r[i],y=0;y<3;++y){s=v[y],l=v[(y+1)%3];var x=p[3*i+y]=m.locate(l,s,t.opposite(l,s)),b=d[3*i+y]=t.isConstraint(s,l);x<0&&(b?h.push(i):(f.push(i),u[i]=1),e&&g.push([l,s,-1]))}return m}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;var i=1,s=n.active,l=n.next,c=n.flags,u=n.cells,f=n.constraint,h=n.neighbor;for(;s.length>0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i;u[p];for(var d=0;d<3;++d){var g=h[3*p+d];g>=0&&0===c[g]&&(f[3*p+d]?l.push(g):(s.push(g),c[g]=i))}}}var m=l;l=s,s=m,l.length=0,i=-i}var v=function(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}(u,c,e);if(r)return v.concat(n.boundary);return v},a.prototype.locate=(n=[0,0,0],function(t,e,r){var a=t,s=e,l=r;return e<r?e<t&&(a=e,s=r,l=t):r<t&&(a=r,s=t,l=e),a<0?-1:(n[0]=a,n[1]=s,n[2]=l,i.eq(this.cells,n,o))})},{\"binary-search-bounds\":96}],115:[function(t,e,r){\"use strict\";var n=t(\"binary-search-bounds\"),i=t(\"robust-orientation\")[3];function a(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function o(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function s(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(0!==t.type&&(r=i(t.a,t.b,e.b))?r:t.idx-e.idx)}function l(t,e){return i(t.a,t.b,e)}function c(t,e,r,a,o){for(var s=n.lt(e,a,l),c=n.gt(e,a,l),u=s;u<c;++u){for(var f=e[u],h=f.lowerIds,p=h.length;p>1&&i(r[h[p-2]],r[h[p-1]],a)>0;)t.push([h[p-1],h[p-2],o]),p-=1;h.length=p,h.push(o);var d=f.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]<e.a[0]?i(t.a,t.b,e.a):i(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?i(t.a,t.b,e.b):i(e.b,e.a,t.b))||t.idx-e.idx}function f(t,e,r){var i=n.le(t,r,u),o=t[i],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],t.splice(i+1,0,new a(r.a,r.b,r.idx,[l],s))}function h(t,e,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(t,r,u),o=t[a];t[a-1].upperIds=o.upperIds,t.splice(a,1)}e.exports=function(t,e){for(var r=t.length,n=e.length,i=[],l=0;l<r;++l)i.push(new o(t[l],null,0,l));for(l=0;l<n;++l){var u=e[l],p=t[u[0]],d=t[u[1]];p[0]<d[0]?i.push(new o(p,d,2,l),new o(d,p,1,l)):p[0]>d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var g=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),m=[new a([g,1],[g,0],-1,[],[],[],[])],v=[],y=(l=0,i.length);l<y;++l){var x=i[l],b=x.type;0===b?c(v,m,t,x.a,x.idx):2===b?f(m,t,x):h(m,t,x)}return v}},{\"binary-search-bounds\":96,\"robust-orientation\":548}],116:[function(t,e,r){\"use strict\";var n=t(\"binary-search-bounds\");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new i(r,e)};var a=i.prototype;function o(t,e,r){for(var n=1,i=t.length;n<i;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)}a.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,i){return t[0]=Math.min(r,i),t[1]=Math.max(r,i),n.eq(this.edges,t,e)>=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},a.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)},a.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},a.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;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\":96}],117:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}},{}],118:[function(t,e,r){\"use strict\";var n=t(\"dup\"),i=t(\"robust-linear-solve\");function a(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function o(t){var e=t.length;if(0===e)return[];t[0].length;var r=n([t.length+1,t.length+1],1),o=n([t.length+1],1);r[e][e]=0;for(var s=0;s<e;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*a(t[s],t[l]);o[s]=a(t[s],t[s])}var c=i(r,o),u=0,f=c[e+1];for(s=0;s<f.length;++s)u+=f[s];var h=new Array(e);for(s=0;s<e;++s){f=c[s];var p=0;for(l=0;l<f.length;++l)p+=f[l];h[s]=p/u}return h}function s(t){if(0===t.length)return[];for(var e=t[0].length,r=n([e]),i=o(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*i[a];return r}s.barycenetric=o,e.exports=s},{dup:176,\"robust-linear-solve\":547}],119:[function(t,e,r){e.exports=function(t){for(var e=n(t),r=0,i=0;i<t.length;++i)for(var a=t[i],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)};var n=t(\"circumcenter\")},{circumcenter:118}],120:[function(t,e,r){e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}},{}],121:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}var s=function(t,e,r){var n=d(t,[],p(t));return v(e,n,r),!!n}(t,e,!!r);for(;y(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(a=0;a<e.length;++a){o=e[a];n.push([o[0],o[1]]),r.push(o[2])}}return s};var n=t(\"union-find\"),i=t(\"box-intersect\"),a=t(\"robust-segment-intersect\"),o=t(\"big-rat\"),s=t(\"big-rat/cmp\"),l=t(\"big-rat/to-float\"),c=t(\"rat-vec\"),u=t(\"nextafter\"),f=t(\"./lib/rat-seg-intersect\");function h(t){var e=l(t);return[u(e,-1/0),u(e,1/0)]}function p(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return e}function d(t,e,r){for(var a=e.length,o=new n(a),s=[],l=0;l<e.length;++l){var c=e[l],f=h(c[0]),p=h(c[1]);s.push([u(f[0],-1/0),u(p[0],-1/0),u(f[1],1/0),u(p[1],1/0)])}i(s,(function(t,e){o.link(t,e)}));var d=!0,g=new Array(a);for(l=0;l<a;++l){(v=o.find(l))!==l&&(d=!1,t[v]=[Math.min(t[l][0],t[v][0]),Math.min(t[l][1],t[v][1])])}if(d)return null;var m=0;for(l=0;l<a;++l){var v;(v=o.find(l))===l?(g[l]=m,t[m++]=t[l]):g[l]=-1}t.length=m;for(l=0;l<a;++l)g[l]<0&&(g[l]=g[o.find(l)]);return g}function g(t,e){return t[0]-e[0]||t[1]-e[1]}function m(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=e[(o=t[n])[0]],a=e[o[1]];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}else for(n=0;n<t.length;++n){var o;i=(o=t[n])[0],a=o[1];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}r?t.sort(m):t.sort(g);var s=1;for(n=1;n<t.length;++n){var l=t[n-1],c=t[n];(c[0]!==l[0]||c[1]!==l[1]||r&&c[2]!==l[2])&&(t[s++]=c)}t.length=s}}function y(t,e,r){var n=function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[u(Math.min(a[0],o[0]),-1/0),u(Math.min(a[1],o[1]),-1/0),u(Math.max(a[0],o[0]),1/0),u(Math.max(a[1],o[1]),1/0)]}return r}(t,e),h=function(t,e,r){var n=[];return i(r,(function(r,i){var o=e[r],s=e[i];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],c=t[o[1]],u=t[s[0]],f=t[s[1]];a(l,c,u,f)&&n.push([r,i])}})),n}(t,e,n),g=p(t),m=function(t,e,r,n){var o=[];return i(r,n,(function(r,n){var i=e[r];if(i[0]!==n&&i[1]!==n){var s=t[n],l=t[i[0]],c=t[i[1]];a(l,c,s,s)&&o.push([r,n])}})),o}(t,e,n,g),y=d(t,function(t,e,r,n,i){var a,u,h=t.map((function(t){return[o(t[0]),o(t[1])]}));for(a=0;a<r.length;++a){var p=r[a];u=p[0];var d=p[1],g=e[u],m=e[d],v=f(c(t[g[0]]),c(t[g[1]]),c(t[m[0]]),c(t[m[1]]));if(v){var y=t.length;t.push([l(v[0]),l(v[1])]),h.push(v),n.push([u,y],[d,y])}}for(n.sort((function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=h[t[1]],n=h[e[1]];return s(r[0],n[0])||s(r[1],n[1])})),a=n.length-1;a>=0;--a){var x=e[u=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var k=b;b=_,_=k}x[0]=b;var M,A=x[1]=S[1];for(i&&(M=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([A,E,M]):e.push([A,E]),A=E}i?e.push([A,_,M]):e.push([A,_])}return h}(t,e,h,m,r));return v(e,y,r),!!y||(h.length>0||m.length>0)}},{\"./lib/rat-seg-intersect\":122,\"big-rat\":83,\"big-rat/cmp\":81,\"big-rat/to-float\":95,\"box-intersect\":101,nextafter:496,\"rat-vec\":530,\"robust-segment-intersect\":551,\"union-find\":596}],122:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=u(a,f);if(0===o(h))return null;var p=s(t,r),d=u(f,p),g=i(d,h),m=c(a,g);return l(t,m)};var n=t(\"big-rat/mul\"),i=t(\"big-rat/div\"),a=t(\"big-rat/sub\"),o=t(\"big-rat/sign\"),s=t(\"rat-vec/sub\"),l=t(\"rat-vec/add\"),c=t(\"rat-vec/muls\");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{\"big-rat/div\":82,\"big-rat/mul\":92,\"big-rat/sign\":93,\"big-rat/sub\":94,\"rat-vec/add\":529,\"rat-vec/muls\":531,\"rat-vec/sub\":532}],123:[function(t,e,r){\"use strict\";var n=t(\"clamp\");function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:120}],124:[function(t,e,r){\"use strict\";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],125:[function(t,e,r){\"use strict\";var n=t(\"color-rgba\"),i=t(\"clamp\"),a=t(\"dtype\");e.exports=function(t,e){\"float\"!==e&&e||(e=\"array\"),\"uint\"===e&&(e=\"uint8\"),\"uint_clamped\"===e&&(e=\"uint8_clamped\");var r=new(a(e))(4),o=\"uint8\"!==e&&\"uint8_clamped\"!==e;return t.length&&\"string\"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},{clamp:120,\"color-rgba\":127,dtype:175}],126:[function(t,e,r){(function(r){(function(){\"use strict\";var n=t(\"color-name\"),i=t(\"is-plain-obj\"),a=t(\"defined\");e.exports=function(t){var e,s,l=[],c=1;if(\"string\"==typeof t)if(n[t])l=n[t].slice(),s=\"rgb\";else if(\"transparent\"===t)c=0,s=\"rgb\",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=(p=t.slice(1)).length;c=1,u<=4?(l=[parseInt(p[0]+p[0],16),parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16)],4===u&&(c=parseInt(p[3]+p[3],16)/255)):(l=[parseInt(p[0]+p[1],16),parseInt(p[2]+p[3],16),parseInt(p[4]+p[5],16)],8===u&&(c=parseInt(p[6]+p[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s=\"rgb\"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(t)){var f=e[1],h=\"rgb\"===f,p=f.replace(/a$/,\"\");s=p;u=\"cmyk\"===p?4:\"gray\"===p?1:3;l=e[2].trim().split(/\\s*,\\s*/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:\"rgb\"===p?255*parseFloat(t)/100:parseFloat(t);if(\"h\"===p[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===p&&l.push(1),c=h||void 0===l[u]?1:l[u],l=l.slice(0,u)}else t.length>10&&/[0-9](?:\\s|\\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join(\"\").toLowerCase());else if(isNaN(t))if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s=\"rgb\",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s=\"hsl\",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s=\"rgb\",c=4===t.length?t[3]:1);else s=\"rgb\",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"color-name\":124,defined:170,\"is-plain-obj\":469}],127:[function(t,e,r){\"use strict\";var n=t(\"color-parse\"),i=t(\"color-space/hsl\"),a=t(\"clamp\");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),\"h\"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:120,\"color-parse\":126,\"color-space/hsl\":128}],128:[function(t,e,r){\"use strict\";var n=t(\"./rgb\");e.exports={name:\"hsl\",min:[0,0,0],max:[360,100,100],channel:[\"hue\",\"saturation\",\"lightness\"],alias:[\"HSL\"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{\"./rgb\":129}],129:[function(t,e,r){\"use strict\";e.exports={name:\"rgb\",min:[0,0,0],max:[255,255,255],channel:[\"red\",\"green\",\"blue\"],alias:[\"RGB\"]}},{}],130:[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:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],\"rainbow-soft\":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],\"freesurface-blue\":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],\"freesurface-red\":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],\"velocity-blue\":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],\"velocity-green\":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],131:[function(t,e,r){\"use strict\";var n=t(\"./colorScale\"),i=t(\"lerp\");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r=\"#\",n=0;n<3;++n)r+=(\"00\"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return\"rgba(\"+t.join(\",\")+\")\"}e.exports=function(t){var e,r,l,c,u,f,h,p,d,g;t||(t={});p=(t.nshades||72)-1,h=t.format||\"hex\",(f=t.colormap)||(f=\"jet\");if(\"string\"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+\" not a supported colorscale\");u=n[f]}else{if(!Array.isArray(f))throw Error(\"unsupported colormap option\",f);u=f.slice()}if(u.length>p+1)throw new Error(f+\" map requires nshades to be at least size \"+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():\"number\"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var m=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),v=[];for(g=0;g<e.length-1;++g){c=e[g+1]-e[g],r=m[g],l=m[g+1];for(var y=0;y<c;y++){var x=y/c;v.push([Math.round(i(r[0],l[0],x)),Math.round(i(r[1],l[1],x)),Math.round(i(r[2],l[2],x)),i(r[3],l[3],x)])}}v.push(u[u.length-1].rgb.concat(d[1])),\"hex\"===h?v=v.map(o):\"rgbaString\"===h?v=v.map(s):\"float\"===h&&(v=v.map(a));return v}},{\"./colorScale\":130,lerp:472}],132:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,a){var o=n(e,r,a);if(0===o){var s=i(n(t,e,r)),c=i(n(t,e,a));if(s===c){if(0===s){var u=l(t,e,r),f=l(t,e,a);return u===f?0:u?1:-1}return 0}return 0===c?s>0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=t(\"robust-orientation\"),i=t(\"signum\"),a=t(\"two-sum\"),o=t(\"robust-product\"),s=t(\"robust-sum\");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{\"robust-orientation\":548,\"robust-product\":549,\"robust-sum\":553,signum:554,\"two-sum\":583}],133:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(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=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],p=t[3],d=e[0],g=e[1],m=e[2],v=e[3];return u+f+h+p-(d+g+m+v)||n(u,f,h,p)-n(d,g,m,v,d)||n(u+f,u+h,u+p,f+h,f+p,h+p)-n(d+g,d+m,d+v,g+m,g+v,m+v)||n(u+f+h,u+f+p,u+h+p,f+h+p)-n(d+g+m,d+g+v,d+m+v,g+m+v);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;b<r;++b)if(a=y[b]-x[b])return a;return 0}};var n=Math.min;function i(t,e){return t-e}},{}],134:[function(t,e,r){\"use strict\";var n=t(\"compare-cell\"),i=t(\"cell-orientation\");e.exports=function(t,e){return n(t,e)||i(t)-i(e)}},{\"cell-orientation\":117,\"compare-cell\":133}],135:[function(t,e,r){\"use strict\";var n=t(\"./lib/ch1d\"),i=t(\"./lib/ch2d\"),a=t(\"./lib/chnd\");e.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;if(0===r)return[];if(1===r)return n(t);if(2===r)return i(t);return a(t,r)}},{\"./lib/ch1d\":136,\"./lib/ch2d\":137,\"./lib/chnd\":138}],136:[function(t,e,r){\"use strict\";e.exports=function(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 e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}},{}],137:[function(t,e,r){\"use strict\";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];i[o]=[a,s],a=s}return i};var n=t(\"monotone-convex-hull-2d\")},{\"monotone-convex-hull-2d\":482}],138:[function(t,e,r){\"use strict\";e.exports=function(t,e){try{return n(t,!0)}catch(o){var r=i(t);if(r.length<=e)return[];var a=function(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];var a=e.length;for(i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}(t,r);return function(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t(\"incremental-convex-hull\"),i=t(\"affine-hull\")},{\"affine-hull\":67,\"incremental-convex-hull\":459}],139:[function(t,e,r){e.exports={AFG:\"afghan\",ALA:\"\\\\b\\\\wland\",ALB:\"albania\",DZA:\"algeria\",ASM:\"^(?=.*americ).*samoa\",AND:\"andorra\",AGO:\"angola\",AIA:\"anguill?a\",ATA:\"antarctica\",ATG:\"antigua\",ARG:\"argentin\",ARM:\"armenia\",ABW:\"^(?!.*bonaire).*\\\\baruba\",AUS:\"australia\",AUT:\"^(?!.*hungary).*austria|\\\\baustri.*\\\\bemp\",AZE:\"azerbaijan\",BHS:\"bahamas\",BHR:\"bahrain\",BGD:\"bangladesh|^(?=.*east).*paki?stan\",BRB:\"barbados\",BLR:\"belarus|byelo\",BEL:\"^(?!.*luxem).*belgium\",BLZ:\"belize|^(?=.*british).*honduras\",BEN:\"benin|dahome\",BMU:\"bermuda\",BTN:\"bhutan\",BOL:\"bolivia\",BES:\"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\\\bbes.?islands\",BIH:\"herzegovina|bosnia\",BWA:\"botswana|bechuana\",BVT:\"bouvet\",BRA:\"brazil\",IOT:\"british.?indian.?ocean\",BRN:\"brunei\",BGR:\"bulgaria\",BFA:\"burkina|\\\\bfaso|upper.?volta\",BDI:\"burundi\",CPV:\"verde\",KHM:\"cambodia|kampuchea|khmer\",CMR:\"cameroon\",CAN:\"canada\",CYM:\"cayman\",CAF:\"\\\\bcentral.african.republic\",TCD:\"\\\\bchad\",CHL:\"\\\\bchile\",CHN:\"^(?!.*\\\\bmac)(?!.*\\\\bhong)(?!.*\\\\btai)(?!.*\\\\brep).*china|^(?=.*peo)(?=.*rep).*china\",CXR:\"christmas\",CCK:\"\\\\bcocos|keeling\",COL:\"colombia\",COM:\"comoro\",COG:\"^(?!.*\\\\bdem)(?!.*\\\\bd[\\\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\\\bcongo\",COK:\"\\\\bcook\",CRI:\"costa.?rica\",CIV:\"ivoire|ivory\",HRV:\"croatia\",CUB:\"\\\\bcuba\",CUW:\"^(?!.*bonaire).*\\\\bcura(c|\\xe7)ao\",CYP:\"cyprus\",CSK:\"czechoslovakia\",CZE:\"^(?=.*rep).*czech|czechia|bohemia\",COD:\"\\\\bdem.*congo|congo.*\\\\bdem|congo.*\\\\bd[\\\\.]?r|\\\\bd[\\\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc\",DNK:\"denmark\",DJI:\"djibouti\",DMA:\"dominica(?!n)\",DOM:\"dominican.rep\",ECU:\"ecuador\",EGY:\"egypt\",SLV:\"el.?salvador\",GNQ:\"guine.*eq|eq.*guine|^(?=.*span).*guinea\",ERI:\"eritrea\",EST:\"estonia\",ETH:\"ethiopia|abyssinia\",FLK:\"falkland|malvinas\",FRO:\"faroe|faeroe\",FJI:\"fiji\",FIN:\"finland\",FRA:\"^(?!.*\\\\bdep)(?!.*martinique).*france|french.?republic|\\\\bgaul\",GUF:\"^(?=.*french).*guiana\",PYF:\"french.?polynesia|tahiti\",ATF:\"french.?southern\",GAB:\"gabon\",GMB:\"gambia\",GEO:\"^(?!.*south).*georgia\",DDR:\"german.?democratic.?republic|democratic.?republic.*germany|east.germany\",DEU:\"^(?!.*east).*germany|^(?=.*\\\\bfed.*\\\\brep).*german\",GHA:\"ghana|gold.?coast\",GIB:\"gibraltar\",GRC:\"greece|hellenic|hellas\",GRL:\"greenland\",GRD:\"grenada\",GLP:\"guadeloupe\",GUM:\"\\\\bguam\",GTM:\"guatemala\",GGY:\"guernsey\",GIN:\"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea\",GNB:\"bissau|^(?=.*portu).*guinea\",GUY:\"guyana|british.?guiana\",HTI:\"haiti\",HMD:\"heard.*mcdonald\",VAT:\"holy.?see|vatican|papal.?st\",HND:\"^(?!.*brit).*honduras\",HKG:\"hong.?kong\",HUN:\"^(?!.*austr).*hungary\",ISL:\"iceland\",IND:\"india(?!.*ocea)\",IDN:\"indonesia\",IRN:\"\\\\biran|persia\",IRQ:\"\\\\biraq|mesopotamia\",IRL:\"(^ireland)|(^republic.*ireland)\",IMN:\"^(?=.*isle).*\\\\bman\",ISR:\"israel\",ITA:\"italy\",JAM:\"jamaica\",JPN:\"japan\",JEY:\"jersey\",JOR:\"jordan\",KAZ:\"kazak\",KEN:\"kenya|british.?east.?africa|east.?africa.?prot\",KIR:\"kiribati\",PRK:\"^(?=.*democrat|people|north|d.*p.*.r).*\\\\bkorea|dprk|korea.*(d.*p.*r)\",KWT:\"kuwait\",KGZ:\"kyrgyz|kirghiz\",LAO:\"\\\\blaos?\\\\b\",LVA:\"latvia\",LBN:\"lebanon\",LSO:\"lesotho|basuto\",LBR:\"liberia\",LBY:\"libya\",LIE:\"liechtenstein\",LTU:\"lithuania\",LUX:\"^(?!.*belg).*luxem\",MAC:\"maca(o|u)\",MDG:\"madagascar|malagasy\",MWI:\"malawi|nyasa\",MYS:\"malaysia\",MDV:\"maldive\",MLI:\"\\\\bmali\\\\b\",MLT:\"\\\\bmalta\",MHL:\"marshall\",MTQ:\"martinique\",MRT:\"mauritania\",MUS:\"mauritius\",MYT:\"\\\\bmayotte\",MEX:\"\\\\bmexic\",FSM:\"fed.*micronesia|micronesia.*fed\",MCO:\"monaco\",MNG:\"mongolia\",MNE:\"^(?!.*serbia).*montenegro\",MSR:\"montserrat\",MAR:\"morocco|\\\\bmaroc\",MOZ:\"mozambique\",MMR:\"myanmar|burma\",NAM:\"namibia\",NRU:\"nauru\",NPL:\"nepal\",NLD:\"^(?!.*\\\\bant)(?!.*\\\\bcarib).*netherlands\",ANT:\"^(?=.*\\\\bant).*(nether|dutch)\",NCL:\"new.?caledonia\",NZL:\"new.?zealand\",NIC:\"nicaragua\",NER:\"\\\\bniger(?!ia)\",NGA:\"nigeria\",NIU:\"niue\",NFK:\"norfolk\",MNP:\"mariana\",NOR:\"norway\",OMN:\"\\\\boman|trucial\",PAK:\"^(?!.*east).*paki?stan\",PLW:\"palau\",PSE:\"palestin|\\\\bgaza|west.?bank\",PAN:\"panama\",PNG:\"papua|new.?guinea\",PRY:\"paraguay\",PER:\"peru\",PHL:\"philippines\",PCN:\"pitcairn\",POL:\"poland\",PRT:\"portugal\",PRI:\"puerto.?rico\",QAT:\"qatar\",KOR:\"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\\\bkorea(?!.*d.*p.*r)\",MDA:\"moldov|b(a|e)ssarabia\",REU:\"r(e|\\xe9)union\",ROU:\"r(o|u|ou)mania\",RUS:\"\\\\brussia|soviet.?union|u\\\\.?s\\\\.?s\\\\.?r|socialist.?republics\",RWA:\"rwanda\",BLM:\"barth(e|\\xe9)lemy\",SHN:\"helena\",KNA:\"kitts|\\\\bnevis\",LCA:\"\\\\blucia\",MAF:\"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)\",SPM:\"miquelon\",VCT:\"vincent\",WSM:\"^(?!.*amer).*samoa\",SMR:\"san.?marino\",STP:\"\\\\bs(a|\\xe3)o.?tom(e|\\xe9)\",SAU:\"\\\\bsa\\\\w*.?arabia\",SEN:\"senegal\",SRB:\"^(?!.*monte).*serbia\",SYC:\"seychell\",SLE:\"sierra\",SGP:\"singapore\",SXM:\"^(?!.*martin)(?!.*saba).*maarten\",SVK:\"^(?!.*cze).*slovak\",SVN:\"slovenia\",SLB:\"solomon\",SOM:\"somali\",ZAF:\"south.africa|s\\\\\\\\..?africa\",SGS:\"south.?georgia|sandwich\",SSD:\"\\\\bs\\\\w*.?sudan\",ESP:\"spain\",LKA:\"sri.?lanka|ceylon\",SDN:\"^(?!.*\\\\bs(?!u)).*sudan\",SUR:\"surinam|dutch.?guiana\",SJM:\"svalbard\",SWZ:\"swaziland\",SWE:\"sweden\",CHE:\"switz|swiss\",SYR:\"syria\",TWN:\"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china\",TJK:\"tajik\",THA:\"thailand|\\\\bsiam\",MKD:\"macedonia|fyrom\",TLS:\"^(?=.*leste).*timor|^(?=.*east).*timor\",TGO:\"togo\",TKL:\"tokelau\",TON:\"tonga\",TTO:\"trinidad|tobago\",TUN:\"tunisia\",TUR:\"turkey\",TKM:\"turkmen\",TCA:\"turks\",TUV:\"tuvalu\",UGA:\"uganda\",UKR:\"ukrain\",ARE:\"emirates|^u\\\\.?a\\\\.?e\\\\.?$|united.?arab.?em\",GBR:\"united.?kingdom|britain|^u\\\\.?k\\\\.?$\",TZA:\"tanzania\",USA:\"united.?states\\\\b(?!.*islands)|\\\\bu\\\\.?s\\\\.?a\\\\.?\\\\b|^\\\\s*u\\\\.?s\\\\.?\\\\b(?!.*islands)\",UMI:\"minor.?outlying.?is\",URY:\"uruguay\",UZB:\"uzbek\",VUT:\"vanuatu|new.?hebrides\",VEN:\"venezuela\",VNM:\"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam\",VGB:\"^(?=.*\\\\bu\\\\.?\\\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin\",VIR:\"^(?=.*\\\\bu\\\\.?\\\\s?s).*virgin|^(?=.*states).*virgin\",WLF:\"futuna|wallis\",ESH:\"western.sahara\",YEM:\"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YMD:\"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YUG:\"yugoslavia\",ZMB:\"zambia|northern.?rhodesia\",EAZ:\"zanzibar\",ZWE:\"zimbabwe|^(?!.*northern).*rhodesia\"}},{}],140:[function(t,e,r){e.exports=[\"xx-small\",\"x-small\",\"small\",\"medium\",\"large\",\"x-large\",\"xx-large\",\"larger\",\"smaller\"]},{}],141:[function(t,e,r){e.exports=[\"normal\",\"condensed\",\"semi-condensed\",\"extra-condensed\",\"ultra-condensed\",\"expanded\",\"semi-expanded\",\"extra-expanded\",\"ultra-expanded\"]},{}],142:[function(t,e,r){e.exports=[\"normal\",\"italic\",\"oblique\"]},{}],143:[function(t,e,r){e.exports=[\"normal\",\"bold\",\"bolder\",\"lighter\",\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"]},{}],144:[function(t,e,r){\"use strict\";e.exports={parse:t(\"./parse\"),stringify:t(\"./stringify\")}},{\"./parse\":146,\"./stringify\":147}],145:[function(t,e,r){\"use strict\";var n=t(\"css-font-size-keywords\");e.exports={isSize:function(t){return/^[\\d\\.]/.test(t)||-1!==t.indexOf(\"/\")||-1!==n.indexOf(t)}}},{\"css-font-size-keywords\":140}],146:[function(t,e,r){\"use strict\";var n=t(\"unquote\"),i=t(\"css-global-keywords\"),a=t(\"css-system-font-keywords\"),o=t(\"css-font-weight-keywords\"),s=t(\"css-font-style-keywords\"),l=t(\"css-font-stretch-keywords\"),c=t(\"string-split-by\"),u=t(\"./lib/util\").isSize;e.exports=h;var f=h.cache={};function h(t){if(\"string\"!=typeof t)throw new Error(\"Font argument must be a string.\");if(f[t])return f[t];if(\"\"===t)throw new Error(\"Cannot parse an empty string.\");if(-1!==a.indexOf(t))return f[t]={system:t};for(var e,r={style:\"normal\",variant:\"normal\",weight:\"normal\",stretch:\"normal\",lineHeight:\"normal\",size:\"1rem\",family:[\"serif\"]},h=c(t,/\\s+/);e=h.shift();){if(-1!==i.indexOf(e))return[\"style\",\"variant\",\"weight\",\"stretch\"].forEach((function(t){r[t]=e})),f[t]=r;if(-1===s.indexOf(e))if(\"normal\"!==e&&\"small-caps\"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(u(e)){var d=c(e,\"/\");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):\"/\"===h[0]&&(h.shift(),r.lineHeight=p(h.shift())),!h.length)throw new Error(\"Missing required font-family.\");return r.family=c(h.join(\" \"),/\\s*,\\s*/).map(n),f[t]=r}throw new Error(\"Unknown or unsupported font token: \"+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error(\"Missing required font-size.\")}function p(t){var e=parseFloat(t);return e.toString()===t?e:t}},{\"./lib/util\":145,\"css-font-stretch-keywords\":141,\"css-font-style-keywords\":142,\"css-font-weight-keywords\":143,\"css-global-keywords\":148,\"css-system-font-keywords\":149,\"string-split-by\":568,unquote:598}],147:[function(t,e,r){\"use strict\";var n=t(\"pick-by-alias\"),i=t(\"./lib/util\").isSize,a=g(t(\"css-global-keywords\")),o=g(t(\"css-system-font-keywords\")),s=g(t(\"css-font-weight-keywords\")),l=g(t(\"css-font-style-keywords\")),c=g(t(\"css-font-stretch-keywords\")),u={normal:1,\"small-caps\":1},f={serif:1,\"sans-serif\":1,monospace:1,cursive:1,fantasy:1,\"system-ui\":1},h=\"1rem\",p=\"serif\";function d(t,e){if(t&&!e[t]&&!a[t])throw Error(\"Unknown keyword `\"+t+\"`\");return t}function g(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=1;return e}e.exports=function(t){if((t=n(t,{style:\"style fontstyle fontStyle font-style slope distinction\",variant:\"variant font-variant fontVariant fontvariant var capitalization\",weight:\"weight w font-weight fontWeight fontweight\",stretch:\"stretch font-stretch fontStretch fontstretch width\",size:\"size s font-size fontSize fontsize height em emSize\",lineHeight:\"lh line-height lineHeight lineheight leading\",family:\"font family fontFamily font-family fontfamily type typeface face\",system:\"system reserved default global\"})).system)return t.system&&d(t.system,o),t.system;if(d(t.style,l),d(t.variant,u),d(t.weight,s),d(t.stretch,c),null==t.size&&(t.size=h),\"number\"==typeof t.size&&(t.size+=\"px\"),!i)throw Error(\"Bad size value `\"+t.size+\"`\");t.family||(t.family=p),Array.isArray(t.family)&&(t.family.length||(t.family=[p]),t.family=t.family.map((function(t){return f[t]?t:'\"'+t+'\"'})).join(\", \"));var e=[];return e.push(t.style),t.variant!==t.style&&e.push(t.variant),t.weight!==t.variant&&t.weight!==t.style&&e.push(t.weight),t.stretch!==t.weight&&t.stretch!==t.variant&&t.stretch!==t.style&&e.push(t.stretch),e.push(t.size+(null==t.lineHeight||\"normal\"===t.lineHeight||t.lineHeight+\"\"==\"1\"?\"\":\"/\"+t.lineHeight)),e.push(t.family),e.filter(Boolean).join(\" \")}},{\"./lib/util\":145,\"css-font-stretch-keywords\":141,\"css-font-style-keywords\":142,\"css-font-weight-keywords\":143,\"css-global-keywords\":148,\"css-system-font-keywords\":149,\"pick-by-alias\":511}],148:[function(t,e,r){e.exports=[\"inherit\",\"initial\",\"unset\"]},{}],149:[function(t,e,r){e.exports=[\"caption\",\"icon\",\"menu\",\"message-box\",\"small-caption\",\"status-bar\"]},{}],150:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=c*t[p]+u*e[p]+f*r[p]+h*n[p];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],151:[function(t,e,r){\"use strict\";var n=t(\"./lib/thunk.js\");function i(){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}e.exports=function(t){var e=new i;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var a=0;a<r.length;++a){var o=r[a];if(\"array\"===o||\"object\"==typeof o&&o.blockIndices){if(e.argTypes[a]=\"array\",e.arrayArgs.push(a),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push(\"array\"+a),a<e.pre.args.length&&e.pre.args[a].count>0)throw new Error(\"cwise: pre() block may not reference array args\");if(a<e.post.args.length&&e.post.args[a].count>0)throw new Error(\"cwise: post() block may not reference array args\")}else if(\"scalar\"===o)e.scalarArgs.push(a),e.shimArgs.push(\"scalar\"+a);else if(\"index\"===o){if(e.indexArgs.push(a),a<e.pre.args.length&&e.pre.args[a].count>0)throw new Error(\"cwise: pre() block may not reference array index\");if(a<e.body.args.length&&e.body.args[a].lvalue)throw new Error(\"cwise: body() block may not write to array index\");if(a<e.post.args.length&&e.post.args[a].count>0)throw new Error(\"cwise: post() block may not reference array index\")}else if(\"shape\"===o){if(e.shapeArgs.push(a),a<e.pre.args.length&&e.pre.args[a].lvalue)throw new Error(\"cwise: pre() block may not write to array shape\");if(a<e.body.args.length&&e.body.args[a].lvalue)throw new Error(\"cwise: body() block may not write to array shape\");if(a<e.post.args.length&&e.post.args[a].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[a]);e.argTypes[a]=\"offset\",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(a)}}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,n(e)}},{\"./lib/thunk.js\":153}],152:[function(t,e,r){\"use strict\";var n=t(\"uniq\");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n<a;++n)c.push([\"i\",n,\"=0\"].join(\"\"));for(i=0;i<o;++i)for(n=0;n<a;++n)f=u,u=t[n],0===n?c.push([\"d\",i,\"s\",n,\"=t\",i,\"p\",u].join(\"\")):c.push([\"d\",i,\"s\",n,\"=(t\",i,\"p\",u,\"-s\",f,\"*t\",i,\"p\",f,\")\"].join(\"\"));for(c.length>0&&l.push(\"var \"+c.join(\",\")),n=a-1;n>=0;--n)u=t[n],l.push([\"for(i\",n,\"=0;i\",n,\"<s\",u,\";++i\",n,\"){\"].join(\"\"));for(l.push(r),n=0;n<a;++n){for(f=u,u=t[n],i=0;i<o;++i)l.push([\"p\",i,\"+=d\",i,\"s\",n].join(\"\"));s&&(n>0&&l.push([\"index[\",f,\"]-=s\",f].join(\"\")),l.push([\"++index[\",u,\"]\"].join(\"\"))),l.push(\"}\")}return l.join(\"\\n\")}function a(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\"),c=\"\",u=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case\"offset\":var f=e.offsetArgIndex.indexOf(o);u=e.offsetArgs[f].array,c=\"+q\"+f;case\"array\":c=\"p\"+u+c;var h=\"l\"+o,p=\"a\"+u;if(0===e.arrayBlockIndices[u])1===s.count?\"generic\"===r[u]?s.lvalue?(i.push([\"var \",h,\"=\",p,\".get(\",c,\")\"].join(\"\")),n=n.replace(l,h),a.push([p,\".set(\",c,\",\",h,\")\"].join(\"\"))):n=n.replace(l,[p,\".get(\",c,\")\"].join(\"\")):n=n.replace(l,[p,\"[\",c,\"]\"].join(\"\")):\"generic\"===r[u]?(i.push([\"var \",h,\"=\",p,\".get(\",c,\")\"].join(\"\")),n=n.replace(l,h),s.lvalue&&a.push([p,\".set(\",c,\",\",h,\")\"].join(\"\"))):(i.push([\"var \",h,\"=\",p,\"[\",c,\"]\"].join(\"\")),n=n.replace(l,h),s.lvalue&&a.push([p,\"[\",c,\"]=\",h].join(\"\")));else{for(var d=[s.name],g=[c],m=0;m<Math.abs(e.arrayBlockIndices[u]);m++)d.push(\"\\\\s*\\\\[([^\\\\]]+)\\\\]\"),g.push(\"$\"+(m+1)+\"*t\"+u+\"b\"+m);if(l=new RegExp(d.join(\"\"),\"g\"),c=g.join(\"+\"),\"generic\"===r[u])throw new Error(\"cwise: Generic arrays not supported in combination with blocks!\");n=n.replace(l,[p,\"[\",c,\"]\"].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 o(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(\"\")}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,s=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),c=0;c<t.arrayArgs.length;++c)l[c]=e[2*c],s[c]=e[2*c+1];var u=[],f=[],h=[],p=[],d=[];for(c=0;c<t.arrayArgs.length;++c){t.arrayBlockIndices[c]<0?(h.push(0),p.push(r),u.push(r),f.push(r+t.arrayBlockIndices[c])):(h.push(t.arrayBlockIndices[c]),p.push(t.arrayBlockIndices[c]+r),u.push(0),f.push(t.arrayBlockIndices[c]));for(var g=[],m=0;m<s[c].length;m++)h[c]<=s[c][m]&&s[c][m]<p[c]&&g.push(s[c][m]-h[c]);d.push(g)}var v=[\"SS\"],y=[\"'use strict'\"],x=[];for(m=0;m<r;++m)x.push([\"s\",m,\"=SS[\",m,\"]\"].join(\"\"));for(c=0;c<t.arrayArgs.length;++c){v.push(\"a\"+c),v.push(\"t\"+c),v.push(\"p\"+c);for(m=0;m<r;++m)x.push([\"t\",c,\"p\",m,\"=t\",c,\"[\",h[c]+m,\"]\"].join(\"\"));for(m=0;m<Math.abs(t.arrayBlockIndices[c]);++m)x.push([\"t\",c,\"b\",m,\"=t\",c,\"[\",u[c]+m,\"]\"].join(\"\"))}for(c=0;c<t.scalarArgs.length;++c)v.push(\"Y\"+c);if(t.shapeArgs.length>0&&x.push(\"shape=SS.slice(0)\"),t.indexArgs.length>0){var b=new Array(r);for(c=0;c<r;++c)b[c]=\"0\";x.push([\"index=[\",b.join(\",\"),\"]\"].join(\"\"))}for(c=0;c<t.offsetArgs.length;++c){var _=t.offsetArgs[c],w=[];for(m=0;m<_.offset.length;++m)0!==_.offset[m]&&(1===_.offset[m]?w.push([\"t\",_.array,\"p\",m].join(\"\")):w.push([_.offset[m],\"*t\",_.array,\"p\",m].join(\"\")));0===w.length?x.push(\"q\"+c+\"=0\"):x.push([\"q\",c,\"=\",w.join(\"+\")].join(\"\"))}var T=n([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((x=x.concat(T)).length>0&&y.push(\"var \"+x.join(\",\")),c=0;c<t.arrayArgs.length;++c)y.push(\"p\"+c+\"|=0\");t.pre.body.length>3&&y.push(a(t.pre,t,l));var k=a(t.body,t,l),M=function(t){for(var e=0,r=t[0].length;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}(d);M<r?y.push(function(t,e,r,n){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,c=[],u=0;u<o;++u)c.push([\"var offset\",u,\"=p\",u].join(\"\"));for(u=t;u<a;++u)c.push([\"for(var j\"+u+\"=SS[\",e[u],\"]|0;j\",u,\">0;){\"].join(\"\")),c.push([\"if(j\",u,\"<\",s,\"){\"].join(\"\")),c.push([\"s\",e[u],\"=j\",u].join(\"\")),c.push([\"j\",u,\"=0\"].join(\"\")),c.push([\"}else{s\",e[u],\"=\",s].join(\"\")),c.push([\"j\",u,\"-=\",s,\"}\"].join(\"\")),l&&c.push([\"index[\",e[u],\"]=j\",u].join(\"\"));for(u=0;u<o;++u){for(var f=[\"offset\"+u],h=t;h<a;++h)f.push([\"j\",h,\"*t\",u,\"p\",e[h]].join(\"\"));c.push([\"p\",u,\"=(\",f.join(\"+\"),\")\"].join(\"\"))}for(c.push(i(e,r,n)),u=t;u<a;++u)c.push(\"}\");return c.join(\"\\n\")}(M,d[0],t,k)):y.push(i(d[0],t,k)),t.post.body.length>3&&y.push(a(t.post,t,l)),t.debug&&console.log(\"-----Generated cwise routine for \",e,\":\\n\"+y.join(\"\\n\")+\"\\n----------\");var A=[t.funcName||\"unnamed\",\"_cwise_loop_\",s[0].join(\"s\"),\"m\",M,o(l)].join(\"\");return new Function([\"function \",A,\"(\",v.join(\",\"),\"){\",y.join(\"\\n\"),\"} return \",A].join(\"\"))()}},{uniq:597}],153:[function(t,e,r){\"use strict\";var n=t(\"./compile.js\");e.exports=function(t){var e=[\"'use strict'\",\"var CACHED={}\"],r=[],i=t.funcName+\"_cwise_thunk\";e.push([\"return function \",i,\"(\",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=[],c=[],u=0;u<t.arrayArgs.length;++u){var f=t.arrayArgs[u];r.push([\"t\",f,\"=array\",f,\".dtype,\",\"r\",f,\"=array\",f,\".order\"].join(\"\")),a.push(\"t\"+f),a.push(\"r\"+f),o.push(\"t\"+f),o.push(\"r\"+f+\".join()\"),s.push(\"array\"+f+\".data\"),s.push(\"array\"+f+\".stride\"),s.push(\"array\"+f+\".offset|0\"),u>0&&(l.push(\"array\"+t.arrayArgs[0]+\".shape.length===array\"+f+\".shape.length+\"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push(\"array\"+t.arrayArgs[0]+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[0])+\"]===array\"+f+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[u])+\"]\"))}for(t.arrayArgs.length>1&&(e.push(\"if (!(\"+l.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\"),e.push(\"for(var shapeIndex=array\"+t.arrayArgs[0]+\".shape.length-\"+Math.abs(t.arrayBlockIndices[0])+\"; shapeIndex--\\x3e0;) {\"),e.push(\"if (!(\"+c.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same shape!')\"),e.push(\"}\")),u=0;u<t.scalarArgs.length;++u)s.push(\"scalar\"+t.scalarArgs[u]);return 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----------\"),new Function(\"compile\",e.join(\"\\n\"))(n.bind(void 0,t))}},{\"./compile.js\":152}],154:[function(t,e,r){\"use strict\";var n,i=t(\"type/value/is\"),a=t(\"type/value/ensure\"),o=t(\"type/plain-function/ensure\"),s=t(\"es5-ext/object/copy\"),l=t(\"es5-ext/object/normalize-options\"),c=t(\"es5-ext/object/map\"),u=Function.prototype.bind,f=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,i=a(e)&&o(e.value);return delete(n=s(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?i:(e.value=u.call(i,r.resolveContext?r.resolveContext(this):this),f(this,t,e),this[t])},n},e.exports=function(t){var e=l(arguments[1]);return i(e.resolveContext)&&o(e.resolveContext),c(t,(function(t,r){return n(r,t,e)}))}},{\"es5-ext/object/copy\":196,\"es5-ext/object/map\":204,\"es5-ext/object/normalize-options\":205,\"type/plain-function/ensure\":589,\"type/value/ensure\":593,\"type/value/is\":594}],155:[function(t,e,r){\"use strict\";var n=t(\"type/value/is\"),i=t(\"type/plain-function/is\"),a=t(\"es5-ext/object/assign\"),o=t(\"es5-ext/object/normalize-options\"),s=t(\"es5-ext/string/#/contains\");(e.exports=function(t,e){var r,i,l,c,u;return arguments.length<2||\"string\"!=typeof t?(c=e,e=t,t=null):c=arguments[2],n(t)?(r=s.call(t,\"c\"),i=s.call(t,\"e\"),l=s.call(t,\"w\")):(r=l=!0,i=!1),u={value:e,configurable:r,enumerable:i,writable:l},c?a(o(c),u):u}).gs=function(t,e,r){var l,c,u,f;return\"string\"!=typeof t?(u=r,r=e,e=t,t=null):u=arguments[3],n(e)?i(e)?n(r)?i(r)||(u=r,r=void 0):r=void 0:(u=e,e=r=void 0):e=void 0,n(t)?(l=s.call(t,\"c\"),c=s.call(t,\"e\")):(l=!0,c=!1),f={get:e,set:r,configurable:l,enumerable:c},u?a(o(u),f):f}},{\"es5-ext/object/assign\":193,\"es5-ext/object/normalize-options\":205,\"es5-ext/string/#/contains\":212,\"type/plain-function/is\":590,\"type/value/is\":594}],156:[function(t,e,r){!function(t,n){n(\"object\"==typeof r&&\"undefined\"!=typeof e?r:t.d3=t.d3||{})}(this,(function(t){\"use strict\";function e(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o<i;)isNaN(r=s(t[o]))||(c+=(n=r-l)*(r-(l+=n/++a)));else for(;++o<i;)isNaN(r=s(e(t[o],o,t)))||(c+=(n=r-l)*(r-(l+=n/++a)));if(a>1)return c/(a-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(r=t[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=i=r;++o<a;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]}var f=Array.prototype,h=f.slice,p=f.map;function d(t){return function(){return t}}function g(t){return t}function m(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a}var v=Math.sqrt(50),y=Math.sqrt(10),x=Math.sqrt(2);function b(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=v?10:a>=y?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=v?10:a>=y?5:a>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=v?i*=10:a>=y?i*=5:a>=x&&(i*=2),e<t?-i:i}function w(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function T(t,e,r){if(null==r&&(r=s),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function k(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&n>r&&(n=r);return n}function M(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,A),n=new Array(r);++e<r;)for(var i,a=-1,o=n[e]=new Array(i);++a<i;)o[a]=t[a][e];return n}function A(t){return t.length}t.bisect=i,t.bisectRight=i,t.bisectLeft=a,t.ascending=e,t.bisector=r,t.cross=function(t,e,r){var n,i,a,s,l=t.length,c=e.length,u=new Array(l*c);for(null==r&&(r=o),n=a=0;n<l;++n)for(s=t[n],i=0;i<c;++i,++a)u[a]=r(s,e[i]);return u},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=g,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;a<s;++a)l[a]=t(n[a],a,n);var c=e(l),u=c[0],f=c[1],h=r(l,u,f);Array.isArray(h)||(h=_(u,f,h),h=m(Math.ceil(u/h)*h,f,h));for(var p=h.length;h[0]<=u;)h.shift(),--p;for(;h[p-1]>f;)h.pop(),--p;var d,g=new Array(p+1);for(a=0;a<=p;++a)(d=g[a]=[]).x0=a>0?h[a-1]:u,d.x1=a<p?h[a]:f;for(a=0;a<s;++a)u<=(o=l[a])&&o<=f&&g[i(h,o,0,p)].push(n[a]);return g}return n.value=function(e){return arguments.length?(t=\"function\"==typeof e?e:d(e),n):t},n.domain=function(t){return arguments.length?(e=\"function\"==typeof t?t:d([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r=\"function\"==typeof t?t:Array.isArray(t)?d(h.call(t)):d(t),n):r},n},t.thresholdFreedmanDiaconis=function(t,r,n){return t=p.call(t,s).sort(e),Math.ceil((n-r)/(2*(T(t,.75)-T(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,r){return Math.ceil((r-e)/(3.5*c(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=w,t.max=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&r>n&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=s(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=s(e(t[a],a,t)))?--i:o+=r;if(i)return o/i},t.median=function(t,r){var n,i=t.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=s(t[a]))||o.push(n);else for(;++a<i;)isNaN(n=s(r(t[a],a,t)))||o.push(n);return T(o.sort(e),.5)},t.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(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return a},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.quantile=T,t.range=m,t.scan=function(t,r){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==r&&(r=e);++a<n;)(r(i=t[a],s)<0||0!==r(s,s))&&(s=i,o=a);return 0===r(s,s)?o:void 0}},t.shuffle=function(t,e,r){for(var n,i,a=(null==r?t.length:r)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.sum=function(t,e){var r,n=t.length,i=-1,a=0;if(null==e)for(;++i<n;)(r=+t[i])&&(a+=r);else for(;++i<n;)(r=+e(t[i],i,t))&&(a+=r);return a},t.ticks=function(t,e,r){var n,i,a,o,s=-1;if(r=+r,(t=+t)===(e=+e)&&r>0)return[t];if((n=e<t)&&(i=t,t=e,e=i),0===(o=b(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(t-s)/o;return n&&a.reverse(),a},t.tickIncrement=b,t.tickStep=_,t.transpose=M,t.variance=l,t.zip=function(){return M(arguments)},Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],157:[function(t,e,r){!function(t,n){n(\"object\"==typeof r&&\"undefined\"!=typeof e?r:t.d3=t.d3||{})}(this,(function(t){\"use strict\";function e(){}function r(t,r){var n=new e;if(t instanceof e)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var i,a=-1,o=t.length;if(null==r)for(;++a<o;)n.set(a,t[a]);else for(;++a<o;)n.set(r(i=t[a],a,t),i)}else if(t)for(var s in t)n.set(s,t[s]);return n}function n(){return{}}function i(t,e,r){t[e]=r}function a(){return r()}function o(t,e,r){t.set(e,r)}function s(){}e.prototype=r.prototype={constructor:e,has:function(t){return\"$\"+t in this},get:function(t){return this[\"$\"+t]},set:function(t,e){return this[\"$\"+t]=e,this},remove:function(t){var e=\"$\"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)\"$\"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)\"$\"===e[0]&&++t;return t},empty:function(){for(var t in this)if(\"$\"===t[0])return!1;return!0},each:function(t){for(var e in this)\"$\"===e[0]&&t(this[e],e.slice(1),this)}};var l=r.prototype;function c(t,e){var r=new s;if(t instanceof s)t.each((function(t){r.add(t)}));else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}s.prototype=c.prototype={constructor:s,has:l.has,add:function(t){return this[\"$\"+(t+=\"\")]=t,this},remove:l.remove,clear:l.clear,values:l.keys,size:l.size,empty:l.empty,each:l.each},t.nest=function(){var t,e,s,l=[],c=[];function u(n,i,a,o){if(i>=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,f,h=-1,p=n.length,d=l[i++],g=r(),m=a();++h<p;)(f=g.get(s=d(c=n[h])+\"\"))?f.push(c):g.set(s,[c]);return g.each((function(t,e){o(m,e,u(t,i,a,o))})),m}return s={object:function(t){return u(t,0,n,i)},map:function(t){return u(t,0,a,o)},entries:function(t){return function t(r,n){if(++n>l.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each((function(e,r){i.push({key:r,values:t(e,n)})}))),null!=a?i.sort((function(t,e){return a(t.key,e.key)})):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],158:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){\"use strict\";function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i=\"\\\\s*([+-]?\\\\d+)\\\\s*\",a=\"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",o=\"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",s=/^#([0-9a-f]{3,8})$/,l=new RegExp(\"^rgb\\\\(\"+[i,i,i]+\"\\\\)$\"),c=new RegExp(\"^rgb\\\\(\"+[o,o,o]+\"\\\\)$\"),u=new RegExp(\"^rgba\\\\(\"+[i,i,i,a]+\"\\\\)$\"),f=new RegExp(\"^rgba\\\\(\"+[o,o,o,a]+\"\\\\)$\"),h=new RegExp(\"^hsl\\\\(\"+[a,o,o]+\"\\\\)$\"),p=new RegExp(\"^hsla\\\\(\"+[a,o,o,a]+\"\\\\)$\"),d={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};function g(){return this.rgb().formatHex()}function m(){return this.rgb().formatRgb()}function v(t){var e,r;return t=(t+\"\").trim().toLowerCase(),(e=s.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?y(e):3===r?new w(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?x(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?x(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=l.exec(t))?new w(e[1],e[2],e[3],1):(e=c.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=u.exec(t))?x(e[1],e[2],e[3],e[4]):(e=f.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=h.exec(t))?A(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?A(e[1],e[2]/100,e[3]/100,e[4]):d.hasOwnProperty(t)?y(d[t]):\"transparent\"===t?new w(NaN,NaN,NaN,0):null}function y(t){return new w(t>>16&255,t>>8&255,255&t,1)}function x(t,e,r,n){return n<=0&&(t=e=r=NaN),new w(t,e,r,n)}function b(t){return t instanceof n||(t=v(t)),t?new w((t=t.rgb()).r,t.g,t.b,t.opacity):new w}function _(t,e,r,n){return 1===arguments.length?b(t):new w(t,e,r,null==n?1:n)}function w(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function T(){return\"#\"+M(this.r)+M(this.g)+M(this.b)}function k(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?\"rgb(\":\"rgba(\")+Math.max(0,Math.min(255,Math.round(this.r)||0))+\", \"+Math.max(0,Math.min(255,Math.round(this.g)||0))+\", \"+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?\")\":\", \"+t+\")\")}function M(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?\"0\":\"\")+t.toString(16)}function A(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new C(t,e,r,n)}function S(t){if(t instanceof C)return new C(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new C;if(t instanceof C)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r<i):r===o?(i-e)/l+2:(e-r)/l+4,l/=c<.5?o+a:2-o-a,s*=60):l=c>0&&c<1?0:s,new C(s,l,c,t.opacity)}function E(t,e,r,n){return 1===arguments.length?S(t):new C(t,e,r,null==n?1:n)}function C(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function L(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,v,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:g,formatHex:g,formatHsl:function(){return S(this).formatHsl()},formatRgb:m,toString:m}),e(w,_,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:T,formatHex:T,formatRgb:k,toString:k})),e(C,E,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new C(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new C(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new w(L(t>=240?t-240:t+120,i,n),L(t,i,n),L(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?\"hsl(\":\"hsla(\")+(this.h||0)+\", \"+100*(this.s||0)+\"%, \"+100*(this.l||0)+\"%\"+(1===t?\")\":\", \"+t+\")\")}}));var I=Math.PI/180,P=180/Math.PI,z=6/29,O=3*z*z;function D(t){if(t instanceof F)return new F(t.l,t.a,t.b,t.opacity);if(t instanceof H)return G(t);t instanceof w||(t=b(t));var e,r,n=U(t.r),i=U(t.g),a=U(t.b),o=B((.2225045*n+.7168786*i+.0606169*a)/1);return n===i&&i===a?e=r=o:(e=B((.4360747*n+.3850649*i+.1430804*a)/.96422),r=B((.0139322*n+.0971045*i+.7141733*a)/.82521)),new F(116*o-16,500*(e-o),200*(o-r),t.opacity)}function R(t,e,r,n){return 1===arguments.length?D(t):new F(t,e,r,null==n?1:n)}function F(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function B(t){return t>.008856451679035631?Math.pow(t,1/3):t/O+4/29}function N(t){return t>z?t*t*t:O*(t-4/29)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function U(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t){if(t instanceof H)return new H(t.h,t.c,t.l,t.opacity);if(t instanceof F||(t=D(t)),0===t.a&&0===t.b)return new H(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*P;return new H(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function q(t,e,r,n){return 1===arguments.length?V(t):new H(t,e,r,null==n?1:n)}function H(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function G(t){if(isNaN(t.h))return new F(t.l,0,0,t.opacity);var e=t.h*I;return new F(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}e(F,R,r(n,{brighter:function(t){return new F(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new F(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new w(j(3.1338561*(e=.96422*N(e))-1.6168667*(t=1*N(t))-.4906146*(r=.82521*N(r))),j(-.9787684*e+1.9161415*t+.033454*r),j(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),e(H,q,r(n,{brighter:function(t){return new H(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new H(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return G(this).rgb()}}));var Y=-.14861,W=1.78277,X=-.29227,Z=-.90649,J=1.97294,K=J*Z,Q=J*W,$=W*X-Z*Y;function tt(t){if(t instanceof rt)return new rt(t.h,t.s,t.l,t.opacity);t instanceof w||(t=b(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=($*n+K*e-Q*r)/($+K-Q),a=n-i,o=(J*(r-i)-X*a)/Z,s=Math.sqrt(o*o+a*a)/(J*i*(1-i)),l=s?Math.atan2(o,a)*P-120:NaN;return new rt(l<0?l+360:l,s,i,t.opacity)}function et(t,e,r,n){return 1===arguments.length?tt(t):new rt(t,e,r,null==n?1:n)}function rt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e(rt,et,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*I,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new w(255*(e+r*(Y*n+W*i)),255*(e+r*(X*n+Z*i)),255*(e+r*(J*n)),this.opacity)}})),t.color=v,t.cubehelix=et,t.gray=function(t,e){return new F(t,0,0,null==e?1:e)},t.hcl=q,t.hsl=E,t.lab=R,t.lch=function(t,e,r,n){return 1===arguments.length?V(t):new H(r,e,t,null==n?1:n)},t.rgb=_,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],159:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){\"use strict\";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+\"\")||t in i||/[\\s.]/.test(t))throw new Error(\"illegal type: \"+t);i[t]=[]}return new n(i)}function n(t){this._=t}function i(t,e){return t.trim().split(/^|\\s+/).map((function(t){var r=\"\",n=t.indexOf(\".\");if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);return{type:t,name:r}}))}function a(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function o(t,r,n){for(var i=0,a=t.length;i<a;++i)if(t[i].name===r){t[i]=e,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:r,value:n}),t}n.prototype=r.prototype={constructor:n,on:function(t,e){var r,n=this._,s=i(t+\"\",n),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&\"function\"!=typeof e)throw new Error(\"invalid callback: \"+e);for(;++l<c;)if(r=(t=s[l]).type)n[r]=o(n[r],t.name,e);else if(null==e)for(r in n)n[r]=o(n[r],t.name,null);return this}for(;++l<c;)if((r=(t=s[l]).type)&&(r=a(n[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);for(a=0,r=(n=this._[t]).length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=r,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],160:[function(t,e,r){!function(n,i){\"object\"==typeof r&&\"undefined\"!=typeof e?i(r,t(\"d3-quadtree\"),t(\"d3-collection\"),t(\"d3-dispatch\"),t(\"d3-timer\")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3,n.d3)}(this,(function(t,e,r,n,i){\"use strict\";function a(t){return function(){return t}}function o(){return 1e-6*(Math.random()-.5)}function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error(\"missing: \"+e);return r}function f(t){return t.x}function h(t){return t.y}var p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-t,s=s/a-e,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},t.forceCollide=function(t){var r,n,i=1,c=1;function u(){for(var t,a,u,h,p,d,g,m=r.length,v=0;v<c;++v)for(a=e.quadtree(r,s,l).visitAfter(f),t=0;t<m;++t)u=r[t],d=n[u.index],g=d*d,h=u.x+u.vx,p=u.y+u.vy,a.visit(y);function y(t,e,r,n,a){var s=t.data,l=t.r,c=d+l;if(!s)return e>h+c||n<h-c||r>p+c||a<p-c;if(s.index>u.index){var f=h-s.x-s.vx,m=p-s.y-s.vy,v=f*f+m*m;v<c*c&&(0===f&&(v+=(f=o())*f),0===m&&(v+=(m=o())*m),v=(c-(v=Math.sqrt(v)))/v*i,u.vx+=(f*=v)*(c=(l*=l)/(g+l)),u.vy+=(m*=v)*c,s.vx-=f*(c=1-c),s.vy-=m*c)}}}function f(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function h(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e<a;++e)i=r[e],n[i.index]=+t(i,e,r)}}return\"function\"!=typeof t&&(t=a(null==t?1:+t)),u.initialize=function(t){r=t,h()},u.iterations=function(t){return arguments.length?(c=+t,u):c},u.strength=function(t){return arguments.length?(i=+t,u):i},u.radius=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),h(),u):t},u},t.forceLink=function(t){var e,n,i,s,l,f=c,h=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},p=a(30),d=1;function g(r){for(var i=0,a=t.length;i<d;++i)for(var s,c,u,f,h,p,g,m=0;m<a;++m)c=(s=t[m]).source,f=(u=s.target).x+u.vx-c.x-c.vx||o(),h=u.y+u.vy-c.y-c.vy||o(),f*=p=((p=Math.sqrt(f*f+h*h))-n[m])/p*r*e[m],h*=p,u.vx-=f*(g=l[m]),u.vy-=h*g,c.vx+=f*(g=1-g),c.vy+=h*g}function m(){if(i){var a,o,c=i.length,h=t.length,p=r.map(i,f);for(a=0,s=new Array(c);a<h;++a)(o=t[a]).index=a,\"object\"!=typeof o.source&&(o.source=u(p,o.source)),\"object\"!=typeof o.target&&(o.target=u(p,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(a=0,l=new Array(h);a<h;++a)o=t[a],l[a]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);e=new Array(h),v(),n=new Array(h),y()}}function v(){if(i)for(var r=0,n=t.length;r<n;++r)e[r]=+h(t[r],r,t)}function y(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+p(t[e],e,t)}return null==t&&(t=[]),g.initialize=function(t){i=t,m()},g.links=function(e){return arguments.length?(t=e,m(),g):t},g.id=function(t){return arguments.length?(f=t,g):f},g.iterations=function(t){return arguments.length?(d=+t,g):d},g.strength=function(t){return arguments.length?(h=\"function\"==typeof t?t:a(+t),v(),g):h},g.distance=function(t){return arguments.length?(p=\"function\"==typeof t?t:a(+t),y(),g):p},g},t.forceManyBody=function(){var t,r,n,i,s=a(-30),l=1,c=1/0,u=.81;function p(i){var a,o=t.length,s=e.quadtree(t,f,h).visitAfter(g);for(n=i,a=0;a<o;++a)r=t[a],s.visit(m)}function d(){if(t){var e,r,n=t.length;for(i=new Array(n),e=0;e<n;++e)r=t[e],i[r.index]=+s(r,e,t)}}function g(t){var e,r,n,a,o,s=0,l=0;if(t.length){for(n=a=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(s+=e.value,l+=r,n+=r*e.x,a+=r*e.y);t.x=n/l,t.y=a/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function m(t,e,a,s){if(!t.value)return!0;var f=t.x-r.x,h=t.y-r.y,p=s-e,d=f*f+h*h;if(p*p/u<d)return d<c&&(0===f&&(d+=(f=o())*f),0===h&&(d+=(h=o())*h),d<l&&(d=Math.sqrt(l*d)),r.vx+=f*t.value*n/d,r.vy+=h*t.value*n/d),!0;if(!(t.length||d>=c)){(t.data!==r||t.next)&&(0===f&&(d+=(f=o())*f),0===h&&(d+=(h=o())*h),d<l&&(d=Math.sqrt(l*d)));do{t.data!==r&&(p=i[t.data.index]*n/d,r.vx+=f*p,r.vy+=h*p)}while(t=t.next)}}return p.initialize=function(e){t=e,d()},p.strength=function(t){return arguments.length?(s=\"function\"==typeof t?t:a(+t),d(),p):s},p.distanceMin=function(t){return arguments.length?(l=t*t,p):Math.sqrt(l)},p.distanceMax=function(t){return arguments.length?(c=t*t,p):Math.sqrt(c)},p.theta=function(t){return arguments.length?(u=t*t,p):Math.sqrt(u)},p},t.forceRadial=function(t,e,r){var n,i,o,s=a(.1);function l(t){for(var a=0,s=n.length;a<s;++a){var l=n[a],c=l.x-e||1e-6,u=l.y-r||1e-6,f=Math.sqrt(c*c+u*u),h=(o[a]-f)*i[a]*t/f;l.vx+=c*h,l.vy+=u*h}}function c(){if(n){var e,r=n.length;for(i=new Array(r),o=new Array(r),e=0;e<r;++e)o[e]=+t(n[e],e,n),i[e]=isNaN(o[e])?0:+s(n[e],e,n)}}return\"function\"!=typeof t&&(t=a(+t)),null==e&&(e=0),null==r&&(r=0),l.initialize=function(t){n=t,c()},l.strength=function(t){return arguments.length?(s=\"function\"==typeof t?t:a(+t),c(),l):s},l.radius=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),c(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(r=+t,l):r},l},t.forceSimulation=function(t){var e,a=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),f=i.timer(d),h=n.dispatch(\"tick\",\"end\");function d(){g(),h.call(\"tick\",e),a<o&&(f.stop(),h.call(\"end\",e))}function g(r){var n,i,o=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(a+=(l-a)*s,u.each((function(t){t(a)})),n=0;n<o;++n)null==(i=t[n]).fx?i.x+=i.vx*=c:(i.x=i.fx,i.vx=0),null==i.fy?i.y+=i.vy*=c:(i.y=i.fy,i.vy=0);return e}function m(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(r),a=r*p;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function v(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),m(),e={tick:g,restart:function(){return f.restart(d),e},stop:function(){return f.stop(),e},nodes:function(r){return arguments.length?(t=r,m(),u.each(v),e):t},alpha:function(t){return arguments.length?(a=+t,e):a},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(s=+t,e):+s},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(c=1-t,e):1-c},force:function(t,r){return arguments.length>1?(null==r?u.remove(t):u.set(t,v(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(i=e-(s=t[c]).x)*i+(a=r-s.y)*a)<n&&(l=s,n=o);return l},on:function(t,r){return arguments.length>1?(h.on(t,r),e):h.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(n[a]-i.x)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return\"function\"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i=\"function\"==typeof t?t:a(+t),s(),o):i},o.x=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),s(),o):t},o},t.forceY=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(n[a]-i.y)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return\"function\"!=typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i=\"function\"==typeof t?t:a(+t),s(),o):i},o.y=function(e){return arguments.length?(t=\"function\"==typeof e?e:a(+e),s(),o):t},o},Object.defineProperty(t,\"__esModule\",{value:!0})}))},{\"d3-collection\":157,\"d3-dispatch\":159,\"d3-quadtree\":164,\"d3-timer\":168}],161:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){\"use strict\";function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),f=+t.value&&(u.value=t.value),h=[u];for(null==e&&(e=o);r=h.pop();)if(f&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)h.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n<i;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(t){for(var e,r,n,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),e=i.children)for(r=0,n=e.length;r<n;++r)a.push(e[r]);for(;i=o.pop();)t(i);return this},eachBefore:function(t){for(var e,r,n=this,i=[n];n=i.pop();)if(t(n),e=n.children)for(r=e.length-1;r>=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;t=r.pop(),e=n.pop();for(;t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function f(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n<i;)e=t[n],r&&d(r,e)?++n:(r=m(a=h(a,e)),n=0);return r}function h(t,e){var r,n;if(g(e,t))return[e];for(r=0;r<t.length;++r)if(p(e,t[r])&&g(v(t[r],e),t))return[t[r],e];for(r=0;r<t.length-1;++r)for(n=r+1;n<t.length;++n)if(p(v(t[r],t[n]),e)&&p(v(t[r],e),t[n])&&p(v(t[n],e),t[r])&&g(y(t[r],t[n],e),t))return[t[r],t[n],e];throw new Error}function p(t,e){var r=t.r-e.r,n=e.x-t.x,i=e.y-t.y;return r<0||r*r<n*n+i*i}function d(t,e){var r=t.r-e.r+1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function g(t,e){for(var r=0;r<e.length;++r)if(!d(t,e[r]))return!1;return!0}function m(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return v(t[0],t[1]);case 3:return y(t[0],t[1],t[2])}var e}function v(t,e){var r=t.x,n=t.y,i=t.r,a=e.x,o=e.y,s=e.r,l=a-r,c=o-n,u=s-i,f=Math.sqrt(l*l+c*c);return{x:(r+a+l/f*u)/2,y:(n+o+c/f*u)/2,r:(f+i+s)/2}}function y(t,e,r){var n=t.x,i=t.y,a=t.r,o=e.x,s=e.y,l=e.r,c=r.x,u=r.y,f=r.r,h=n-o,p=n-c,d=i-s,g=i-u,m=l-a,v=f-a,y=n*n+i*i-a*a,x=y-o*o-s*s+l*l,b=y-c*c-u*u+f*f,_=p*d-h*g,w=(d*b-g*x)/(2*_)-n,T=(g*m-d*v)/_,k=(p*x-h*b)/(2*_)-i,M=(h*v-p*m)/_,A=T*T+M*M-1,S=2*(a+w*T+k*M),E=w*w+k*k-a*a,C=-(A?(S+Math.sqrt(S*S-4*A*E))/(2*A):E/S);return{x:n+w+T*C,y:i+k+M*C,r:C}}function x(t,e,r){var n,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+r.r,i*=i,o=t.r+r.r,i>(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function b(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function _(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,h;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;s<i;++s){x(e._,r._,n=t[s]),n=new w(n),l=r.next,c=e.previous,u=r._.r,h=e._.r;do{if(u<=h){if(b(l._,n._)){r=l,e.next=r,r.previous=e,--s;continue t}u+=l._.r,l=l.next}else{if(b(c._,n._)){(e=c).next=r,r.previous=e,--s;continue t}h+=c._.r,c=c.previous}}while(l!==c.next);for(n.previous=e,n.next=r,e.next=r.previous=r=n,a=_(e);(n=n.next)!==r;)(o=_(n))<a&&(e=n,a=o);r=e.next}for(e=[r._],n=r;(n=n.next)!==r;)e.push(n._);for(n=f(e),s=0;s<i;++s)(e=t[s]).x-=n.x,e.y-=n.y;return n.r}function k(t){return null==t?null:M(t)}function M(t){if(\"function\"!=typeof t)throw new Error;return t}function A(){return 0}function S(t){return function(){return t}}function E(t){return Math.sqrt(t.value)}function C(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function L(t,e){return function(r){if(n=r.children){var n,i,a,o=n.length,s=t(r)*e||0;if(s)for(i=0;i<o;++i)n[i].r+=s;if(a=T(n),s)for(i=0;i<o;++i)n[i].r-=s;r.r=a+s}}}function I(t){return function(e){var r=e.parent;e.r*=t,r&&(e.x=r.x+t*e.x,e.y=r.y+t*e.y)}}function P(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function z(t,e,r,n,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(n-e)/t.value;++s<l;)(a=o[s]).y0=r,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var O={depth:-1},D={};function R(t){return t.id}function F(t){return t.parentId}function B(t,e){return t.parent===e.parent?1:2}function N(t){var e=t.children;return e?e[0]:t.t}function j(t){var e=t.children;return e?e[e.length-1]:t.t}function U(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 V(t,e,r){return t.a.parent===e.parent?t.a:r}function q(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function H(t,e,r,n,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-r)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=n,a.y0=r,a.y1=r+=a.value*c}q.prototype=Object.create(c.prototype);var G=(1+Math.sqrt(5))/2;function Y(t,e,r,n,i,a){for(var o,s,l,c,u,f,h,p,d,g,m,v=[],y=e.children,x=0,b=0,_=y.length,w=e.value;x<_;){l=i-r,c=a-n;do{u=y[b++].value}while(!u&&b<_);for(f=h=u,m=u*u*(g=Math.max(c/l,l/c)/(w*t)),d=Math.max(h/m,m/f);b<_;++b){if(u+=s=y[b].value,s<f&&(f=s),s>h&&(h=s),m=u*u*g,(p=Math.max(h/m,m/f))>d){u-=s;break}d=p}v.push(o={value:u,dice:l<c,children:y.slice(x,b)}),o.dice?z(o,r,n,i,w?n+=c*u/w:a):H(o,r,n,w?r+=l*u/w:i,a),w-=u,x=b}return v}var W=function t(e){function r(t,r,n,i,a){Y(e,t,r,n,i,a)}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(G);var X=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,f=-1,h=o.length,p=t.value;++f<h;){for(l=(s=o[f]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?z(s,r,n,i,n+=(a-n)*s.value/p):H(s,r,n,r+=(i-r)*s.value/p,a),p-=s.value}else t._squarify=o=Y(e,t,r,n,i,a),o.ratio=e}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}(G);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),f=c.x-t(c,u)/2,h=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-f)/(h-f)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=A;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(C(t)).eachAfter(L(n,.5)).eachBefore(I(1)):i.eachBefore(C(E)).eachAfter(L(A,1)).eachAfter(L(n,i.r/Math.min(e,r))).eachBefore(I(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=k(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n=\"function\"==typeof t?t:S(+t),i):n},i},t.packEnclose=f,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&z(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),n.x0=i,n.y0=a,n.x1=o,n.y1=s}}(e,a)),n&&i.eachBefore(P),i}return i.round=function(t){return arguments.length?(n=!!t,i):n},i.size=function(r){return arguments.length?(t=+r[0],e=+r[1],i):[t,e]},i.padding=function(t){return arguments.length?(r=+t,i):r},i},t.stratify=function(){var t=R,e=F;function r(r){var n,i,a,o,s,u,f,h=r.length,p=new Array(h),d={};for(i=0;i<h;++i)n=r[i],s=p[i]=new c(n),null!=(u=t(n,i,r))&&(u+=\"\")&&(d[f=\"$\"+(s.id=u)]=f in d?D:s);for(i=0;i<h;++i)if(s=p[i],null!=(u=e(r[i],i,r))&&(u+=\"\")){if(!(o=d[\"$\"+u]))throw new Error(\"missing: \"+u);if(o===D)throw new Error(\"ambiguous: \"+u);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(a)throw new Error(\"multiple roots\");a=s}if(!a)throw new Error(\"no root\");if(a.parent=O,a.eachBefore((function(t){t.depth=t.parent.depth+1,--h})).eachBefore(l),a.parent=null,h>0)throw new Error(\"cycle\");return a}return r.id=function(e){return arguments.length?(t=M(e),r):t},r.parentId=function(t){return arguments.length?(e=M(t),r):e},r},t.tree=function(){var t=B,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new q(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new q(n[i],i)),r.parent=e;return(o.parent=new q(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,f=i;i.eachBefore((function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>f.depth&&(f=t)}));var h=c===u?1:t(c,u)/2,p=h-c.x,d=e/(u.x+h+p),g=r/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*g}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=j(s),a=N(a),s&&a;)l=N(l),(o=j(o)).a=e,(i=s.z+f-a.z-c+t(s._,a._))>0&&(U(V(s,e,n),e,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=f-u),a&&!N(l)&&(l.t=a,l.m+=c-h,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=W,e=!1,r=1,n=1,i=[0],a=A,o=A,s=A,l=A,c=A;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(f),i=[0],e&&t.eachBefore(P),t}function f(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,f=e.x1-r,h=e.y1-r;f<n&&(n=f=(n+f)/2),h<u&&(u=h=(u+h)/2),e.x0=n,e.y0=u,e.x1=f,e.y1=h,e.children&&(r=i[e.depth+1]=a(e)/2,n+=c(e)-r,u+=o(e)-r,(f-=s(e)-r)<n&&(n=f=(n+f)/2),(h-=l(e)-r)<u&&(u=h=(u+h)/2),t(e,n,u,f,h))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(r=+t[0],n=+t[1],u):[r,n]},u.tile=function(e){return arguments.length?(t=M(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(a=\"function\"==typeof t?t:S(+t),u):a},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o=\"function\"==typeof t?t:S(+t),u):o},u.paddingRight=function(t){return arguments.length?(s=\"function\"==typeof t?t:S(+t),u):s},u.paddingBottom=function(t){return arguments.length?(l=\"function\"==typeof t?t:S(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c=\"function\"==typeof t?t:S(+t),u):c},u},t.treemapBinary=function(t,e,r,n,i){var a,o,s=t.children,l=s.length,c=new Array(l+1);for(c[0]=o=a=0;a<l;++a)c[a+1]=o+=s[a].value;!function t(e,r,n,i,a,o,l){if(e>=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}var f=c[e],h=n/2+f,p=e+1,d=r-1;for(;p<d;){var g=p+d>>>1;c[g]<h?p=g+1:d=g}h-c[p-1]<c[p]-h&&e+1<p&&--p;var m=c[p]-f,v=n-m;if(o-i>l-a){var y=(i*v+o*m)/n;t(e,p,m,i,a,y,l),t(p,r,v,y,a,o,l)}else{var x=(a*v+l*m)/n;t(e,p,m,i,a,o,x),t(p,r,v,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=z,t.treemapResquarify=X,t.treemapSlice=H,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?H:z)(t,e,r,n,i)},t.treemapSquarify=W,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],162:[function(t,e,r){!function(n,i){\"object\"==typeof r&&\"undefined\"!=typeof e?i(r,t(\"d3-color\")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){\"use strict\";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function n(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i<e-1?t[i+2]:2*o-a;return r((n-i/e)*e,s,a,o,l)}}function i(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),a=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],l=t[(i+2)%e];return r((n-i/e)*e,a,o,s,l)}}function a(t){return function(){return t}}function o(t,e){return function(r){return t+r*e}}function s(t,e){var r=e-t;return r?o(t,r>180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+\"\"}}return i.gamma=t,i}(1);function f(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n<a;++n)i=e.rgb(r[n]),o[n]=i.r||0,s[n]=i.g||0,l[n]=i.b||0;return o=t(o),s=t(s),l=t(l),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=l(t),i+\"\"}}}var h=f(n),p=f(i);function d(t,e){e||(e=[]);var r,n=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function g(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function m(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=T(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}}function v(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function y(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function x(t,e){var r,n={},i={};for(r in null!==t&&\"object\"==typeof t||(t={}),null!==e&&\"object\"==typeof e||(e={}),e)r in t?n[r]=T(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}var b=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,_=new RegExp(b.source,\"g\");function w(t,e){var r,n,i,a=b.lastIndex=_.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=b.exec(t))&&(n=_.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,l.push({i:o,x:y(r,n)})),a=_.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+\"\"}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})}function T(t,r){var n,i=typeof r;return null==r||\"boolean\"===i?a(r):(\"number\"===i?y:\"string\"===i?(n=e.color(r))?(r=n,u):w:r instanceof e.color?u:r instanceof Date?v:g(r)?d:Array.isArray(r)?m:\"function\"!=typeof r.valueOf&&\"function\"!=typeof r.toString||isNaN(r)?x:y)(t,r)}var k,M,A,S,E=180/Math.PI,C={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function L(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*E,skewX:Math.atan(l)*E,scaleX:o,scaleY:s}}function I(t,e,r,n){function i(t){return t.length?t.pop()+\" \":\"\"}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push(\"translate(\",null,e,null,r);s.push({i:l-4,x:y(t,i)},{i:l-2,x:y(n,a)})}else(i||a)&&o.push(\"translate(\"+i+e+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+\"rotate(\",null,n)-2,x:y(t,e)})):e&&r.push(i(r)+\"rotate(\"+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+\"skewX(\",null,n)-2,x:y(t,e)}):e&&r.push(i(r)+\"skewX(\"+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+\"scale(\",null,\",\",null,\")\");o.push({i:s-4,x:y(t,r)},{i:s-2,x:y(e,n)})}else 1===r&&1===n||a.push(i(a)+\"scale(\"+r+\",\"+n+\")\")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join(\"\")}}}var P=I((function(t){return\"none\"===t?C:(k||(k=document.createElement(\"DIV\"),M=document.documentElement,A=document.defaultView),k.style.transform=t,t=A.getComputedStyle(M.appendChild(k),null).getPropertyValue(\"transform\"),M.removeChild(k),L(+(t=t.slice(7,-1).split(\",\"))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),\"px, \",\"px)\",\"deg)\"),z=I((function(t){return null==t?C:(S||(S=document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\")),S.setAttribute(\"transform\",t),(t=S.transform.baseVal.consolidate())?L((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):C)}),\", \",\")\",\")\"),O=Math.SQRT2;function D(t){return((t=Math.exp(t))+1/t)/2}function R(t){return function(r,n){var i=t((r=e.hsl(r)).h,(n=e.hsl(n)).h),a=c(r.s,n.s),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=i(t),r.s=a(t),r.l=o(t),r.opacity=s(t),r+\"\"}}}var F=R(s),B=R(c);function N(t){return function(r,n){var i=t((r=e.hcl(r)).h,(n=e.hcl(n)).h),a=c(r.c,n.c),o=c(r.l,n.l),s=c(r.opacity,n.opacity);return function(t){return r.h=i(t),r.c=a(t),r.l=o(t),r.opacity=s(t),r+\"\"}}}var j=N(s),U=N(c);function V(t){return function r(n){function i(r,i){var a=t((r=e.cubehelix(r)).h,(i=e.cubehelix(i)).h),o=c(r.s,i.s),s=c(r.l,i.l),l=c(r.opacity,i.opacity);return function(t){return r.h=a(t),r.s=o(t),r.l=s(Math.pow(t,n)),r.opacity=l(t),r+\"\"}}return n=+n,i.gamma=r,i}(1)}var q=V(s),H=V(c);t.interpolate=T,t.interpolateArray=function(t,e){return(g(e)?d:m)(t,e)},t.interpolateBasis=n,t.interpolateBasisClosed=i,t.interpolateCubehelix=q,t.interpolateCubehelixLong=H,t.interpolateDate=v,t.interpolateDiscrete=function(t){var e=t.length;return function(r){return t[Math.max(0,Math.min(e-1,Math.floor(r*e)))]}},t.interpolateHcl=j,t.interpolateHclLong=U,t.interpolateHsl=F,t.interpolateHslLong=B,t.interpolateHue=function(t,e){var r=s(+t,+e);return function(t){var e=r(t);return e-360*Math.floor(e/360)}},t.interpolateLab=function(t,r){var n=c((t=e.lab(t)).l,(r=e.lab(r)).l),i=c(t.a,r.a),a=c(t.b,r.b),o=c(t.opacity,r.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=a(e),t.opacity=o(e),t+\"\"}},t.interpolateNumber=y,t.interpolateNumberArray=d,t.interpolateObject=x,t.interpolateRgb=u,t.interpolateRgbBasis=h,t.interpolateRgbBasisClosed=p,t.interpolateRound=function(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}},t.interpolateString=w,t.interpolateTransformCss=P,t.interpolateTransformSvg=z,t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<1e-12)n=Math.log(c/o)/O,r=function(t){return[i+t*u,a+t*f,o*Math.exp(O*t*n)]};else{var p=Math.sqrt(h),d=(c*c-o*o+4*h)/(2*o*2*p),g=(c*c-o*o-4*h)/(2*c*2*p),m=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(g*g+1)-g);n=(v-m)/O,r=function(t){var e,r=t*n,s=D(m),l=o/(2*p)*(s*(e=O*r+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[i+l*u,a+l*f,o*s/D(O*r+m)]}}return r.duration=1e3*n,r},t.piecewise=function(t,e){for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return function(t){var e=Math.max(0,Math.min(n-1,Math.floor(t*=n)));return a[e](t-e)}},t.quantize=function(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r},Object.defineProperty(t,\"__esModule\",{value:!0})}))},{\"d3-color\":158}],163:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){\"use strict\";var e=Math.PI,r=2*e,n=r-1e-6;function i(){this._x0=this._y0=this._x1=this._y1=null,this._=\"\"}function a(){return new i}i.prototype=a.prototype={constructor:i,moveTo:function(t,e){this._+=\"M\"+(this._x0=this._x1=+t)+\",\"+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+=\"Z\")},lineTo:function(t,e){this._+=\"L\"+(this._x1=+t)+\",\"+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+=\"Q\"+ +t+\",\"+ +e+\",\"+(this._x1=+r)+\",\"+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+=\"C\"+ +t+\",\"+ +e+\",\"+ +r+\",\"+ +n+\",\"+(this._x1=+i)+\",\"+(this._y1=+a)},arcTo:function(t,r,n,i,a){t=+t,r=+r,n=+n,i=+i,a=+a;var o=this._x1,s=this._y1,l=n-t,c=i-r,u=o-t,f=s-r,h=u*u+f*f;if(a<0)throw new Error(\"negative radius: \"+a);if(null===this._x1)this._+=\"M\"+(this._x1=t)+\",\"+(this._y1=r);else if(h>1e-6)if(Math.abs(f*l-c*u)>1e-6&&a){var p=n-o,d=i-s,g=l*l+c*c,m=p*p+d*d,v=Math.sqrt(g),y=Math.sqrt(h),x=a*Math.tan((e-Math.acos((g+h-m)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>1e-6&&(this._+=\"L\"+(t+b*u)+\",\"+(r+b*f)),this._+=\"A\"+a+\",\"+a+\",0,0,\"+ +(f*p>u*d)+\",\"+(this._x1=t+_*l)+\",\"+(this._y1=r+_*c)}else this._+=\"L\"+(this._x1=t)+\",\"+(this._y1=r);else;},arc:function(t,i,a,o,s,l){t=+t,i=+i,l=!!l;var c=(a=+a)*Math.cos(o),u=a*Math.sin(o),f=t+c,h=i+u,p=1^l,d=l?o-s:s-o;if(a<0)throw new Error(\"negative radius: \"+a);null===this._x1?this._+=\"M\"+f+\",\"+h:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+=\"L\"+f+\",\"+h),a&&(d<0&&(d=d%r+r),d>n?this._+=\"A\"+a+\",\"+a+\",0,1,\"+p+\",\"+(t-c)+\",\"+(i-u)+\"A\"+a+\",\"+a+\",0,1,\"+p+\",\"+(this._x1=f)+\",\"+(this._y1=h):d>1e-6&&(this._+=\"A\"+a+\",\"+a+\",0,\"+ +(d>=e)+\",\"+p+\",\"+(this._x1=t+a*Math.cos(s))+\",\"+(this._y1=i+a*Math.sin(s))))},rect:function(t,e,r,n){this._+=\"M\"+(this._x0=this._x1=+t)+\",\"+(this._y0=this._y1=+e)+\"h\"+ +r+\"v\"+ +n+\"h\"+-r+\"Z\"},toString:function(){return this._}},t.path=a,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],164:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){\"use strict\";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,f,h,p=t._root,d={data:n},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(g+v)/2))?g=a:v=a,(u=r>=(o=(m+y)/2))?m=o:y=o,i=p,!(p=p[f=u<<1|c]))return i[f]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+v)/2))?g=a:v=a,(u=r>=(o=(m+y)/2))?m=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=p,i[f]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=t[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<c&&(c=i),i>f&&(f=i),a<u&&(u=a),a>h&&(h=a));if(c>f||u>h)return this;for(this.cover(c,u).cover(f,h),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this},l.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,a=(n=Math.floor(e))+1;else{for(var o,s,l=i-r,c=this._root;r>t||t>=i||n>e||e>=a;)switch(s=(e<n)<<1|t<r,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=r+l,a=n+l;break;case 1:r=i-l,a=n+l;break;case 2:i=r+l,n=a-l;break;case 3:r=i-l,n=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var i,a,o,s,l,c,u,f=this._x0,h=this._y0,p=this._x1,d=this._y1,g=[],m=this._root;for(m&&g.push(new r(m,f,h,p,d)),null==n?n=1/0:(f=t-n,h=e-n,p=t+n,d=e+n,n*=n);c=g.pop();)if(!(!(m=c.node)||(a=c.x0)>p||(o=c.y0)>d||(s=c.x1)<f||(l=c.y1)<h))if(m.length){var v=(a+s)/2,y=(o+l)/2;g.push(new r(m[3],v,y,s,l),new r(m[2],a,y,v,l),new r(m[1],v,o,s,y),new r(m[0],a,o,v,y)),(u=(e>=y)<<1|t>=v)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-u],g[g.length-1-u]=c)}else{var x=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=x*x+b*b;if(_<n){var w=Math.sqrt(n=_);f=t-w,h=e-w,p=t+w,d=e+w,i=m.data}}return i},l.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,i,a,o,s,l,c,u,f,h,p=this._root,d=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!p)return this;if(p.length)for(;;){if((c=a>=(s=(d+m)/2))?d=s:m=s,(u=o>=(l=(g+v)/2))?g=l:v=l,e=p,!(p=p[f=u<<1|c]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this},l.root=function(){return this._root},l.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},l.visit=function(t){var e,n,i,a,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(c=e.node,i=e.x0,a=e.y0,o=e.x1,s=e.y1)&&c.length){var u=(i+o)/2,f=(a+s)/2;(n=c[3])&&l.push(new r(n,u,f,o,s)),(n=c[2])&&l.push(new r(n,i,f,u,s)),(n=c[1])&&l.push(new r(n,u,a,o,f)),(n=c[0])&&l.push(new r(n,i,a,u,f))}return this},l.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var a=e.node;if(a.length){var o,s=e.x0,l=e.y0,c=e.x1,u=e.y1,f=(s+c)/2,h=(l+u)/2;(o=a[0])&&n.push(new r(o,s,l,f,h)),(o=a[1])&&n.push(new r(o,f,l,c,h)),(o=a[2])&&n.push(new r(o,s,h,f,u)),(o=a[3])&&n.push(new r(o,f,h,c,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},l.x=function(t){return arguments.length?(this._x=t,this):this._x},l.y=function(t){return arguments.length?(this._y=t,this):this._y},t.quadtree=a,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],165:[function(t,e,r){!function(n,i){\"object\"==typeof r&&\"undefined\"!=typeof e?i(r,t(\"d3-path\")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){\"use strict\";function r(t){return function(){return t}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=Math.PI,f=u/2,h=2*u;function p(t){return t>1?0:t<-1?u:Math.acos(t)}function d(t){return t>=1?f:t<=-1?-f:Math.asin(t)}function g(t){return t.innerRadius}function m(t){return t.outerRadius}function v(t){return t.startAngle}function y(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,i,a,o,s){var l=r-t,c=n-e,u=o-i,f=s-a,h=f*l-u*c;if(!(h*h<1e-12))return[t+(h=(u*(e-a)-f*(t-i))/h)*l,e+h*c]}function _(t,e,r,n,i,a,s){var l=t-r,u=e-n,f=(s?a:-a)/c(l*l+u*u),h=f*u,p=-f*l,d=t+h,g=e+p,m=r+h,v=n+p,y=(d+m)/2,x=(g+v)/2,b=m-d,_=v-g,w=b*b+_*_,T=i-a,k=d*v-m*g,M=(_<0?-1:1)*c(o(0,T*T*w-k*k)),A=(k*_-b*M)/w,S=(-k*b-_*M)/w,E=(k*_+b*M)/w,C=(-k*b+_*M)/w,L=A-y,I=S-x,P=E-y,z=C-x;return L*L+I*I>P*P+z*z&&(A=E,S=C),{cx:A,cy:S,x01:-h,y01:-p,x11:A*(i/T-1),y11:S*(i/T-1)}}function w(t){this._context=t}function T(t){return new w(t)}function k(t){return t[0]}function M(t){return t[1]}function A(){var t=k,n=M,i=r(!0),a=null,o=T,s=null;function l(r){var l,c,u,f=r.length,h=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=f;++l)!(l<f&&i(c=r[l],l,r))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+t(c,l,r),+n(c,l,r));if(u)return s=null,u+\"\"||null}return l.x=function(e){return arguments.length?(t=\"function\"==typeof e?e:r(+e),l):t},l.y=function(t){return arguments.length?(n=\"function\"==typeof t?t:r(+t),l):n},l.defined=function(t){return arguments.length?(i=\"function\"==typeof t?t:r(!!t),l):i},l.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),l):o},l.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),l):a},l}function S(){var t=k,n=null,i=r(0),a=M,o=r(!0),s=null,l=T,c=null;function u(r){var u,f,h,p,d,g=r.length,m=!1,v=new Array(g),y=new Array(g);for(null==s&&(c=l(d=e.path())),u=0;u<=g;++u){if(!(u<g&&o(p=r[u],u,r))===m)if(m=!m)f=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),h=u-1;h>=f;--h)c.point(v[h],y[h]);c.lineEnd(),c.areaEnd()}m&&(v[u]=+t(p,u,r),y[u]=+i(p,u,r),c.point(n?+n(p,u,r):v[u],a?+a(p,u,r):y[u]))}if(d)return c=null,d+\"\"||null}function f(){return A().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t=\"function\"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t=\"function\"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:\"function\"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i=\"function\"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i=\"function\"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:\"function\"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return f().x(t).y(i)},u.lineY1=function(){return f().x(t).y(a)},u.lineX1=function(){return f().x(n).y(i)},u.defined=function(t){return arguments.length?(o=\"function\"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function E(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function C(t){return t}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var L=P(T);function I(t){this._curve=t}function P(t){function e(e){return new I(t(e))}return e._curve=t,e}function z(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(P(t)):e()._curve},t}function O(){return z(A().curve(L))}function D(){var t=S().curve(L),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return z(r())},delete t.lineX0,t.lineEndAngle=function(){return z(n())},delete t.lineX1,t.lineInnerRadius=function(){return z(i())},delete t.lineY0,t.lineOuterRadius=function(){return z(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(P(t)):e()._curve},t}function R(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}I.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var F=Array.prototype.slice;function B(t){return t.source}function N(t){return t.target}function j(t){var n=B,i=N,a=k,o=M,s=null;function l(){var r,l=F.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+\"\"||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a=\"function\"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o=\"function\"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function V(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function q(t,e,r,n,i){var a=R(e,r),o=R(e,r=(r+i)/2),s=R(n,r),l=R(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var H={draw:function(t,e){var r=Math.sqrt(e/u);t.moveTo(r,0),t.arc(0,0,r,0,h)}},G={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Y=Math.sqrt(1/3),W=2*Y,X={draw:function(t,e){var r=Math.sqrt(e/W),n=r*Y;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Z=Math.sin(u/10)/Math.sin(7*u/10),J=Math.sin(h/10)*Z,K=-Math.cos(h/10)*Z,Q={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=J*r,i=K*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=h*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},tt=Math.sqrt(3),et={draw:function(t,e){var r=-Math.sqrt(e/(3*tt));t.moveTo(0,2*r),t.lineTo(-tt*r,-r),t.lineTo(tt*r,-r),t.closePath()}},rt=-.5,nt=Math.sqrt(3)/2,it=1/Math.sqrt(12),at=3*(it/2+1),ot={draw:function(t,e){var r=Math.sqrt(e/at),n=r/2,i=r*it,a=n,o=r*it+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(rt*n-nt*i,nt*n+rt*i),t.lineTo(rt*a-nt*o,nt*a+rt*o),t.lineTo(rt*s-nt*l,nt*s+rt*l),t.lineTo(rt*n+nt*i,rt*i-nt*n),t.lineTo(rt*a+nt*o,rt*o-nt*a),t.lineTo(rt*s+nt*l,rt*l-nt*s),t.closePath()}},st=[H,G,X,$,Q,et,ot];function lt(){}function ct(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ft(t){this._context=t}function ht(t){this._context=t}function pt(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},pt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function r(t){return 1===e?new ut(t):new pt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function gt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:gt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e){this._context=t,this._k=(1-e)/6}bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new bt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function wt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function r(t){return e?new Tt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new Mt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t,e){this._context=t,this._alpha=e}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Et=function t(e){function r(t){return e?new St(t,e):new bt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Ct(t){this._context=t}function Lt(t){return t<0?-1:1}function It(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Lt(a)+Lt(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Pt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function zt(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function Ot(t){this._context=t}function Dt(t){this._context=new Rt(t)}function Rt(t){this._context=t}function Ft(t){this._context=t}function Bt(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/a[e-1],a[e]-=r,o[e]-=r*o[e-1];for(i[n-1]=o[n-1]/a[n-1],e=n-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function Nt(t,e){this._context=t,this._t=e}function jt(t,e){if((i=t.length)>1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a<i;++a)for(n=o,o=t[e[a]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function Ut(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Vt(t,e){return t[e]}function qt(t){var e=t.map(Ht);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Ht(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++r<i;)(e=+t[r][1])>a&&(a=e,n=r);return n}function Gt(t){var e=t.map(Yt);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Yt(t){for(var e,r=0,n=-1,i=t.length;++n<i;)(e=+t[n][1])&&(r+=e);return r}Ct.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:zt(this,this._t0,Pt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,zt(this,Pt(this,r=It(this,t,e)),r);break;default:zt(this,this._t0,r=It(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(Dt.prototype=Object.create(Ot.prototype)).point=function(t,e){Ot.prototype.point.call(this,e,t)},Rt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}},Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var n=Bt(t),i=Bt(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[o],e[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Nt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=g,o=m,w=r(0),T=null,k=v,M=y,A=x,S=null;function E(){var r,g,m=+t.apply(this,arguments),v=+o.apply(this,arguments),y=k.apply(this,arguments)-f,x=M.apply(this,arguments)-f,E=n(x-y),C=x>y;if(S||(S=r=e.path()),v<m&&(g=v,v=m,m=g),v>1e-12)if(E>h-1e-12)S.moveTo(v*a(y),v*l(y)),S.arc(0,0,v,y,x,!C),m>1e-12&&(S.moveTo(m*a(x),m*l(x)),S.arc(0,0,m,x,y,C));else{var L,I,P=y,z=x,O=y,D=x,R=E,F=E,B=A.apply(this,arguments)/2,N=B>1e-12&&(T?+T.apply(this,arguments):c(m*m+v*v)),j=s(n(v-m)/2,+w.apply(this,arguments)),U=j,V=j;if(N>1e-12){var q=d(N/m*l(B)),H=d(N/v*l(B));(R-=2*q)>1e-12?(O+=q*=C?1:-1,D-=q):(R=0,O=D=(y+x)/2),(F-=2*H)>1e-12?(P+=H*=C?1:-1,z-=H):(F=0,P=z=(y+x)/2)}var G=v*a(P),Y=v*l(P),W=m*a(D),X=m*l(D);if(j>1e-12){var Z,J=v*a(z),K=v*l(z),Q=m*a(O),$=m*l(O);if(E<u&&(Z=b(G,Y,Q,$,J,K,W,X))){var tt=G-Z[0],et=Y-Z[1],rt=J-Z[0],nt=K-Z[1],it=1/l(p((tt*rt+et*nt)/(c(tt*tt+et*et)*c(rt*rt+nt*nt)))/2),at=c(Z[0]*Z[0]+Z[1]*Z[1]);U=s(j,(m-at)/(it-1)),V=s(j,(v-at)/(it+1))}}F>1e-12?V>1e-12?(L=_(Q,$,G,Y,v,V,C),I=_(J,K,W,X,v,V,C),S.moveTo(L.cx+L.x01,L.cy+L.y01),V<j?S.arc(L.cx,L.cy,V,i(L.y01,L.x01),i(I.y01,I.x01),!C):(S.arc(L.cx,L.cy,V,i(L.y01,L.x01),i(L.y11,L.x11),!C),S.arc(0,0,v,i(L.cy+L.y11,L.cx+L.x11),i(I.cy+I.y11,I.cx+I.x11),!C),S.arc(I.cx,I.cy,V,i(I.y11,I.x11),i(I.y01,I.x01),!C))):(S.moveTo(G,Y),S.arc(0,0,v,P,z,!C)):S.moveTo(G,Y),m>1e-12&&R>1e-12?U>1e-12?(L=_(W,X,J,K,m,-U,C),I=_(G,Y,Q,$,m,-U,C),S.lineTo(L.cx+L.x01,L.cy+L.y01),U<j?S.arc(L.cx,L.cy,U,i(L.y01,L.x01),i(I.y01,I.x01),!C):(S.arc(L.cx,L.cy,U,i(L.y01,L.x01),i(L.y11,L.x11),!C),S.arc(0,0,m,i(L.cy+L.y11,L.cx+L.x11),i(I.cy+I.y11,I.cx+I.x11),C),S.arc(I.cx,I.cy,U,i(I.y11,I.x11),i(I.y01,I.x01),!C))):S.arc(0,0,m,D,O,C):S.lineTo(W,X)}else S.moveTo(0,0);if(S.closePath(),r)return S=null,r+\"\"||null}return E.centroid=function(){var e=(+t.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+k.apply(this,arguments)+ +M.apply(this,arguments))/2-u/2;return[a(r)*e,l(r)*e]},E.innerRadius=function(e){return arguments.length?(t=\"function\"==typeof e?e:r(+e),E):t},E.outerRadius=function(t){return arguments.length?(o=\"function\"==typeof t?t:r(+t),E):o},E.cornerRadius=function(t){return arguments.length?(w=\"function\"==typeof t?t:r(+t),E):w},E.padRadius=function(t){return arguments.length?(T=null==t?null:\"function\"==typeof t?t:r(+t),E):T},E.startAngle=function(t){return arguments.length?(k=\"function\"==typeof t?t:r(+t),E):k},E.endAngle=function(t){return arguments.length?(M=\"function\"==typeof t?t:r(+t),E):M},E.padAngle=function(t){return arguments.length?(A=\"function\"==typeof t?t:r(+t),E):A},E.context=function(t){return arguments.length?(S=null==t?null:t,E):S},E},t.area=S,t.areaRadial=D,t.curveBasis=function(t){return new ut(t)},t.curveBasisClosed=function(t){return new ft(t)},t.curveBasisOpen=function(t){return new ht(t)},t.curveBundle=dt,t.curveCardinal=vt,t.curveCardinalClosed=xt,t.curveCardinalOpen=_t,t.curveCatmullRom=kt,t.curveCatmullRomClosed=At,t.curveCatmullRomOpen=Et,t.curveLinear=T,t.curveLinearClosed=function(t){return new Ct(t)},t.curveMonotoneX=function(t){return new Ot(t)},t.curveMonotoneY=function(t){return new Dt(t)},t.curveNatural=function(t){return new Ft(t)},t.curveStep=function(t){return new Nt(t,.5)},t.curveStepAfter=function(t){return new Nt(t,1)},t.curveStepBefore=function(t){return new Nt(t,0)},t.line=A,t.lineRadial=O,t.linkHorizontal=function(){return j(U)},t.linkRadial=function(){var t=j(q);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return j(V)},t.pie=function(){var t=C,e=E,n=null,i=r(0),a=r(h),o=r(0);function s(r){var s,l,c,u,f,p=r.length,d=0,g=new Array(p),m=new Array(p),v=+i.apply(this,arguments),y=Math.min(h,Math.max(-h,a.apply(this,arguments)-v)),x=Math.min(Math.abs(y)/p,o.apply(this,arguments)),b=x*(y<0?-1:1);for(s=0;s<p;++s)(f=m[g[s]=s]=+t(r[s],s,r))>0&&(d+=f);for(null!=e?g.sort((function(t,r){return e(m[t],m[r])})):null!=n&&g.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(y-p*b)/d:0;s<p;++s,v=u)l=g[s],u=v+((f=m[l])>0?f*c:0)+b,m[l]={data:r[l],index:s,value:f,startAngle:v,endAngle:u,padAngle:x};return m}return s.value=function(e){return arguments.length?(t=\"function\"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i=\"function\"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a=\"function\"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o=\"function\"==typeof t?t:r(+t),s):o},s},t.pointRadial=R,t.radialArea=D,t.radialLine=O,t.stack=function(){var t=r([]),e=Ut,n=jt,i=Vt;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a<c;++a){for(var f,h=s[a],p=u[a]=new Array(l),d=0;d<l;++d)p[d]=f=[0,+i(r[d],h,d,r)],f.data=r[d];p.key=h}for(a=0,o=e(u);a<c;++a)u[o[a]].index=a;return n(u,o),u}return a.keys=function(e){return arguments.length?(t=\"function\"==typeof e?e:r(F.call(e)),a):t},a.value=function(t){return arguments.length?(i=\"function\"==typeof t?t:r(+t),a):i},a.order=function(t){return arguments.length?(e=null==t?Ut:\"function\"==typeof t?t:r(F.call(t)),a):e},a.offset=function(t){return arguments.length?(n=null==t?jt:t,a):n},a},t.stackOffsetDiverging=function(t,e){if((s=t.length)>0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l<c;++l)for(a=o=0,r=0;r<s;++r)(i=(n=t[e[r]][l])[1]-n[0])>0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a<o;++a){for(i=r=0;r<n;++r)i+=t[r][a][1]||0;if(i)for(r=0;r<n;++r)t[r][a][1]/=i}jt(t,e)}},t.stackOffsetNone=jt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){for(var r,n=0,i=t[e[0]],a=i.length;n<a;++n){for(var o=0,s=0;o<r;++o)s+=t[o][n][1]||0;i[n][1]+=i[n][0]=-s/2}jt(t,e)}},t.stackOffsetWiggle=function(t,e){if((i=t.length)>0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o<n;++o){for(var s=0,l=0,c=0;s<i;++s){for(var u=t[e[s]],f=u[o][1]||0,h=(f-(u[o-1][1]||0))/2,p=0;p<s;++p){var d=t[e[p]];h+=(d[o][1]||0)-(d[o-1][1]||0)}l+=f,c+=h*f}r[o-1][1]+=r[o-1][0]=a,l&&(a-=c/l)}r[o-1][1]+=r[o-1][0]=a,jt(t,e)}},t.stackOrderAppearance=qt,t.stackOrderAscending=Gt,t.stackOrderDescending=function(t){return Gt(t).reverse()},t.stackOrderInsideOut=function(t){var e,r,n=t.length,i=t.map(Yt),a=qt(t),o=0,s=0,l=[],c=[];for(e=0;e<n;++e)r=a[e],o<s?(o+=i[r],l.push(r)):(s+=i[r],c.push(r));return c.reverse().concat(l)},t.stackOrderNone=Ut,t.stackOrderReverse=function(t){return Ut(t).reverse()},t.symbol=function(){var t=r(H),n=r(64),i=null;function a(){var r;if(i||(i=r=e.path()),t.apply(this,arguments).draw(i,+n.apply(this,arguments)),r)return i=null,r+\"\"||null}return a.type=function(e){return arguments.length?(t=\"function\"==typeof e?e:r(e),a):t},a.size=function(t){return arguments.length?(n=\"function\"==typeof t?t:r(+t),a):n},a.context=function(t){return arguments.length?(i=null==t?null:t,a):i},a},t.symbolCircle=H,t.symbolCross=G,t.symbolDiamond=X,t.symbolSquare=$,t.symbolStar=Q,t.symbolTriangle=et,t.symbolWye=ot,t.symbols=st,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{\"d3-path\":163}],166:[function(t,e,r){!function(n,i){\"object\"==typeof r&&\"undefined\"!=typeof e?i(r,t(\"d3-time\")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){\"use strict\";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function a(t){var a=t.dateTime,o=t.date,l=t.time,c=t.periods,u=t.days,f=t.shortDays,h=t.months,yt=t.shortMonths,xt=p(c),bt=d(c),_t=p(u),wt=d(u),Tt=p(f),kt=d(f),Mt=p(h),At=d(h),St=p(yt),Et=d(yt),Ct={a:function(t){return f[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:D,e:D,f:j,H:R,I:F,j:B,L:N,m:U,M:V,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:mt,s:vt,S:q,u:H,U:G,V:Y,w:W,W:X,x:null,X:null,y:Z,Y:J,Z:K,\"%\":gt},Lt={a:function(t){return f[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:mt,s:vt,S:ot,u:st,U:lt,V:ct,w:ut,W:ft,x:null,X:null,y:ht,Y:pt,Z:dt,\"%\":gt},It={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Ot(t,a,e,r)},d:M,e:M,f:I,H:S,I:S,j:A,L:L,m:k,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=bt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:O,S:C,u:m,U:v,V:y,w:g,W:x,x:function(t,e,r){return Ot(t,o,e,r)},X:function(t,e,r){return Ot(t,l,e,r)},y:_,Y:b,Z:w,\"%\":P};function Pt(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l<u;)37===t.charCodeAt(l)&&(o.push(t.slice(c,l)),null!=(i=s[n=t.charAt(++l)])?n=t.charAt(++l):i=\"e\"===n?\" \":\"0\",(a=e[n])&&(n=a(r,i)),o.push(n),c=l+1);return o.push(t.slice(c,l)),o.join(\"\")}}function zt(t,a){return function(o){var s,l,c=i(1900,void 0,1);if(Ot(c,t,o+=\"\",0)!=o.length)return null;if(\"Q\"in c)return new Date(c.Q);if(\"s\"in c)return new Date(1e3*c.s+(\"L\"in c?c.L:0));if(a&&!(\"Z\"in c)&&(c.Z=0),\"p\"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m=\"q\"in c?c.q:0),\"V\"in c){if(c.V<1||c.V>53)return null;\"w\"in c||(c.w=1),\"Z\"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else(\"W\"in c||\"U\"in c)&&(\"w\"in c||(c.w=\"u\"in c?c.u%7:\"W\"in c?1:0),l=\"Z\"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d=\"W\"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return\"Z\"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Ot(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o<l;){if(n>=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=It[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ct.x=Pt(o,Ct),Ct.X=Pt(l,Ct),Ct.c=Pt(a,Ct),Lt.x=Pt(o,Lt),Lt.X=Pt(l,Lt),Lt.c=Pt(a,Lt),{format:function(t){var e=Pt(t+=\"\",Ct);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+=\"\",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Pt(t+=\"\",Lt);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+=\"\",!0);return e.toString=function(){return t},e}}}var o,s={\"-\":\"\",_:\" \",0:\"0\"},l=/^\\s*\\d+/,c=/^%/,u=/[\\\\^$*+?|[\\]().{}]/g;function f(t,e,r){var n=t<0?\"-\":\"\",i=(n?-t:t)+\"\",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function h(t){return t.replace(u,\"\\\\$&\")}function p(t){return new RegExp(\"^(?:\"+t.map(h).join(\"|\")+\")\",\"i\")}function d(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function g(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function m(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function v(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function y(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function x(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function b(t,e,r){var n=l.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function _(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||\"00\")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function P(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function D(t,e){return f(t.getDate(),e,2)}function R(t,e){return f(t.getHours(),e,2)}function F(t,e){return f(t.getHours()%12||12,e,2)}function B(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function N(t,e){return f(t.getMilliseconds(),e,3)}function j(t,e){return N(t,e)+\"000\"}function U(t,e){return f(t.getMonth()+1,e,2)}function V(t,e){return f(t.getMinutes(),e,2)}function q(t,e){return f(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Y(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?\"-\":(e*=-1,\"+\"))+f(e/60|0,\"0\",2)+f(e%60,\"0\",2)}function Q(t,e){return f(t.getUTCDate(),e,2)}function $(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+\"000\"}function it(t,e){return f(t.getUTCMonth()+1,e,2)}function at(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return f(t.getUTCFullYear()%100,e,2)}function pt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function dt(){return\"+0000\"}function gt(){return\"%\"}function mt(t){return+t}function vt(t){return Math.floor(+t/1e3)}function yt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:\"%x, %X\",date:\"%-m/%-d/%Y\",time:\"%-I:%M:%S %p\",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\"]});var xt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(\"%Y-%m-%dT%H:%M:%S.%LZ\");var bt=+new Date(\"2000-01-01T00:00:00.000Z\")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(\"%Y-%m-%dT%H:%M:%S.%LZ\");t.isoFormat=xt,t.isoParse=bt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=a,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{\"d3-time\":167}],167:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){\"use strict\";var e=new Date,r=new Date;function n(t,i,a,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e<r-t?e:r},s.offset=function(t,e){return i(t=new Date(+t),null==e?1:Math.floor(e)),t},s.range=function(e,r,n){var a,o=[];if(e=s.ceil(e),n=null==n?1:Math.floor(n),!(e<r&&n>0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a<e&&e<r);return o},s.filter=function(e){return n((function(r){if(r>=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),c=l.range,u=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=u.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),p=h.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=d(0),m=d(1),v=d(2),y=d(3),x=d(4),b=d(5),_=d(6),w=g.range,T=m.range,k=v.range,M=y.range,A=x.range,S=b.range,E=_.range,C=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),L=C.range,I=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));I.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var P=I.range,z=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),O=z.range,D=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=D.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),B=F.range;function N(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=N(0),U=N(1),V=N(2),q=N(3),H=N(4),G=N(5),Y=N(6),W=j.range,X=U.range,Z=V.range,J=q.range,K=H.range,Q=G.range,$=Y.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=p,t.timeFriday=b,t.timeFridays=S,t.timeHour=u,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=l,t.timeMinutes=c,t.timeMonday=m,t.timeMondays=T,t.timeMonth=C,t.timeMonths=L,t.timeSaturday=_,t.timeSaturdays=E,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=g,t.timeSundays=w,t.timeThursday=x,t.timeThursdays=A,t.timeTuesday=v,t.timeTuesdays=k,t.timeWednesday=y,t.timeWednesdays=M,t.timeWeek=g,t.timeWeeks=w,t.timeYear=I,t.timeYears=P,t.utcDay=F,t.utcDays=B,t.utcFriday=G,t.utcFridays=Q,t.utcHour=D,t.utcHours=R,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=z,t.utcMinutes=O,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=Y,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=W,t.utcThursday=H,t.utcThursdays=K,t.utcTuesday=V,t.utcTuesdays=Z,t.utcWednesday=q,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],168:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){\"use strict\";var e,r,n=0,i=0,a=0,o=0,s=0,l=0,c=\"object\"==typeof performance&&performance.now?performance:Date,u=\"object\"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return s||(u(h),s=c.now()+l)}function h(){s=0}function p(){this._call=this._time=this._next=null}function d(t,e,r){var n=new p;return n.restart(t,e,r),n}function g(){f(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function m(){s=(o=c.now())+l,n=i=0;try{g()}finally{n=0,function(){var t,n,i=e,a=1/0;for(;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,y(a)}(),s=0}}function v(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function y(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(m,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(v,1e3)),n=1,u(m)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,i){if(\"function\"!=typeof t)throw new TypeError(\"callback is not a function\");i=(null==i?f():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,y()},stop:function(){this._call&&(this._call=null,this._time=1/0,y())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?f():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=f,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=g,Object.defineProperty(t,\"__esModule\",{value:!0})}))},{}],169:[function(t,e,r){!function(){var t={version:\"3.5.17\"},r=[].slice,n=function(t){return r.call(t)},i=this.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=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}),i)try{i.createElement(\"DIV\").style.setProperty(\"opacity\",0,\"\")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+\"\")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+\"\")},u.setProperty=function(t,e,r){f.call(this,t,e+\"\",r)}}function h(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){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);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.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},t.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},t.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),i<n&&(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),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)d(r=+t[a])&&(n+=r);else for(;++a<i;)d(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)d(r=p(t[a]))?n+=r:--o;else for(;++a<i;)d(r=p(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.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},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)d(n=p(e[o]))&&i.push(n);else for(;++o<a;)d(n=p(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(h),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)d(r=p(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)d(r=p(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var m=g(h);function v(t){return t.length}t.bisectLeft=m.left,t.bisect=t.bisectRight=m.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,v),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.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(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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=x(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new _;if(t instanceof _)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};function w(t){return\"__proto__\"==(t+=\"\")||\"\\0\"===t[0]?\"\\0\"+t:t}function T(t){return\"\\0\"===(t+=\"\")[0]?t.slice(1):t}function k(t){return w(t)in this._}function M(t){return(t=w(t))in this._&&delete this._[t]}function A(){var t=[];for(var e in this._)t.push(T(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function E(){for(var t in this._)return!1;return!0}function C(){this._=Object.create(null)}function L(t){return t}function I(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function P(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=z.length;r<n;++r){var i=z[r]+e;if(i in t)return i}}b(_,{has:k,get:function(t){return this._[w(t)]},set:function(t,e){return this._[w(t)]=e},remove:M,keys:A,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:T(e),value:this._[e]});return t},size:S,empty:E,forEach:function(t){for(var e in this._)t.call(this,T(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,f,h=-1,p=a.length,d=i[s++],g=new _;++h<p;)(f=g.get(l=d(c=a[h])))?f.push(c):g.set(l,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,s))}):(c={},u=function(e,r){c[e]=o(t,r,s)}),g.forEach(u),c}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=i.length)return e;var n=[],o=a[r++];return e.forEach((function(e,i){n.push({key:e,values:t(i,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},b(C,{has:k,add:function(t){return this._[w(t+=\"\")]=!0,t},remove:M,values:A,size:S,empty:E,forEach:function(t){for(var e in this._)t.call(this,T(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=I(t,e,e[r]);return t};var z=[\"webkit\",\"ms\",\"moz\",\"Moz\",\"o\",\"O\"];function O(){}function D(){}function R(t){var e=[],r=new _;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function F(){t.event.preventDefault()}function B(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function N(e){for(var r=new D,n=0,i=arguments.length;++n<i;)r[arguments[n]]=R(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new D,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=R(t);return t},D.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}},t.event=null,t.requote=function(t){return t.replace(j,\"\\\\$&\")};var j=/[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,Y),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[P(t,\"matchesSelector\")];return(G=function(t,e){return r.call(t,e)})(t,e)};\"function\"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var Y=t.selection.prototype=[];function W(t){return\"function\"==typeof t?t:function(){return q(t,this)}}function X(t){return\"function\"==typeof t?t:function(){return H(t,this)}}Y.select=function(t){var e,r,n,i,a=[];t=W(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(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 V(a)},Y.selectAll=function(t){var e,r,i=[];t=X(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,c=s.length;++l<c;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return V(i)};var Z=\"http://www.w3.org/1999/xhtml\",J={svg:\"http://www.w3.org/2000/svg\",xhtml:Z,xlink:\"http://www.w3.org/1999/xlink\",xml:\"http://www.w3.org/XML/1998/namespace\",xmlns:\"http://www.w3.org/2000/xmlns/\"};function K(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:\"function\"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function Q(t){return t.trim().replace(/\\s+/g,\" \")}function $(e){return new RegExp(\"(?:^|\\\\s+)\"+t.requote(e)+\"(?:\\\\s+|$)\",\"g\")}function tt(t){return(t+\"\").trim().split(/^|\\s+/)}function et(t,e){var r=(t=tt(t).map(rt)).length;return\"function\"==typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function rt(t){var e=$(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\",Q(i+\" \"+t))):r.setAttribute(\"class\",Q(i.replace(e,\" \")))}}function nt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:\"function\"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function it(t,e){return null==e?function(){delete this[t]}:\"function\"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function at(e){return\"function\"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Z&&t.documentElement.namespaceURI===Z?t.createElement(e):t.createElementNS(r,e)}}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function st(t){return{__data__:t}}function lt(t){return function(){return G(this,t)}}function ct(t){return arguments.length||(t=h),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function ut(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function ft(t){return U(t,ht),t}t.ns={prefix:J,qualify:function(t){var e=t.indexOf(\":\"),r=t;return e>=0&&\"xmlns\"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if(\"string\"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},Y.classed=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node(),n=(t=tt(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(!$(t[i]).test(e))return!1;return!0}for(e in t)this.each(et(e,t[e]));return this}return this.each(et(t,e))},Y.style=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=\"\"),t)this.each(nt(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=\"\"}return this.each(nt(t,e,r))},Y.property=function(t,e){if(arguments.length<2){if(\"string\"==typeof t)return this.node()[t];for(e in t)this.each(it(e,t[e]));return this}return this.each(it(t,e))},Y.text=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?\"\":e}:null==t?function(){this.textContent=\"\"}:function(){this.textContent=t}):this.node().textContent},Y.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},Y.append=function(t){return t=at(t),this.select((function(){return this.appendChild(t.apply(this,arguments))}))},Y.insert=function(t,e){return t=at(t),e=W(e),this.select((function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}))},Y.remove=function(){return this.each(ot)},Y.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,u=r.length,f=Math.min(o,u),h=new Array(u),p=new Array(u),d=new Array(o);if(e){var g,m=new _,v=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(m.has(g=e.call(i,i.__data__,n))?d[n]=i:m.set(g,i),v[n]=g);for(n=-1;++n<u;)(i=m.get(g=e.call(r,a=r[n],n)))?!0!==i&&(h[n]=i,i.__data__=a):p[n]=st(a),m.set(g,!0);for(n=-1;++n<o;)n in v&&!0!==m.get(v[n])&&(d[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,h[n]=i):p[n]=st(a);for(;n<u;++n)p[n]=st(r[n]);for(;n<o;++n)d[n]=t[n]}p.update=h,p.parentNode=h.parentNode=d.parentNode=t.parentNode,s.push(p),l.push(h),c.push(d)}var s=ft([]),l=V([]),c=V([]);if(\"function\"==typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return c},l},Y.datum=function(t){return arguments.length?this.property(\"__data__\",t):this.property(\"__data__\")},Y.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=lt(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return V(i)},Y.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},Y.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Y.each=function(t){return ut(this,(function(e,r,n){t.call(e,e.__data__,r,n)}))},Y.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},Y.empty=function(){return!this.node()},Y.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},Y.size=function(){var t=0;return ut(this,(function(){++t})),t};var ht=[];function pt(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 dt(e,r,i){var a=\"__on\"+e,o=e.indexOf(\".\"),s=mt;o>0&&(e=e.slice(0,o));var l=gt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?O:function(){var r,n=new RegExp(\"^__on([^.]+)\"+t.requote(e)+\"$\");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=Y.append,ht.empty=Y.empty,ht.node=Y.node,ht.call=Y.call,ht.size=Y.size,ht.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 c=-1,u=i.length;++c<u;)(a=i[c])?(e.push(n[c]=r=t.call(i.parentNode,a.__data__,c,s)),r.__data__=a.__data__):e.push(null)}return V(o)},ht.insert=function(t,e){return arguments.length<2&&(e=pt(this)),Y.insert.call(this,t,e)},t.select=function(t){var e;return\"string\"==typeof t?(e=[q(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),V([e])},t.selectAll=function(t){var e;return\"string\"==typeof t?(e=n(H(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,V([e])},Y.on=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=!1),t)this.each(dt(r,t[r],e));return this}if(n<2)return(n=this.node()[\"__on\"+t])&&n._;r=!1}return this.each(dt(t,e,r))};var gt=t.map({mouseenter:\"mouseover\",mouseleave:\"mouseout\"});function mt(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function vt(t,e){var r=mt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}i&&gt.forEach((function(t){\"on\"+t in i&&gt.remove(t)}));var yt,xt=0;function bt(e){var r=\".dragsuppress-\"+ ++xt,n=\"click\"+r,i=t.select(o(e)).on(\"touchmove\"+r,F).on(\"dragstart\"+r,F).on(\"selectstart\"+r,F);if(null==yt&&(yt=!(\"onselectstart\"in e)&&P(e.style,\"userSelect\")),yt){var s=a(e).style,l=s[yt];s[yt]=\"none\"}return function(t){if(i.on(r,null),yt&&(s[yt]=l),t){var e=function(){i.on(n,null)};i.on(n,(function(){F(),e()}),!0),setTimeout(e,0)}}}t.mouse=function(t){return wt(t,B())};var _t=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function wt(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(_t<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select(\"body\").append(\"svg\").style({position:\"absolute\",top:0,left:0,margin:0,padding:0,border:\"none\"},\"important\"))[0][0].getScreenCTM();_t=!(s.f||s.e),n.remove()}}return _t?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function Tt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=B().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return wt(t,n)},t.behavior.drag=function(){var e=N(a,\"drag\",\"dragstart\",\"dragend\"),r=null,n=s(O,t.mouse,o,\"mousemove\",\"mouseup\"),i=s(Tt,t.touch,L,\"touchmove\",\"touchend\");function a(){this.on(\"mousedown.drag\",n).on(\"touchstart.drag\",i)}function s(n,i,a,o,s){return function(){var l,c=this,u=t.event.target.correspondingElement||t.event.target,f=c.parentNode,h=e.of(c,arguments),p=0,d=n(),g=\".drag\"+(null==d?\"\":\"-\"+d),m=t.select(a(u)).on(o+g,x).on(s+g,b),v=bt(u),y=i(f,d);function x(){var t,e,r=i(f,d);r&&(t=r[0]-y[0],e=r[1]-y[1],p|=t|e,y=r,h({type:\"drag\",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))}function b(){i(f,d)&&(m.on(o+g,null).on(s+g,null),v(p),h({type:\"dragend\"}))}l=r?[(l=r.apply(c,arguments)).x-y[0],l.y-y[1]]:[0,0],h({type:\"dragstart\"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,\"on\")},t.touches=function(t,e){return arguments.length<2&&(e=B().touches),e?n(e).map((function(e){var r=wt(t,e);return r.identifier=e.identifier,r})):[]};var kt=1e-6,Mt=1e-12,At=Math.PI,St=2*At,Et=St-kt,Ct=At/2,Lt=At/180,It=180/At;function Pt(t){return t>0?1:t<0?-1:0}function zt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Ot(t){return t>1?0:t<-1?At:Math.acos(t)}function Dt(t){return t>1?Ct:t<-1?-Ct:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}function Ft(t){return(t=Math.sin(t/2))*t}var Bt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<Mt)n=Math.log(c/o)/Bt,r=function(t){return[i+t*u,a+t*f,o*Math.exp(Bt*t*n)]};else{var p=Math.sqrt(h),d=(c*c-o*o+4*h)/(2*o*2*p),g=(c*c-o*o-4*h)/(2*c*2*p),m=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(g*g+1)-g);n=(v-m)/Bt,r=function(t){var e,r=t*n,s=Rt(m),l=o/(2*p)*(s*(e=Bt*r+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[i+l*u,a+l*f,o*s/Rt(Bt*r+m)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,f,h={x:0,y:0,k:1},p=[960,500],d=Ut,g=250,m=0,v=\"mousedown.zoom\",y=\"mousemove.zoom\",x=\"mouseup.zoom\",b=\"touchstart.zoom\",_=N(w,\"zoomstart\",\"zoom\",\"zoomend\");function w(t){t.on(v,I).on(jt+\".zoom\",z).on(\"dblclick.zoom\",O).on(b,P)}function T(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(d[0],Math.min(d[1],t))}function M(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function A(e,n,i,a){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,a)),M(r=n,i),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),f&&f.domain(u.range().map((function(t){return(t-h.y)/h.k})).map(u.invert))}function E(t){m++||t({type:\"zoomstart\"})}function C(t){S(),t({type:\"zoom\",scale:h.k,translate:[h.x,h.y]})}function L(t){--m||(t({type:\"zoomend\"}),r=null)}function I(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,l).on(x,c),a=T(t.mouse(e)),s=bt(e);function l(){n=1,M(t.mouse(e),a),C(r)}function c(){i.on(y,null).on(x,null),s(n),L(r)}vs.call(e),E(r)}function P(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=\".zoom-\"+t.event.changedTouches[0].identifier,l=\"touchmove\"+o,c=\"touchend\"+o,u=[],f=t.select(r),p=bt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=T(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,m).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o<f;++o)i[n[o].identifier]=null;var p=d(),g=Date.now();if(1===p.length){if(g-s<500){var v=p[0];A(r,v,i[v.identifier],Math.floor(Math.log(h.k)/Math.LN2)+1),F()}s=g}else if(p.length>1){v=p[0];var x=p[1],b=v[0]-x[0],_=v[1]-x[1];a=b*b+_*_}}function m(){var o,l,c,u,f=t.touches(r);vs.call(r);for(var h=0,p=f.length;h<p;++h,u=null)if(c=f[h],u=i[c.identifier]){if(l)break;o=c,l=u}if(u){var d=(d=c[0]-o[0])*d+(d=c[1]-o[1])*d,g=a&&Math.sqrt(d/a);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],k(g*e)}s=null,M(o,l),C(n)}function y(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void d()}t.selectAll(u).on(o,null),f.on(v,I).on(b,P),p(),L(n)}g(),E(n),f.on(v,null).on(b,g)}function z(){var i=_.of(this,arguments);a?clearTimeout(a):(vs.call(this),e=T(r=n||t.mouse(this)),E(i)),a=setTimeout((function(){a=null,L(i)}),50),F(),k(Math.pow(2,.002*Nt())*h.k),M(r,e),C(i)}function O(){var e=t.mouse(this),r=Math.log(h.k)/Math.LN2;A(this,e,T(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return jt||(jt=\"onwheel\"in i?(Nt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},\"wheel\"):\"onmousewheel\"in i?(Nt=function(){return t.event.wheelDelta},\"mousewheel\"):(Nt=function(){return-t.event.detail},\"MozMousePixelScroll\")),w.event=function(e){e.each((function(){var e=_.of(this,arguments),n=h;bs?t.select(this).transition().each(\"start.zoom\",(function(){h=this.__chart__||{x:0,y:0,k:1},E(e)})).tween(\"zoom:zoom\",(function(){var i=p[0],a=p[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-h.x)/h.k,(s-h.y)/h.k,i/h.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=h={x:o-r[0]*n,y:s-r[1]*n,k:n},C(e)}})).each(\"interrupt.zoom\",(function(){L(e)})).each(\"end.zoom\",(function(){L(e)})):(this.__chart__=h,E(e),C(e),L(e))}))},w.translate=function(t){return arguments.length?(h={x:+t[0],y:+t[1],k:h.k},S(),w):[h.x,h.y]},w.scale=function(t){return arguments.length?(h={x:h.x,y:h.y,k:null},k(+t),S(),w):h.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?Ut:[+t[0],+t[1]],w):d},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(g=+t,w):g},w.x=function(t){return arguments.length?(c=t,l=t.copy(),h={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(f=t,u=t.copy(),h={x:0,y:0,k:1},w):f},t.rebind(w,_,\"on\")};var Nt,jt,Ut=[0,1/0];function Vt(){}function qt(t,e,r){return this instanceof qt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof qt?new qt(t.h,t.s,t.l):le(\"\"+t,ce,qt):new qt(t,e,r)}t.color=Vt,Vt.prototype.toString=function(){return this.rgb()+\"\"},t.hsl=qt;var Ht=qt.prototype=new Vt;function Gt(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ne(a(t+120),a(t),a(t-120))}function Yt(e,r,n){return this instanceof Yt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Yt?new Yt(e.h,e.c,e.l):$t(e instanceof Zt?e.l:(e=ue((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Yt(e,r,n)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,t*this.l)},Ht.rgb=function(){return Gt(this.h,this.s,this.l)},t.hcl=Yt;var Wt=Yt.prototype=new Vt;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Zt(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Zt(t,e,r){return this instanceof Zt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Zt?new Zt(t.l,t.a,t.b):t instanceof Yt?Xt(t.h,t.c,t.l):ue((t=ne(t)).r,t.g,t.b):new Zt(t,e,r)}Wt.brighter=function(t){return new Yt(this.h,this.c,Math.min(100,this.l+Jt*(arguments.length?t:1)))},Wt.darker=function(t){return new Yt(this.h,this.c,Math.max(0,this.l-Jt*(arguments.length?t:1)))},Wt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Zt;var Jt=18,Kt=Zt.prototype=new Vt;function Qt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ne(re(3.2404542*(i=.95047*te(i))-1.5371385*(n=1*te(n))-.4985314*(a=1.08883*te(a))),re(-.969266*i+1.8760108*n+.041556*a),re(.0556434*i-.2040259*n+1.0572252*a))}function $t(t,e,r){return t>0?new Yt(Math.atan2(r,e)*It,Math.sqrt(e*e+r*r),t):new Yt(NaN,NaN,t)}function te(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ee(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function re(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ne(t,e,r){return this instanceof ne?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ne?new ne(t.r,t.g,t.b):le(\"\"+t,ne,Gt):new ne(t,e,r)}function ie(t){return new ne(t>>16,t>>8&255,255&t)}function ae(t){return ie(t)+\"\"}Kt.brighter=function(t){return new Zt(Math.min(100,this.l+Jt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Zt(Math.max(0,this.l-Jt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return Qt(this.l,this.a,this.b)},t.rgb=ne;var oe=ne.prototype=new Vt;function se(t){return t<16?\"0\"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function le(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\\((.*)\\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(\",\"),n[1]){case\"hsl\":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case\"rgb\":return e(he(i[0]),he(i[1]),he(i[2]))}return(a=pe.get(t))?e(a.r,a.g,a.b):(null==t||\"#\"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function ce(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new qt(n,i,l)}function ue(t,e,r){var n=ee((.4124564*(t=fe(t))+.3575761*(e=fe(e))+.1804375*(r=fe(r)))/.95047),i=ee((.2126729*t+.7151522*e+.072175*r)/1);return Zt(116*i-16,500*(n-i),200*(i-ee((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return\"%\"===t.charAt(t.length-1)?Math.round(2.55*e):e}oe.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&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new ne(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ne(i,i,i)},oe.darker=function(t){return new ne((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},oe.hsl=function(){return ce(this.r,this.g,this.b)},oe.toString=function(){return\"#\"+se(this.r)+se(this.g)+se(this.b)};var pe=t.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});function de(t){return\"function\"==typeof t?t:function(){return t}}function ge(t){return function(e,r,n){return 2===arguments.length&&\"function\"==typeof r&&(n=r,r=null),me(e,r,t,n)}}function me(e,r,i,a){var o={},s=t.dispatch(\"beforesend\",\"progress\",\"load\",\"error\"),l={},c=new XMLHttpRequest,u=null;function f(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&\"text\"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return this.XDomainRequest&&!(\"withCredentials\"in c)&&/^(http(s)?:)?\\/\\//.test(e)&&(c=new XDomainRequest),\"onload\"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+\"\").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+\"\",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+\"\",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},[\"get\",\"post\"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&\"function\"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||\"accept\"in l||(l.accept=r+\",*/*\"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on(\"error\",i).on(\"load\",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,\"on\"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}pe.forEach((function(t,e){pe.set(t,ie(e))})),t.functor=de,t.xhr=ge(L),t.dsv=function(t,e){var r=new RegExp('[\"'+t+\"\\n]\"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=me(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'\"'+t.replace(/\\\"/g,'\"\"')+'\"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=new Function(\"d\",\"return {\"+t.map((function(t,e){return JSON.stringify(t)+\": d[\"+e+\"]\"})).join(\",\")+\"}\");r=e?function(t,r){return e(i(t),r)}:i}))},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,c=0,u=0;function f(){if(c>=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++c):10===s&&(i=!0),t.slice(e+1,r).replace(/\"\"/g,'\"')}for(;c<l;){var s,u=1;if(10===(s=t.charCodeAt(c++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=f())!==o;){for(var h=[];r!==a&&r!==o;)h.push(r),r=f();e&&null==(h=e(h,u++))||s.push(h)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new C,n=[];return e.forEach((function(t){for(var e in t)r.has(e)||n.push(r.add(e))})),[n.map(l).join(t)].concat(e.map((function(e){return n.map((function(t){return l(e[t])})).join(t)}))).join(\"\\n\")},i.formatRows=function(t){return t.map(s).join(\"\\n\")},i},t.csv=t.dsv(\",\",\"text/csv\"),t.tsv=t.dsv(\"\\t\",\"text/tab-separated-values\");var ve,ye,xe,be,_e=this[P(this,\"requestAnimationFrame\")]||function(t){setTimeout(t,17)};function we(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return ye?ye.n=a:ve=a,ye=a,xe||(be=clearTimeout(be),xe=1,_e(Te)),a}function Te(){var t=ke(),e=Me()-t;e>24?(isFinite(e)&&(clearTimeout(be),be=setTimeout(Te,e)),xe=0):(xe=1,_e(Te))}function ke(){for(var t=Date.now(),e=ve;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Me(){for(var t,e=ve,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:ve=e.n;return ye=t,r}function Ae(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){we.apply(this,arguments)},t.timer.flush=function(){ke(),Me()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Se=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\\xb5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"].map((function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}));function Ee(e){var r=e.decimal,n=e.thousands,i=e.grouping,a=e.currency,o=i&&n?function(t,e){for(var r=t.length,a=[],o=0,s=i[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:L;return function(e){var n=Ce.exec(e),i=n[1]||\" \",s=n[2]||\">\",l=n[3]||\"-\",c=n[4]||\"\",u=n[5],f=+n[6],h=n[7],p=n[8],d=n[9],g=1,m=\"\",v=\"\",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||\"0\"===i&&\"=\"===s)&&(u=i=\"0\",s=\"=\"),d){case\"n\":h=!0,d=\"g\";break;case\"%\":g=100,v=\"%\",d=\"f\";break;case\"p\":g=100,v=\"%\",d=\"r\";break;case\"b\":case\"o\":case\"x\":case\"X\":\"#\"===c&&(m=\"0\"+d.toLowerCase());case\"c\":x=!1;case\"d\":y=!0,p=0;break;case\"s\":g=-1,d=\"r\"}\"$\"===c&&(m=a[0],v=a[1]),\"r\"!=d||p||(d=\"g\"),null!=p&&(\"g\"==d?p=Math.max(1,Math.min(21,p)):\"e\"!=d&&\"f\"!=d||(p=Math.max(0,Math.min(20,p)))),d=Le.get(d)||Ie;var b=u&&h;return function(e){var n=v;if(y&&e%1)return\"\";var a=e<0||0===e&&1/e<0?(e=-e,\"-\"):\"-\"===l?\"\":l;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+v}else e*=g;var _,w,T=(e=d(e,p)).lastIndexOf(\".\");if(T<0){var k=x?e.lastIndexOf(\"e\"):-1;k<0?(_=e,w=\"\"):(_=e.substring(0,k),w=e.substring(k))}else _=e.substring(0,T),w=r+e.substring(T+1);!u&&h&&(_=o(_,1/0));var M=m.length+_.length+w.length+(b?0:a.length),A=M<f?new Array(M=f-M+1).join(i):\"\";return b&&(_=o(A+_,A.length?f-w.length:1/0)),a+=m,e=_+w,(\"<\"===s?a+e+A:\">\"===s?A+a+e:\"^\"===s?A.substring(0,M>>=1)+a+e+A.substring(M):a+(b?e:A+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Ae(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Se[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\\- ])?([$#])?(0)?(\\d+)?(,)?(\\.-?\\d+)?([a-z%])?/i,Le=t.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(e,r){return(e=t.round(e,Ae(e,r))).toFixed(Math.max(0,Math.min(20,Ae(e*(1+1e-15),r))))}});function Ie(t){return t+\"\"}var Pe=t.time={},ze=Date;function Oe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Oe.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(){De.setUTCDate.apply(this._,arguments)},setDay:function(){De.setUTCDay.apply(this._,arguments)},setFullYear:function(){De.setUTCFullYear.apply(this._,arguments)},setHours:function(){De.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){De.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){De.setUTCMinutes.apply(this._,arguments)},setMonth:function(){De.setUTCMonth.apply(this._,arguments)},setSeconds:function(){De.setUTCSeconds.apply(this._,arguments)},setTime:function(){De.setTime.apply(this._,arguments)}};var De=Date.prototype;function Re(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r=t(new ze(r-1)),1),r}function a(t,r){return e(t=new ze(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var s=t.utc=Fe(t);return s.floor=s,s.round=Fe(n),s.ceil=Fe(i),s.offset=Fe(a),s.range=function(t,e,r){try{ze=Oe;var n=new Oe;return n._=t,o(n,e,r)}finally{ze=Date}},t}function Fe(t){return function(e,r){try{ze=Oe;var n=new Oe;return n._=e,t(n,r)._}finally{ze=Date}}}function Be(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths;function u(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=Ne[n=t.charAt(++s)])&&(n=t.charAt(++s)),(a=_[n])&&(n=a(r,null==i?\"e\"===n?\" \":\"0\":i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join(\"\")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,t,e,0)!=e.length)return null;\"p\"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&ze!==Oe,i=new(n?Oe:ze);return\"j\"in r?i.setFullYear(r.y,0,r.j):\"W\"in r||\"U\"in r?(\"w\"in r||(r.w=\"W\"in r?1:0),i.setFullYear(r.y,0,1),i.setFullYear(r.y,0,\"W\"in r?(r.w+6)%7+7*r.W-(i.getDay()+5)%7:r.w+7*r.U-(i.getDay()+6)%7)):i.setFullYear(r.y,r.m,r.d),i.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?i._:i},r.toString=function(){return t},r}function f(t,e,r,n){for(var i,a,o,s=0,l=e.length,c=r.length;s<l;){if(n>=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in Ne?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(ze=Oe);return r._=t,e(r)}finally{ze=Date}}return r.parse=function(t){try{ze=Oe;var r=e.parse(t);return r&&r._}finally{ze=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=or;var h=t.map(),p=qe(o),d=He(o),g=qe(s),m=He(s),v=qe(l),y=He(l),x=qe(c),b=He(c);a.forEach((function(t,e){h.set(t.toLowerCase(),e)}));var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:u(r),d:function(t,e){return Ve(t.getDate(),e,2)},e:function(t,e){return Ve(t.getDate(),e,2)},H:function(t,e){return Ve(t.getHours(),e,2)},I:function(t,e){return Ve(t.getHours()%12||12,e,2)},j:function(t,e){return Ve(1+Pe.dayOfYear(t),e,3)},L:function(t,e){return Ve(t.getMilliseconds(),e,3)},m:function(t,e){return Ve(t.getMonth()+1,e,2)},M:function(t,e){return Ve(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ve(t.getSeconds(),e,2)},U:function(t,e){return Ve(Pe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ve(Pe.mondayOfYear(t),e,2)},x:u(n),X:u(i),y:function(t,e){return Ve(t.getFullYear()%100,e,2)},Y:function(t,e){return Ve(t.getFullYear()%1e4,e,4)},Z:ir,\"%\":function(){return\"%\"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){v.lastIndex=0;var n=v.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Qe,e:Qe,H:tr,I:tr,j:$e,L:nr,m:Ke,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ye,w:Ge,W:We,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Xe,Z:Je,\"%\":ar};return u}Pe.year=Re((function(t){return(t=Pe.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),Pe.years=Pe.year.range,Pe.years.utc=Pe.year.utc.range,Pe.day=Re((function(t){var e=new ze(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})),Pe.days=Pe.day.range,Pe.days.utc=Pe.day.utc.range,Pe.dayOfYear=function(t){var e=Pe.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=Pe[t]=Re((function(t){return(t=Pe.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=Pe.year(t).getDay();return Math.floor((Pe.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));Pe[t+\"s\"]=r.range,Pe[t+\"s\"].utc=r.utc.range,Pe[t+\"OfYear\"]=function(t){var r=Pe.year(t).getDay();return Math.floor((Pe.dayOfYear(t)+(r+e)%7)/7)}})),Pe.week=Pe.sunday,Pe.weeks=Pe.sunday.range,Pe.weeks.utc=Pe.sunday.utc.range,Pe.weekOfYear=Pe.sundayOfYear;var Ne={\"-\":\"\",_:\" \",0:\"0\"},je=/^\\s*\\d+/,Ue=/^%/;function Ve(t,e,r){var n=t<0?\"-\":\"\",i=(n?-t:t)+\"\",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function qe(e){return new RegExp(\"^(?:\"+e.map(t.requote).join(\"|\")+\")\",\"i\")}function He(t){for(var e=new _,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ge(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ye(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function We(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Xe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ze(t,e,r){je.lastIndex=0;var n,i=je.exec(e.slice(r,r+2));return i?(t.y=(n=+i[0])+(n>68?1900:2e3),r+i[0].length):-1}function Je(t,e,r){return/^[+-]\\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ke(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Qe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function $e(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?\"-\":\"+\",n=y(e)/60|0,i=y(e)%60;return r+Ve(n,\"0\",2)+Ve(i,\"0\",2)}function ar(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(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)}}t.locale=function(t){return{numberFormat:Ee(t),timeFormat:Be(t)}};var sr=t.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\"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){ur(t,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new lr;function ur(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&pr.hasOwnProperty(t.type)&&pr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):fr(t,e)};var hr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)fr(r[n].geometry,e)}},pr={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){dr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)dr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)fr(r[n],e)}};function dr(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 gr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)dr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return mr=0,t.geo.stream(e,Cr),mr};var mr,vr,yr,xr,br,_r,wr,Tr,kr,Mr,Ar,Sr,Er=new lr,Cr={sphere:function(){mr+=4*At},point:O,lineStart:O,lineEnd:O,polygonStart:function(){Er.reset(),Cr.lineStart=Lr},polygonEnd:function(){var t=2*Er;mr+=t<0?4*At+t:t,Cr.lineStart=Cr.lineEnd=Cr.point=O}};function Lr(){var t,e,r,n,i;function a(t,e){e=e*Lt/2+At/4;var a=(t*=Lt)-r,o=a>=0?1:-1,s=o*a,l=Math.cos(e),c=Math.sin(e),u=i*c,f=n*l+u*Math.cos(s),h=u*o*Math.sin(s);Er.add(Math.atan2(h,f)),r=t,n=l,i=c}Cr.point=function(o,s){Cr.point=a,r=(t=o)*Lt,n=Math.cos(s=(e=s)*Lt/2+At/4),i=Math.sin(s)},Cr.lineEnd=function(){a(t,e)}}function Ir(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 Pr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function zr(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 Or(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Dr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(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 Fr(t){return[Math.atan2(t[1],t[0]),Dt(t[2])]}function Br(t,e){return y(t[0]-e[0])<kt&&y(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,i,a,o,s,l,c,u,f,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=x,h.lineEnd=b,c=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),h.point=p,h.lineStart=g,h.lineEnd=m,Er<0?(e=-(n=180),r=-(i=90)):c>kt?i=90:c<-kt&&(r=-90),f[0]=e,f[1]=n}};function p(t,a){u.push(f=[e=t,n=t]),a<r&&(r=a),a>i&&(i=a)}function d(t,o){var s=Ir([t*Lt,o*Lt]);if(l){var c=zr(l,s),u=zr([c[1],-c[0],0],c);Rr(u),u=Fr(u);var f=t-a,h=f>0?1:-1,d=u[0]*It*h,g=y(f)>180;if(g^(h*a<d&&d<h*t))(m=u[1]*It)>i&&(i=m);else if(g^(h*a<(d=(d+360)%360-180)&&d<h*t)){var m;(m=-u[1]*It)<r&&(r=m)}else o<r&&(r=o),o>i&&(i=o);g?t<a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);l=s,a=t}function g(){h.point=d}function m(){f[0]=e,f[1]=n,h.point=p,l=null}function v(t,e){if(l){var r=t-a;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Cr.point(t,e),d(t,e)}function x(){Cr.lineStart()}function b(){v(o,s),Cr.lineEnd(),y(c)>kt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function T(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(a){if(i=n=-(e=r=1/0),u=[],t.geo.stream(a,h),c=u.length){u.sort(w);for(var o=1,s=[g=u[0]];o<c;++o)T((p=u[o])[0],g)||T(p[1],g)?(_(g[0],p[1])>_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):s.push(g=p);for(var l,c,p,d=-1/0,g=(o=0,s[c=s.length-1]);o<=c;g=p,++o)p=s[o],(l=_(g[1],p[0]))>d&&(d=l,e=p[0],n=g[1])}return u=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){vr=yr=xr=br=_r=wr=Tr=kr=Mr=Ar=Sr=0,t.geo.stream(e,Nr);var r=Mr,n=Ar,i=Sr,a=r*r+n*n+i*i;return a<Mt&&(r=wr,n=Tr,i=kr,yr<kt&&(r=xr,n=br,i=_r),(a=r*r+n*n+i*i)<Mt)?[NaN,NaN]:[Math.atan2(n,r)*It,Dt(i/Math.sqrt(a))*It]};var Nr={sphere:O,point:jr,lineStart:Vr,lineEnd:qr,polygonStart:function(){Nr.lineStart=Hr},polygonEnd:function(){Nr.lineStart=Vr}};function jr(t,e){t*=Lt;var r=Math.cos(e*=Lt);Ur(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Ur(t,e,r){++vr,xr+=(t-xr)/vr,br+=(e-br)/vr,_r+=(r-_r)/vr}function Vr(){var t,e,r;function n(n,i){n*=Lt;var a=Math.cos(i*=Lt),o=a*Math.cos(n),s=a*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*s)*c+(c=r*o-t*l)*c+(c=t*s-e*o)*c),t*o+e*s+r*l);yr+=c,wr+=c*(t+(t=o)),Tr+=c*(e+(e=s)),kr+=c*(r+(r=l)),Ur(t,e,r)}Nr.point=function(i,a){i*=Lt;var o=Math.cos(a*=Lt);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(a),Nr.point=n,Ur(t,e,r)}}function qr(){Nr.point=jr}function Hr(){var t,e,r,n,i;function a(t,e){t*=Lt;var a=Math.cos(e*=Lt),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(e),c=n*l-i*s,u=i*o-r*l,f=r*s-n*o,h=Math.sqrt(c*c+u*u+f*f),p=r*o+n*s+i*l,d=h&&-Ot(p)/h,g=Math.atan2(h,p);Mr+=d*c,Ar+=d*u,Sr+=d*f,yr+=g,wr+=g*(r+(r=o)),Tr+=g*(n+(n=s)),kr+=g*(i+(i=l)),Ur(r,n,i)}Nr.point=function(o,s){t=o,e=s,Nr.point=a,o*=Lt;var l=Math.cos(s*=Lt);r=l*Math.cos(o),n=l*Math.sin(o),i=Math.sin(s),Ur(r,n,i)},Nr.lineEnd=function(){a(t,e),Nr.lineEnd=qr,Nr.point=jr}}function Gr(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))&&t.invert(r[0],r[1])}),r}function Yr(){return!0}function Wr(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(Br(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);i.lineEnd()}else{var l=new Zr(r,t,null,!0),c=new Zr(r,null,l,!1);l.o=c,a.push(l),o.push(c),l=new Zr(n,t,null,!1),c=new Zr(n,null,l,!0),l.o=c,a.push(l),o.push(c)}}})),o.sort(e),Xr(a),Xr(o),a.length){for(var s=0,l=r,c=o.length;s<c;++s)o[s].e=l=!l;for(var u,f,h=a[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;u=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(s=0,c=u.length;s<c;++s)i.point((f=u[s])[0],f[1]);else n(p.x,p.n.x,1,i);p=p.n}else{if(d)for(s=(u=p.p.z).length-1;s>=0;--s)i.point((f=u[s])[0],f[1]);else n(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function Xr(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 Zr(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 Jr(e,r,n,i){return function(a,o){var s,l=r(o),c=a.invert(i[0],i[1]),u={point:f,lineStart:p,lineEnd:d,polygonStart:function(){u.point=b,u.lineStart=_,u.lineEnd=w,s=[],g=[]},polygonEnd:function(){u.point=f,u.lineStart=p,u.lineEnd=d,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Er.reset();for(var s=0,l=e.length;s<l;++s){var c=e[s],u=c.length;if(u)for(var f=c[0],h=f[0],p=f[1]/2+At/4,d=Math.sin(p),g=Math.cos(p),m=1;;){m===u&&(m=0);var v=(t=c[m])[0],y=t[1]/2+At/4,x=Math.sin(y),b=Math.cos(y),_=v-h,w=_>=0?1:-1,T=w*_,k=T>At,M=d*x;if(Er.add(Math.atan2(M*w*Math.sin(T),g*b+M*Math.cos(T))),a+=k?_+w*St:_,k^h>=r^v>=r){var A=zr(Ir(f),Ir(t));Rr(A);var S=zr(i,A);Rr(S);var E=(k^_>=0?-1:1)*Dt(S[2]);(n>E||n===E&&(A[0]||A[1]))&&(o+=k^_>=0?1:-1)}if(!m++)break;h=v,d=x,g=b,f=t}}return(a<-kt||a<kt&&Er<-kt)^1&o}(c,g);s.length?(x||(o.polygonStart(),x=!0),Wr(s,$r,e,n,o)):e&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),s=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(t,r){var n=a(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function h(t,e){var r=a(t,e);l.point(r[0],r[1])}function p(){u.point=h,l.lineStart()}function d(){u.point=f,l.lineEnd()}var g,m,v=Qr(),y=r(v),x=!1;function b(t,e){m.push([t,e]);var r=a(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),m=[]}function w(){b(m[0][0],m[0][1]),y.lineEnd();var t,e=y.clean(),r=v.buffer(),n=r.length;if(m.pop(),g.push(m),m=null,n)if(1&e){var i,a=-1;if((n=(t=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++a<n;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Kr))}return u}}function Kr(t){return t.length>1}function Qr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:O,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function $r(t,e){return((t=t.x)[0]<0?t[1]-Ct-kt:Ct-t[1])-((e=e.x)[0]<0?e[1]-Ct-kt:Ct-e[1])}var tn=Jr(Yr,(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?At:-At,l=y(a-r);y(l-At)<kt?(t.point(r,n=(n+o)/2>0?Ct:-Ct),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=At&&(y(r-i)<kt&&(r-=i*kt),y(a-s)<kt&&(a-=s*kt),n=function(t,e,r,n){var i,a,o=Math.sin(t-r);return y(o)>kt?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}(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(t,e,r,n){var i;if(null==t)i=r*Ct,n.point(-At,i),n.point(0,i),n.point(At,i),n.point(At,0),n.point(At,-i),n.point(0,-i),n.point(-At,-i),n.point(-At,0),n.point(-At,i);else if(y(t[0]-e[0])>kt){var a=t[0]<e[0]?At:-At;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}),[-At,-At/2]);function en(t){var e=Math.cos(t),r=e>0,n=y(e)>kt;return Jr(i,(function(t){var e,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var p,d=[f,h],g=i(f,h),m=r?g?0:o(f,h):g?o(f+(f<0?At:-At),h):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(p=a(e,d),(Br(e,p)||Br(d,p))&&(d[0]+=kt,d[1]+=kt,g=i(d[0],d[1]))),g!==l)u=0,g?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var v;m&s||!(v=a(d,e,!0))||(u=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&Br(e,d)||t.point(d[0],d[1]),e=d,l=g,s=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),Bn(t,6*Lt),r?[0,-t]:[-At,t-At]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=zr(Ir(t),Ir(r)),o=Pr(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var c=e*o/l,u=-e*s/l,f=zr(i,a),h=Dr(i,c);Or(h,Dr(a,u));var p=f,d=Pr(h,p),g=Pr(p,p),m=d*d-g*(Pr(h,h)-1);if(!(m<0)){var v=Math.sqrt(m),x=Dr(p,(-d-v)/g);if(Or(x,h),x=Fr(x),!n)return x;var b,_=t[0],w=r[0],T=t[1],k=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=y(M-At)<kt;if(!A&&k<T&&(b=T,T=k,k=b),A||M<kt?A?T+k>0^x[1]<(y(x[0]-_)<kt?T:k):T<=x[1]&&x[1]<=k:M>At^(_<=x[0]&&x[0]<=w)){var S=Dr(p,(-d+v)/g);return Or(S,h),[x,Fr(S)]}}}function o(e,n){var i=r?t:At-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}function rn(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,p=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a<u)return;a<f&&(f=a)}else if(h>0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a<u)return;a<f&&(f=a)}if(a=e-c,p||!(a>0)){if(a/=p,p<0){if(a<u)return;a<f&&(f=a)}else if(p>0){if(a>f)return;a>u&&(u=a)}if(a=n-c,p||!(a<0)){if(a/=p,p<0){if(a>f)return;a>u&&(u=a)}else if(p>0){if(a<u)return;a<f&&(f=a)}return u>0&&(i.a={x:l+u*h,y:c+u*p}),f<1&&(i.b={x:l+f*h,y:c+f*p}),i}}}}}}function nn(e,r,n,i){return function(l){var c,u,f,h,p,d,g,m,v,y,x,b=l,_=Qr(),w=rn(e,r,n,i),T={point:A,lineStart:function(){T.point=S,u&&u.push(f=[]);y=!0,v=!1,g=m=NaN},lineEnd:function(){c&&(S(h,p),d&&v&&_.rejoin(),c.push(_.buffer()));T.point=A,v&&l.lineEnd()},polygonStart:function(){l=_,c=[],u=[],x=!0},polygonEnd:function(){l=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=u[i],l=s.length,c=s[0];o<l;++o)a=s[o],c[1]<=n?a[1]>n&&zt(c,a,t)>0&&++e:a[1]<=n&&zt(c,a,t)<0&&--e,c=a;return 0!==e}([e,i]),n=x&&r,a=c.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),k(null,null,1,l),l.lineEnd()),a&&Wr(c,o,r,k,l),l.polygonEnd()),c=u=f=null}};function k(t,o,l,c){var u=0,f=0;if(null==t||(u=a(t,l))!==(f=a(o,l))||s(t,o)<0^l>0)do{c.point(0===u||3===u?e:n,u>1?i:r)}while((u=(u+l+4)%4)!==f);else c.point(o[0],o[1])}function M(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function A(t,e){M(t,e)&&l.point(t,e)}function S(t,e){var r=M(t=Math.max(-1e9,Math.min(1e9,t)),e=Math.max(-1e9,Math.min(1e9,e)));if(u&&f.push([t,e]),y)h=t,p=e,d=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&v)l.point(t,e);else{var n={a:{x:g,y:m},b:{x:t,y:e}};w(n)?(v||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),x=!1):r&&(l.lineStart(),l.point(t,e),x=!1)}g=t,m=e,v=r}return T};function a(t,i){return y(t[0]-e)<kt?i>0?0:3:y(t[0]-n)<kt?i>0?2:1:y(t[1]-r)<kt?i>0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(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]}}function an(t){var e=0,r=At/3,n=Ln(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Dt((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(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]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function c(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return c.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&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},c.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()}}},c.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),c):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),c.translate(a.translate())):a.scale()},c.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),u=+t[0],f=+t[1];return r=a.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(l).point,n=o.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(l).point,i=s.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(l).point,c},c.scale(1070)};var sn,ln,cn,un,fn,hn,pn={point:O,lineStart:O,lineEnd:O,polygonStart:function(){ln=0,pn.lineStart=dn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=O,sn+=y(ln/2)}};function dn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}pn.point=function(a,o){pn.point=i,t=r=a,e=n=o},pn.lineEnd=function(){i(t,e)}}var gn={point:function(t,e){t<cn&&(cn=t);t>fn&&(fn=t);e<un&&(un=e);e>hn&&(hn=e)},lineStart:O,lineEnd:O,polygonStart:O,polygonEnd:O};function mn(){var t=vn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=vn(e),r},result:function(){if(e.length){var t=e.join(\"\");return e=[],t}}};function n(r,n){e.push(\"M\",r,\",\",n,t)}function i(t,n){e.push(\"M\",t,\",\",n),r.point=a}function a(t,r){e.push(\"L\",t,\",\",r)}function o(){r.point=n}function s(){e.push(\"Z\")}return r}function vn(t){return\"m0,\"+t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+-2*t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+2*t+\"z\"}var yn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=Tn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(t,e){xr+=t,br+=e,++_r}function _n(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,Tr+=o*(e+n)/2,kr+=o,bn(t=r,e=n)}xn.point=function(n,i){xn.point=r,bn(t=n,e=i)}}function wn(){xn.point=bn}function Tn(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,Tr+=o*(n+e)/2,kr+=o,Mr+=(o=n*t-r*e)*(r+t),Ar+=o*(n+e),Sr+=3*o,bn(r=t,n=e)}xn.point=function(a,o){xn.point=i,bn(t=r=a,e=n=o)},xn.lineEnd=function(){i(t,e)}}function kn(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:O};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,St)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function Mn(t){var e=.5,r=Math.cos(30*Lt),n=16;function i(t){return(n?o:a)(t)}function a(e){return En(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))}function o(e){var r,i,a,o,l,c,u,f,h,p,d,g,m={point:v,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function v(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,m.point=x,e.lineStart()}function x(r,i){var a=Ir([r,i]),o=t(r,i);s(f,h,u,p,d,g,f=o[0],h=o[1],u=r,p=a[0],d=a[1],g=a[2],n,e),e.point(f,h)}function b(){m.point=v,e.lineEnd()}function _(){y(),m.point=w,m.lineEnd=T}function w(t,e){x(r=t,e),i=f,a=h,o=p,l=d,c=g,m.point=x}function T(){s(f,h,u,p,d,g,i,a,r,o,l,c,n,e),m.lineEnd=b,b()}return m}function s(n,i,a,o,l,c,u,f,h,p,d,g,m,v){var x=u-n,b=f-i,_=x*x+b*b;if(_>4*e&&m--){var w=o+p,T=l+d,k=c+g,M=Math.sqrt(w*w+T*T+k*k),A=Math.asin(k/=M),S=y(y(k)-1)<kt||y(a-h)<kt?(a+h)/2:Math.atan2(T,w),E=t(S,A),C=E[0],L=E[1],I=C-n,P=L-i,z=b*I-x*P;(z*z/_>e||y((x*I+b*P)/_-.5)>.3||o*p+l*d+c*g<r)&&(s(n,i,a,o,l,c,C,L,S,w/=M,T/=M,k,m,v),v.point(C,L),s(C,L,S,w,T,k,u,f,h,p,d,g,m,v))}}return i.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,i):Math.sqrt(e)},i}function An(t){var e=Mn((function(e,r){return t([e*It,r*It])}));return function(t){return In(e(t))}}function Sn(t){this.stream=t}function En(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Cn(t){return Ln((function(){return t}))()}function Ln(e){var r,n,i,a,o,s,l=Mn((function(t,e){return[(t=r(t,e))[0]*c+a,o-t[1]*c]})),c=150,u=480,f=250,h=0,p=0,d=0,g=0,m=0,v=tn,y=L,x=null,b=null;function _(t){return[(t=i(t[0]*Lt,t[1]*Lt))[0]*c+a,o-t[1]*c]}function w(t){return(t=i.invert((t[0]-a)/c,(o-t[1])/c))&&[t[0]*It,t[1]*It]}function T(){i=Gr(n=On(d,g,m),r);var t=r(h,p);return a=u-t[0]*c,o=f+t[1]*c,k()}function k(){return s&&(s.valid=!1,s=null),_}return _.stream=function(t){return s&&(s.valid=!1),(s=In(v(n,l(y(t))))).valid=!0,s},_.clipAngle=function(t){return arguments.length?(v=null==t?(x=t,tn):en((x=+t)*Lt),k()):x},_.clipExtent=function(t){return arguments.length?(b=t,y=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):L,k()):b},_.scale=function(t){return arguments.length?(c=+t,T()):c},_.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],T()):[u,f]},_.center=function(t){return arguments.length?(h=t[0]%360*Lt,p=t[1]%360*Lt,T()):[h*It,p*It]},_.rotate=function(t){return arguments.length?(d=t[0]%360*Lt,g=t[1]%360*Lt,m=t.length>2?t[2]%360*Lt:0,T()):[d*It,g*It,m*It]},t.rebind(_,l,\"precision\"),function(){return r=e.apply(this,arguments),_.invert=r.invert&&w,T()}}function In(t){return En(t,(function(e,r){t.point(e*Lt,r*Lt)}))}function Pn(t,e){return[t,e]}function zn(t,e){return[t>At?t-St:t<-At?t+St:t,e]}function On(t,e,r){return t?e||r?Gr(Rn(t),Fn(e,r)):Rn(t):e||r?Fn(e,r):zn}function Dn(t){return function(e,r){return[(e+=t)>At?e-St:e<-At?e+St:e,r]}}function Rn(t){var e=Dn(t);return e.invert=Dn(-t),e}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*r+s*n;return[Math.atan2(l*i-u*a,s*r-c*n),Dt(u*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*i-l*a;return[Math.atan2(l*i+c*a,s*r+u*n),Dt(u*r-s*n)]},o}function Bn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Nn(r,i),a=Nn(r,a),(o>0?i<a:i>a)&&(i+=o*St)):(i=t+o*St,a=t-.5*l);for(var c,u=i;o>0?u>a:u<a;u-=l)s.point((c=Fr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function Nn(t,e){var r=Ir(e);r[0]-=t,Rr(r);var n=Ot(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function jn(e,r,n){var i=t.range(e,r-kt,n).concat(r);return function(t){return i.map((function(e){return[t,e]}))}}function Un(e,r,n){var i=t.range(e,r-kt,n).concat(r);return function(t){return i.map((function(e){return[e,t]}))}}function Vn(t){return t.source}function qn(t){return t.target}t.geo.path=function(){var e,r,n,i,a,o=4.5;function s(e){return e&&(\"function\"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=n(i)),t.geo.stream(e,a)),i.result()}function l(){return a=null,s}return s.area=function(e){return sn=0,t.geo.stream(e,n(pn)),sn},s.centroid=function(e){return xr=br=_r=wr=Tr=kr=Mr=Ar=Sr=0,t.geo.stream(e,n(xn)),Sr?[Mr/Sr,Ar/Sr]:kr?[wr/kr,Tr/kr]:_r?[xr/_r,br/_r]:[NaN,NaN]},s.bounds=function(e){return fn=hn=-(cn=un=1/0),t.geo.stream(e,n(gn)),[[cn,un],[fn,hn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||An(t):L,l()):e},s.context=function(t){return arguments.length?(i=null==(r=t)?new mn:new kn(t),\"function\"!=typeof o&&i.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o=\"function\"==typeof t?t:(i.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Sn(e);for(var n in t)r[n]=t[n];return r}}},Sn.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()}},t.geo.projection=Cn,t.geo.projectionMutator=Ln,(t.geo.equirectangular=function(){return Cn(Pn)}).raw=Pn.invert=Pn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Lt,e[1]*Lt))[0]*=It,e[1]*=It,e}return t=On(t[0]%360*Lt,t[1]*Lt,t.length>2?t[2]*Lt:0),e.invert=function(e){return(e=t.invert(e[0]*Lt,e[1]*Lt))[0]*=It,e[1]*=It,e},e},zn.invert=Pn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t=\"function\"==typeof r?r.apply(this,arguments):r,n=On(-t[0]*Lt,-t[1]*Lt,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=It,t[1]*=It}}),{type:\"Polygon\",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Bn((t=+r)*Lt,n*Lt),i):t},i.precision=function(r){return arguments.length?(e=Bn(t*Lt,(n=+r)*Lt),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Lt,i=t[1]*Lt,a=e[1]*Lt,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,c,u,f,h,p=10,d=p,g=90,m=360,v=2.5;function x(){return{type:\"MultiLineString\",coordinates:b()}}function b(){return t.range(Math.ceil(i/g)*g,n,g).map(f).concat(t.range(Math.ceil(l/m)*m,s,m).map(h)).concat(t.range(Math.ceil(r/p)*p,e,p).filter((function(t){return y(t%g)>kt})).map(c)).concat(t.range(Math.ceil(o/d)*d,a,d).filter((function(t){return y(t%m)>kt})).map(u))}return x.lines=function(){return b().map((function(t){return{type:\"LineString\",coordinates:t}}))},x.outline=function(){return{type:\"Polygon\",coordinates:[f(i).concat(h(s).slice(1),f(n).reverse().slice(1),h(l).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),x.precision(v)):[[i,l],[n,s]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),x.precision(v)):[[r,o],[e,a]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],m=+t[1],x):[g,m]},x.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],x):[p,d]},x.precision=function(t){return arguments.length?(v=+t,c=jn(o,a,90),u=Un(r,e,v),f=jn(l,s,90),h=Un(i,n,v),x):v},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Vn,i=qn;function a(){return{type:\"LineString\",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e=\"function\"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r=\"function\"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Lt,n=t[1]*Lt,i=e[0]*Lt,a=e[1]*Lt,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),c=Math.sin(a),u=o*Math.cos(r),f=o*Math.sin(r),h=l*Math.cos(i),p=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Ft(a-n)+o*l*Ft(i-r))),g=1/Math.sin(d),(m=d?function(t){var e=Math.sin(t*=d)*g,r=Math.sin(d-t)*g,n=r*u+e*h,i=r*f+e*p,a=r*s+e*c;return[Math.atan2(i,n)*It,Math.atan2(a,Math.sqrt(n*n+i*i))*It]}:function(){return[r*It,n*It]}).distance=d,m;var r,n,i,a,o,s,l,c,u,f,h,p,d,g,m},t.geo.length=function(e){return yn=0,t.geo.stream(e,Hn),yn};var Hn={sphere:O,point:O,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Lt),o=Math.cos(i),s=y((n*=Lt)-t),l=Math.cos(s);yn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Hn.point=function(i,a){t=i*Lt,e=Math.sin(a*=Lt),r=Math.cos(a),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=O}},lineEnd:O,polygonStart:O,polygonEnd:O};function Gn(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}var Yn=Gn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return Cn(Yn)}).raw=Yn;var Wn=Gn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),L);function Xn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return Kn;function o(t,e){a>0?e<-Ct+kt&&(e=-Ct+kt):e>Ct-kt&&(e=Ct-kt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=Pt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-Ct]},o}function Zn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)<kt)return Pn;function a(t,e){var r=i-e;return[r*Math.sin(n*t),i-r*Math.cos(n*t)]}return a.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,i-Pt(n)*Math.sqrt(t*t+r*r)]},a}(t.geo.azimuthalEquidistant=function(){return Cn(Wn)}).raw=Wn,(t.geo.conicConformal=function(){return an(Xn)}).raw=Xn,(t.geo.conicEquidistant=function(){return an(Zn)}).raw=Zn;var Jn=Gn((function(t){return 1/t}),Math.atan);function Kn(t,e){return[t,Math.log(Math.tan(At/4+e/2))]}function Qn(t){var e,r=Cn(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=At*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)}(t.geo.gnomonic=function(){return Cn(Jn)}).raw=Jn,Kn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ct]},(t.geo.mercator=function(){return Qn(Kn)}).raw=Kn;var $n=Gn((function(){return 1}),Math.asin);(t.geo.orthographic=function(){return Cn($n)}).raw=$n;var ti=Gn((function(t){return 1/(1+t)}),(function(t){return 2*Math.atan(t)}));function ei(t,e){return[Math.log(Math.tan(At/4+e/2)),-t]}function ri(t){return t[0]}function ni(t){return t[1]}function ii(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&zt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ai(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Cn(ti)}).raw=ti,ei.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ct]},(t.geo.transverseMercator=function(){var t=Qn(ei),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ei,t.geom={},t.geom.hull=function(t){var e=ri,r=ni;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=de(e),a=de(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(ai),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=ii(s),u=ii(l),f=u[0]===c[0],h=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[s[c[n]][2]]);for(n=+f;n<u.length-h;++n)p.push(t[s[u[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return U(t,oi),t};var oi=t.geom.polygon.prototype=[];function si(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function li(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function ci(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}oi.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},oi.centroid=function(t){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]},oi.clip=function(t){for(var e,r,n,i,a,o,s=ci(t),l=-1,c=this.length-ci(this),u=this[c-1];++l<c;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)si(o=e[r],u,i)?(si(a,u,i)||t.push(li(a,o,u,i)),t.push(o)):si(a,u,i)&&t.push(li(a,o,u,i)),a=o;s&&t.push(t[0]),u=i}return t};var ui,fi,hi,pi,di,gi=[],mi=[];function vi(){Ri(this),this.edge=this.site=this.circle=null}function yi(t){var e=gi.pop()||new vi;return e.site=t,e}function xi(t){Ei(t),hi.remove(t),gi.push(t),Ri(t)}function bi(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];xi(t);for(var l=a;l.circle&&y(r-l.circle.x)<kt&&y(n-l.circle.cy)<kt;)a=l.P,s.unshift(l),xi(l),l=a;s.unshift(l),Ei(l);for(var c=o;c.circle&&y(r-c.circle.x)<kt&&y(n-c.circle.cy)<kt;)o=c.N,s.push(c),xi(c),c=o;s.push(c),Ei(c);var u,f=s.length;for(u=1;u<f;++u)c=s[u],l=s[u-1],zi(c.edge,l.site,c.site,i);l=s[0],(c=s[f-1]).edge=Ii(l.site,c.site,null,i),Si(l),Si(c)}function _i(t){for(var e,r,n,i,a=t.x,o=t.y,s=hi._;s;)if((n=wi(s,o)-a)>kt)s=s.L;else{if(!((i=a-Ti(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=yi(t);if(hi.insert(e,l),e||r){if(e===r)return Ei(e),r=yi(e.site),hi.insert(l,r),l.edge=r.edge=Ii(e.site,l.site),Si(e),void Si(r);if(r){Ei(e),Ei(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,p=t.y-f,d=r.site,g=d.x-u,m=d.y-f,v=2*(h*m-p*g),y=h*h+p*p,x=g*g+m*m,b={x:(m*y-p*x)/v+u,y:(h*x-g*y)/v+f};zi(r.edge,c,d,b),l.edge=Ii(c,t,null,b),r.edge=Ii(t,d,null,b),Si(e),Si(r)}else l.edge=Ii(e.site,l.site)}}function wi(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;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function Ti(t,e){var r=t.N;if(r)return wi(r,e);var n=t.site;return n.y===e?n.x:1/0}function ki(t){this.site=t,this.edges=[]}function Mi(t,e){return e.angle-t.angle}function Ai(){Ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Si(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,c=n.y-s,u=a.x-o,f=2*(l*(m=a.y-s)-c*u);if(!(f>=-Mt)){var h=l*l+c*c,p=u*u+m*m,d=(m*h-c*p)/f,g=(l*p-u*h)/f,m=g+s,v=mi.pop()||new Ai;v.arc=t,v.site=i,v.x=d+o,v.y=m+Math.sqrt(d*d+g*g),v.cy=m,t.circle=v;for(var y=null,x=di._;x;)if(v.y<x.y||v.y===x.y&&v.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}di.insert(y,v),y||(pi=v)}}}}function Ei(t){var e=t.circle;e&&(e.P||(pi=e.N),di.remove(e),mi.push(e),Ri(e),t.circle=null)}function Ci(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],c=e[1][1],u=t.l,f=t.r,h=u.x,p=u.y,d=f.x,g=f.y,m=(h+d)/2,v=(p+g)/2;if(g===p){if(m<o||m>=s)return;if(h>d){if(a){if(a.y>=c)return}else a={x:m,y:l};r={x:m,y:c}}else{if(a){if(a.y<l)return}else a={x:m,y:c};r={x:m,y:l}}}else if(i=v-(n=(h-d)/(g-p))*m,n<-1||n>1)if(h>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y<l)return}else a={x:(c-i)/n,y:c};r={x:(l-i)/n,y:l}}else if(p<g){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 Li(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ii(t,e,r,n){var i=new Li(t,e);return ui.push(i),r&&zi(i,t,e,r),n&&zi(i,e,t,n),fi[t.i].edges.push(new Oi(i,t,e)),fi[e.i].edges.push(new Oi(i,e,t)),i}function Pi(t,e,r){var n=new Li(t,null);return n.a=e,n.b=r,ui.push(n),n}function zi(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 Oi(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 Di(){this._=null}function Ri(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Fi(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 Bi(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 Ni(t){for(;t.L;)t=t.L;return t}function ji(t,e){var r,n,i,a=t.sort(Ui).pop();for(ui=[],fi=new Array(t.length),hi=new Di,di=new Di;;)if(i=pi,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(fi[a.i]=new ki(a),_i(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;bi(i.arc)}e&&(function(t){for(var e,r=ui,n=rn(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!Ci(e=r[i],t)||!n(e)||y(e.a.x-e.b.x)<kt&&y(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(i,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],p=t[0][1],d=t[1][1],g=fi,m=g.length;m--;)if((a=g[m])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(u=s[o].end()).x,i=u.y,e=(c=s[++o%l].start()).x,r=c.y,(y(n-e)>kt||y(i-r)>kt)&&(s.splice(o,0,new Oi(Pi(a.site,u,y(n-f)<kt&&d-i>kt?{x:f,y:y(e-f)<kt?r:d}:y(i-d)<kt&&h-n>kt?{x:y(r-d)<kt?e:h,y:d}:y(n-h)<kt&&i-p>kt?{x:h,y:y(e-h)<kt?r:p}:y(i-p)<kt&&n-f>kt?{x:y(r-p)<kt?e:f,y:p}:null),a.site,null)),++l)}(e));var o={cells:fi,edges:ui};return hi=di=ui=fi=null,o}function Ui(t,e){return e.y-t.y||e.x-t.x}ki.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(Mi),e.length},Oi.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}},Di.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=Ni(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;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(Fi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Bi(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(Bi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Fi(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?Ni(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)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Fi(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,Bi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Fi(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Bi(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,Fi(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Bi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ri,r=ni,n=e,i=r,a=Vi;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return ji(s(t),a).cells.forEach((function(a,s){var l=a.edges,c=a.site;(e[s]=l.length?l.map((function(t){var e=t.start();return[e.x,e.y]})):c.x>=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ji(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ji(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(Mi),u=-1,f=c.length,h=c[f-1].edge,p=h.l===l?h.r:h.l;++u<f;)h,i=p,p=(h=c[u].edge).l===l?h.r:h.l,n<i.i&&n<p.i&&(o=i,s=p,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&e.push([t[n],t[i.i],t[p.i]])})),e},o.x=function(t){return arguments.length?(n=de(e=t),o):e},o.y=function(t){return arguments.length?(i=de(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?Vi:t,o):a===Vi?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===Vi?null:a&&a[1]},o};var Vi=[[-1e6,-1e6],[1e6,1e6]];function qi(t){return t.x}function Hi(t){return t.y}function Gi(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]&&Gi(t,l[0],r,n,o,s),l[1]&&Gi(t,l[1],o,n,i,s),l[2]&&Gi(t,l[2],r,s,o,a),l[3]&&Gi(t,l[3],o,s,i,a)}}function Yi(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,p){if(!(u>a||f>o||h<n||p<i)){if(d=c.point){var d,g=e-c.x,m=r-c.y,v=g*g+m*m;if(v<l){var y=Math.sqrt(l=v);n=e-y,i=r-y,a=e+y,o=r+y,s=d}}for(var x=c.nodes,b=.5*(u+h),_=.5*(f+p),w=(r>=_)<<1|e>=b,T=w+4;w<T;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,h,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,h,p)}}}(t,n,i,a,o),s}function Wi(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return\"#\"+se(Math.round(n+o*t))+se(Math.round(i+s*t))+se(Math.round(a+l*t))}}function Xi(t,e){var r,n={},i={};for(r in t)r in e?n[r]=$i(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 Zi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ji(t,e){var r,n,i,a=Ki.lastIndex=Qi.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=Ki.exec(t))&&(n=Qi.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,l.push({i:o,x:Zi(r,n)})),a=Qi.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;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=ri,s=ni;if(a=arguments.length)return o=qi,s=Hi,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,c,u,f,h,p,d,g,m,v=de(o),x=de(s);if(null!=e)p=e,d=r,g=n,m=i;else if(g=m=-(p=d=1/0),c=[],u=[],h=t.length,a)for(f=0;f<h;++f)(l=t[f]).x<p&&(p=l.x),l.y<d&&(d=l.y),l.x>g&&(g=l.x),l.y>m&&(m=l.y),c.push(l.x),u.push(l.y);else for(f=0;f<h;++f){var b=+v(l=t[f],f),_=+x(l,f);b<p&&(p=b),_<d&&(d=_),b>g&&(g=b),_>m&&(m=_),c.push(b),u.push(_)}var w=g-p,T=m-d;function k(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(y(l-r)+y(c-n)<.01)M(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,l,c,i,a,o,s),M(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,i,a,o,s)}function M(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,f=n>=c,h=f<<1|u;t.leaf=!1,u?i=l:o=l,f?a=c:s=c,k(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?m=d+w:g=p+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+v(t,++f),+x(t,f),p,d,g,m)},visit:function(t){Gi(t,A,p,d,g,m)},find:function(t){return Yi(A,t[0],t[1],p,d,g,m)}};if(f=-1,null==e){for(;++f<h;)k(A,t[f],c[f],u[f],p,d,g,m);--f}else t.forEach(A.add);return c=u=t=l=null,A}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.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]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=Wi,t.interpolateObject=Xi,t.interpolateNumber=Zi,t.interpolateString=Ji;var Ki=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Qi=new RegExp(Ki.source,\"g\");function $i(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function ta(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push($i(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=$i,t.interpolators=[function(t,e){var r=typeof e;return(\"string\"===r?pe.has(e.toLowerCase())||/^(#|rgb\\(|hsl\\()/i.test(e)?Wi:Ji:e instanceof Vt?Wi:Array.isArray(e)?ta:\"object\"===r&&isNaN(e)?Xi:Zi)(t,e)}],t.interpolateArray=ta;var ea=function(){return L},ra=t.map({linear:ea,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return sa},cubic:function(){return la},sin:function(){return ua},exp:function(){return fa},circle:function(){return ha},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/St*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*St/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return pa}}),na=t.map({in:L,out:aa,\"in-out\":oa,\"out-in\":function(t){return oa(aa(t))}});function ia(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function aa(t){return function(e){return 1-t(1-e)}}function oa(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function sa(t){return t*t}function la(t){return t*t*t}function ca(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ua(t){return 1-Math.cos(t*Ct)}function fa(t){return Math.pow(2,10*(t-1))}function ha(t){return 1-Math.sqrt(1-t*t)}function pa(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function da(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ga(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=va(i),s=ma(i,a),l=va(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*It,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*It:0}function ma(t,e){return t[0]*e[0]+t[1]*e[1]}function va(t){var e=Math.sqrt(ma(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e=t.indexOf(\"-\"),n=e>=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):\"in\";return n=ra.get(n)||ea,ia((i=na.get(i)||L)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Xt(n+o*t,i+s*t,a+l*t)+\"\"}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Gt(n+o*t,i+s*t,a+l*t)+\"\"}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Qt(n+o*t,i+s*t,a+l*t)+\"\"}},t.interpolateRound=da,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,\"g\");return(t.transform=function(t){if(null!=t){r.setAttribute(\"transform\",t);var e=r.transform.baseVal.consolidate()}return new ga(e?e.matrix:ya)})(e)},ga.prototype.toString=function(){return\"translate(\"+this.translate+\")rotate(\"+this.rotate+\")skewX(\"+this.skew+\")scale(\"+this.scale+\")\"};var ya={a:1,b:0,c:0,d:1,e:0,f:0};function xa(t){return t.length?t.pop()+\",\":\"\"}function ba(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(\"translate(\",null,\",\",null,\")\");n.push({i:i-4,x:Zi(t[0],e[0])},{i:i-2,x:Zi(t[1],e[1])})}else(e[0]||e[1])&&r.push(\"translate(\"+e+\")\")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(xa(r)+\"rotate(\",null,\")\")-2,x:Zi(t,e)})):e&&r.push(xa(r)+\"rotate(\"+e+\")\")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(xa(r)+\"skewX(\",null,\")\")-2,x:Zi(t,e)}):e&&r.push(xa(r)+\"skewX(\"+e+\")\")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(xa(r)+\"scale(\",null,\",\",null,\")\");n.push({i:i-4,x:Zi(t[0],e[0])},{i:i-2,x:Zi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(xa(r)+\"scale(\"+e+\")\")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join(\"\")}}function _a(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function wa(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Ta(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ka(t),n=ka(e),i=r.pop(),a=n.pop(),o=null;for(;i===a;)o=i,i=r.pop(),a=n.pop();return o}(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 ka(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Ma(t){t.fixed|=2}function Aa(t){t.fixed&=-7}function Sa(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ea(t){t.fixed&=-5}t.interpolateTransform=ba,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Ta(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},c=0;function u(){var l,u,h,p,d,g={},m=[],v=t.range(i),y=[];for(e=[],r=[],l=0,p=-1;++p<i;){for(u=0,d=-1;++d<i;)u+=n[p][d];m.push(u),y.push(t.range(i)),l+=u}for(a&&v.sort((function(t,e){return a(m[t],m[e])})),o&&y.forEach((function(t,e){t.sort((function(t,r){return o(n[e][t],n[e][r])}))})),l=(St-c*i)/l,u=0,p=-1;++p<i;){for(h=u,d=-1;++d<i;){var x=v[p],b=y[x][d],_=n[x][b],w=u,T=u+=_*l;g[x+\"-\"+b]={index:x,subindex:b,startAngle:w,endAngle:T,value:_}}r[x]={index:x,startAngle:h,endAngle:u,value:m[x]},u+=c}for(p=-1;++p<i;)for(d=p-1;++d<i;){var k=g[p+\"-\"+d],M=g[d+\"-\"+p];(k.value||M.value)&&e.push(k.value<M.value?{source:M,target:k}:{source:k,target:M})}s&&f()}function f(){e.sort((function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(c=t,e=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&f(),l):s},l.chords=function(){return e||u(),e},l.groups=function(){return r||u(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch(\"start\",\"tick\",\"end\"),c=[1,1],u=.9,f=Ca,h=La,p=-30,d=Ia,g=.1,m=.64,v=[],y=[];function x(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(s*s/m<l){if(l<d){var c=e.charge/l;t.px-=a*c,t.py-=o*c}return!0}if(e.point&&l&&l<d){c=e.pointCharge/l;t.px-=a*c,t.py-=o*c}}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:\"end\",alpha:n=0}),!0;var r,s,f,h,d,m,b,_,w,T=v.length,k=y.length;for(s=0;s<k;++s)h=(f=y[s]).source,(m=(_=(d=f.target).x-h.x)*_+(w=d.y-h.y)*w)&&(_*=m=n*a[s]*((m=Math.sqrt(m))-i[s])/m,w*=m,d.x-=_*(b=h.weight+d.weight?h.weight/(h.weight+d.weight):.5),d.y-=w*b,h.x+=_*(b=1-b),h.y+=w*b);if((b=n*g)&&(_=c[0]/2,w=c[1]/2,s=-1,b))for(;++s<T;)(f=v[s]).x+=(_-f.x)*b,f.y+=(w-f.y)*b;if(p)for(!function t(e,r,n){var i=0,a=0;if(e.charge=0,!e.leaf)for(var o,s=e.nodes,l=s.length,c=-1;++c<l;)null!=(o=s[c])&&(t(o,r,n),e.charge+=o.charge,i+=o.charge*o.cx,a+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=r*n[e.point.index];e.charge+=e.pointCharge=u,i+=u*e.point.x,a+=u*e.point.y}e.cx=i/e.charge,e.cy=a/e.charge}(r=t.geom.quadtree(v),n,o),s=-1;++s<T;)(f=v[s]).fixed||r.visit(x(f));for(s=-1;++s<T;)(f=v[s]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);l.tick({type:\"tick\",alpha:n})},s.nodes=function(t){return arguments.length?(v=t,s):v},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(c=t,s):c},s.linkDistance=function(t){return arguments.length?(f=\"function\"==typeof t?t:+t,s):f},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h=\"function\"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(u=+t,s):u},s.charge=function(t){return arguments.length?(p=\"function\"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(d=t*t,s):Math.sqrt(d)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:\"end\",alpha:n=0})):t>0&&(l.start({type:\"start\",alpha:n=t}),e=we(s.tick)),s):n},s.start=function(){var t,e,r,n=v.length,l=y.length,u=c[0],d=c[1];for(t=0;t<n;++t)(r=v[t]).index=t,r.weight=0;for(t=0;t<l;++t)\"number\"==typeof(r=y[t]).source&&(r.source=v[r.source]),\"number\"==typeof r.target&&(r.target=v[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=v[t],isNaN(r.x)&&(r.x=g(\"x\",u)),isNaN(r.y)&&(r.y=g(\"y\",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],\"function\"==typeof f)for(t=0;t<l;++t)i[t]=+f.call(this,y[t],t);else for(t=0;t<l;++t)i[t]=f;if(a=[],\"function\"==typeof h)for(t=0;t<l;++t)a[t]=+h.call(this,y[t],t);else for(t=0;t<l;++t)a[t]=h;if(o=[],\"function\"==typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,v[t],t);else for(t=0;t<n;++t)o[t]=p;function g(r,i){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<l;++c){var a=y[c];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(L).on(\"dragstart.force\",Ma).on(\"drag.force\",b).on(\"dragend.force\",Aa)),!arguments.length)return r;this.on(\"mouseover.force\",Sa).on(\"mouseout.force\",Ea).call(r)},t.rebind(s,l,\"on\")};var Ca=20,La=1,Ia=1/0;function Pa(e,r){return t.rebind(e,r,\"sort\",\"children\",\"value\"),e.nodes=e,e.links=Ba,e}function za(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 Oa(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 Da(t){return t.children}function Ra(t){return t.value}function Fa(t,e){return e.value-t.value}function Ba(e){return t.merge(e.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}t.layout.hierarchy=function(){var t=Fa,e=Da,r=Ra;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(c=e.call(n,a,a.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return Oa(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(za(t,(function(t){t.children&&(t.value=0)})),Oa(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return 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,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(s=a[c],r,l=s.value*n,i),r+=l}}(i[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,t(r[a]));return 1+n}(i[0])),i}return n.size=function(t){return arguments.length?(r=t,n):r},Pa(n,e)},t.layout.pie=function(){var e=Number,r=Na,n=0,i=St,a=0;function o(s){var l,c=s.length,u=s.map((function(t,r){return+e.call(o,t,r)})),f=+(\"function\"==typeof n?n.apply(this,arguments):n),h=(\"function\"==typeof i?i.apply(this,arguments):i)-f,p=Math.min(Math.abs(h)/c,+(\"function\"==typeof a?a.apply(this,arguments):a)),d=p*(h<0?-1:1),g=t.sum(u),m=g?(h-c*d)/g:0,v=t.range(c),y=[];return null!=r&&v.sort(r===Na?function(t,e){return u[e]-u[t]}:function(t,e){return r(s[t],s[e])}),v.forEach((function(t){y[t]={data:s[t],value:l=u[t],startAngle:f,endAngle:f+=l*m+d,padAngle:p}})),y}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var Na={};function ja(t){return t.x}function Ua(t){return t.y}function Va(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=L,r=Ga,n=Ya,i=Va,a=ja,o=Ua;function s(l,c){if(!(p=l.length))return l;var u=l.map((function(t,r){return e.call(s,t,r)})),f=u.map((function(t){return t.map((function(t,e){return[a.call(s,t,e),o.call(s,t,e)]}))})),h=r.call(s,f,c);u=t.permute(u,h),f=t.permute(f,h);var p,d,g,m,v=n.call(s,f,c),y=u[0].length;for(g=0;g<y;++g)for(i.call(s,u[0][g],m=v[g],f[0][g][1]),d=1;d<p;++d)i.call(s,u[d][g],m+=f[d-1][g][1],f[d][g][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r=\"function\"==typeof t?t:qa.get(t)||Ga,s):r},s.offset=function(t){return arguments.length?(n=\"function\"==typeof t?t:Ha.get(t)||Ya,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var qa=t.map({\"inside-out\":function(e){var r,n,i=e.length,a=e.map(Wa),o=e.map(Xa),s=t.range(i).sort((function(t,e){return a[t]-a[e]})),l=0,c=0,u=[],f=[];for(r=0;r<i;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:Ga}),Ha=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,c,u=t.length,f=t[0],h=f.length,p=[];for(p[0]=l=c=0,r=1;r<h;++r){for(e=0,i=0;e<u;++e)i+=t[e][r][1];for(e=0,a=0,s=f[r][0]-f[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}p[r]=l-=i?a/i*s:0,l<c&&(c=l)}for(r=0;r<h;++r)p[r]-=c;return p},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:Ya});function Ga(e){return t.range(e.length)}function Ya(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Wa(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function Xa(t){return t.reduce(Za,0)}function Za(t,e){return t+e[1]}function Ja(t,e){return Ka(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ka(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 Qa(e){return[t.min(e),t.max(e)]}function $a(t,e){return t.value-e.value}function to(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function eo(t,e){t._pack_next=e,e._pack_prev=t}function ro(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 no(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,f=1/0,h=-1/0;if(e.forEach(io),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(oo(r,n,i=e[2]),x(i),to(r,i),r._pack_prev=i,to(i,n),n=r._pack_next,a=3;a<l;a++){oo(r,n,i=e[a]);var p=0,d=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(ro(o,i)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!ro(s,i);s=s._pack_prev,g++);p?(d<g||d==g&&n.r<r.r?eo(r,n=o):eo(r=s,n),a--):(to(r,i),n=i,x(i))}var m=(c+u)/2,v=(f+h)/2,y=0;for(a=0;a<l;a++)(i=e[a]).x-=m,i.y-=v,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=y,e.forEach(ao)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),f=Math.min(t.y-t.r,f),h=Math.max(t.y+t.r,h)}}function io(t){t._pack_next=t._pack_prev=t}function ao(t){delete t._pack_next,delete t._pack_prev}function oo(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,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+c*a,r.y=t.y+l*a-c*i}else r.x=t.x+n,r.y=t.y}function so(t,e){return t.parent==e.parent?1:2}function lo(t){var e=t.children;return e.length?e[0]:t.t}function co(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function uo(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 fo(t,e,r){return t.a.parent===e.parent?t.a:r}function ho(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function po(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function go(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function mo(t){return t.rangeExtent?t.rangeExtent():go(t.range())}function vo(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 yo(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function xo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:bo}t.layout.histogram=function(){var e=!0,r=Number,n=Qa,i=Ja;function a(a,o){for(var s,l,c=[],u=a.map(r,this),f=n.call(this,u,o),h=i.call(this,f,u,o),p=(o=-1,u.length),d=h.length-1,g=e?1:1/p;++o<d;)(s=c[o]=[]).dx=h[o+1]-(s.x=h[o]),s.y=0;if(d>0)for(o=-1;++o<p;)(l=u[o])>=f[0]&&l<=f[1]&&((s=c[t.bisect(h,l,1,d)-1]).y+=g,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=de(t),a):n},a.bins=function(t){return arguments.length?(i=\"number\"==typeof t?function(e){return Ka(e,t)}:de(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort($a),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:\"function\"==typeof e?e:function(){return e};if(s.x=s.y=0,Oa(s,(function(t){t.r=+u(t.value)})),Oa(s,no),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;Oa(s,(function(t){t.r+=f})),Oa(s,no),Oa(s,(function(t){t.r-=f}))}return function t(e,r,n,i){var a=e.children;if(e.x=r+=i*e.x,e.y=n+=i*e.y,e.r*=i,a)for(var o=-1,s=a.length;++o<s;)t(a[o],r,n,i)}(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||\"function\"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Pa(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],i=null;function a(t,a){var c=e.call(this,t,a),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++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]}(u);if(Oa(f,o),f.parent.m=-f.z,za(f,s),i)za(u,l);else{var h=u,p=u,d=u;za(u,(function(t){t.x<h.x&&(h=t),t.x>p.x&&(p=t),t.depth>d.depth&&(d=t)}));var g=r(h,p)/2-h.x,m=n[0]/(p.x+r(p,h)/2+g),v=n[1]/(d.depth||1);za(u,(function(t){t.x=(t.x+g)*m,t.y=t.depth*v}))}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=co(s),a=lo(a),s&&a;)l=lo(l),(o=co(o)).a=t,(i=s.z+f-a.z-c+r(s._,a._))>0&&(uo(fo(s,t,n),t,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!co(o)&&(o.t=s,o.m+=f-u),a&&!lo(l)&&(l.t=a,l.m+=c-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Pa(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;Oa(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,h)/2,d=h.x+r(h,f)/2;return Oa(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Pa(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=ho,s=!1,l=\"squarify\",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function f(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],c=e.slice(),h=1/0,g=\"slice\"===l?a.dx:\"dice\"===l?a.dy:\"slice-dice\"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(u(c,a.dx*a.dy/t.value),s.area=0;(i=c.length)>0;)s.push(r=c[i-1]),s.area+=r.area,\"squarify\"!==l||(n=p(s,g))<=h?(c.pop(),h=n):(s.area-=s.pop().area,d(s,g,a,!1),g=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,g,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++o<s;)(a=t[o]).x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?n(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((i||u>r.dx)&&(u=r.dx);++o<s;)(a=t[o]).x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?n(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function g(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),u([a],a.dx*a.dy/a.value),(e?h:f)(a),s&&(e=n),n}return g.size=function(t){return arguments.length?(i=t,g):i},g.padding=function(t){if(!arguments.length)return a;function e(e){var r=t.call(g,e,e.depth);return null==r?ho(e):po(e,\"number\"==typeof r?[r,r,r,r]:r)}function r(e){return po(e,t)}var n;return o=null==(a=t)?ho:\"function\"==(n=typeof t)?e:\"number\"===n?(t=[t,t,t,t],r):r,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(s=t,e=null,g):s},g.ratio=function(t){return arguments.length?(c=t,g):c},g.mode=function(t){return arguments.length?(l=t+\"\",g):l},Pa(g,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var bo={floor:L,ceil:L};function _o(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function wo(e,r){return t.rebind(e,r,\"range\",\"rangeRound\",\"interpolate\",\"clamp\")}function To(t,e){return yo(t,xo(ko(t,e)[2])),yo(t,xo(ko(t,e)[2])),t}function ko(t,e){null==e&&(e=10);var r=go(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Mo(e,r){return t.range.apply(t,ko(e,r))}function Ao(e,r,n){var i=ko(e,r);if(n){var a=Ce.exec(n);if(a.shift(),\"s\"===a[8]){var o=t.formatPrefix(Math.max(y(i[0]),y(i[1])));return a[7]||(a[7]=\".\"+Eo(o.scale(i[2]))),a[8]=\"f\",n=t.format(a.join(\"\")),function(t){return n(o.scale(t))+o.symbol}}a[7]||(a[7]=\".\"+function(t,e){var r=Eo(e[2]);return t in So?Math.abs(r-Eo(Math.max(y(e[0]),y(e[1]))))+ +(\"e\"!==t):r-2*(\"%\"===t)}(a[8],i)),n=a.join(\"\")}else n=\",.\"+Eo(i[2])+\"f\";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,i){var a,o;function s(){var t=Math.min(e.length,r.length)>2?_o:vo,s=i?wa:_a;return a=t(e,r,s,n),o=t(r,e,s,$i),l}function l(t){return a(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(da)},l.clamp=function(t){return arguments.length?(i=t,s()):i},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Mo(e,t)},l.tickFormat=function(t,r){return Ao(e,t,r)},l.nice=function(t){return To(e,t),s()},l.copy=function(){return t(e,r,n,i)},s()}([0,1],[0,1],$i,!1)};var So={s:1,g:1,p:1,r:1,e:1};function Eo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a},l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n},l.nice=function(){var t=yo(a.map(o),i?Math:Lo);return r.domain(t),a=t.map(s),l},l.ticks=function(){var t=go(a),e=[],r=t[0],l=t[1],c=Math.floor(o(r)),u=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(u-c)){if(i){for(;c<u;c++)for(var h=1;h<f;h++)e.push(s(c)*h);e.push(s(c))}else for(e.push(s(c));c++<u;)for(h=f-1;h>0;h--)e.push(s(c)*h);for(c=0;e[c]<r;c++);for(u=e.length;e[u-1]>l;u--);e=e.slice(c,u)}return e},l.tickFormat=function(e,r){if(!arguments.length)return Co;arguments.length<2?r=Co:\"function\"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=i?r(t):\"\"}},l.copy=function(){return e(r.copy(),n,i,a)},wo(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Co=t.format(\".0e\"),Lo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Io(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=Io(r),a=Io(1/r);function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n},o.ticks=function(t){return Mo(n,t)},o.tickFormat=function(t,e){return Ao(n,t,e)},o.nice=function(t){return o.domain(To(n,t))},o.exponent=function(t){return arguments.length?(i=Io(r=t),a=Io(1/r),e.domain(n.map(i)),o):r},o.copy=function(){return t(e.copy(),r,n)},wo(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||(\"range\"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],i=new _;for(var e,a=-1,o=t.length;++a<o;)i.has(e=t[a])||i.set(e,r.push(e));return s[n.t].apply(s,n.a)},s.range=function(t){return arguments.length?(a=t,o=0,n={t:\"range\",a:arguments},s):a},s.rangePoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],c=t[1],u=r.length<2?(i=(i+c)/2,0):(c-i)/(r.length-1+e);return a=l(i+u*e/2,u),o=0,n={t:\"rangePoints\",a:arguments},s},s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],c=t[1],u=r.length<2?(i=c=Math.round((i+c)/2),0):(c-i)/(r.length-1+e)|0;return a=l(i+Math.round(u*e/2+(c-i-(r.length-1+e)*u)/2),u),o=0,n={t:\"rangeRoundPoints\",a:arguments},s},s.rangeBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],h=(f-u)/(r.length-e+2*i);return a=l(u+h*i,h),c&&a.reverse(),o=h*(1-e),n={t:\"rangeBands\",a:arguments},s},s.rangeRoundBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var c=t[1]<t[0],u=t[c-0],f=t[1-c],h=Math.floor((f-u)/(r.length-e+2*i));return a=l(u+Math.round((f-u-(r.length-e)*h)/2),h),c&&a.reverse(),o=Math.round(h*(1-e)),n={t:\"rangeRoundBands\",a:arguments},s},s.rangeBand=function(){return o},s.rangeExtent=function(){return go(n.a[0])},s.copy=function(){return e(r,n)},s.domain(r)}([],{t:\"range\",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Po)},t.scale.category20=function(){return t.scale.ordinal().range(zo)},t.scale.category20b=function(){return t.scale.ordinal().range(Oo)},t.scale.category20c=function(){return t.scale.ordinal().range(Do)};var Po=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ae),zo=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ae),Oo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ae),Do=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ae);function Ro(){return 0}t.scale.quantile=function(){return function e(r,n){var i;function a(){var e=0,a=n.length;for(i=[];++e<a;)i[e-1]=t.quantile(r,e/a);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(i,e)]}return o.domain=function(t){return arguments.length?(r=t.map(p).filter(d).sort(h),a()):r},o.range=function(t){return arguments.length?(n=t,a()):n},o.quantiles=function(){return i},o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]},o.copy=function(){return e(r,n)},a()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var i,a;function o(t){return n[Math.max(0,Math.min(a,Math.floor(i*(t-e))))]}function s(){return i=n.length/(r-e),a=n.length-1,o}return o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]},o.range=function(t){return arguments.length?(n=t,s()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/i+e,t+1/i]},o.copy=function(){return t(e,r,n)},s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function i(e){if(e<=e)return n[t.bisect(r,e)]}return i.domain=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=t,i):n},i.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]},i.copy=function(){return e(r,n)},i}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e},r.ticks=function(t){return Mo(e,t)},r.tickFormat=function(t,r){return Ao(e,t,r)},r.copy=function(){return t(e)},r}([0,1])},t.svg={},t.svg.arc=function(){var t=Bo,e=No,r=Ro,n=Fo,i=jo,a=Uo,o=Vo;function s(){var s=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=i.apply(this,arguments)-Ct,f=a.apply(this,arguments)-Ct,h=Math.abs(f-u),p=u>f?0:1;if(c<s&&(d=c,c=s,s=d),h>=Et)return l(c,p)+(s?l(s,1-p):\"\")+\"Z\";var d,g,m,v,y,x,b,_,w,T,k,M,A=0,S=0,E=[];if((v=(+o.apply(this,arguments)||0)/2)&&(m=n===Fo?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Dt(m/c*Math.sin(v))),s&&(A=Dt(m/s*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var C=Math.abs(f-u-2*S)<=At?0:1;if(S&&qo(y,x,b,_)===p^C){var L=(u+f)/2;y=c*Math.cos(L),x=c*Math.sin(L),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-A),T=s*Math.sin(f-A),k=s*Math.cos(u+A),M=s*Math.sin(u+A);var I=Math.abs(u-f+2*A)<=At?0:1;if(A&&qo(w,T,k,M)===1-p^I){var P=(u+f)/2;w=s*Math.cos(P),T=s*Math.sin(P),k=M=null}}else w=T=0;if(h>kt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){g=s<c^p?0:1;var z=d,O=d;if(h<At){var D=null==k?[w,T]:null==b?[y,x]:li([y,x],[k,M],[b,_],[w,T]),R=y-D[0],F=x-D[1],B=b-D[0],N=_-D[1],j=1/Math.sin(Math.acos((R*B+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+N*N)))/2),U=Math.sqrt(D[0]*D[0]+D[1]*D[1]);O=Math.min(d,(s-U)/(j-1)),z=Math.min(d,(c-U)/(j+1))}if(null!=b){var V=Ho(null==k?[w,T]:[k,M],[y,x],c,z,p),q=Ho([b,_],[w,T],c,z,p);d===z?E.push(\"M\",V[0],\"A\",z,\",\",z,\" 0 0,\",g,\" \",V[1],\"A\",c,\",\",c,\" 0 \",1-p^qo(V[1][0],V[1][1],q[1][0],q[1][1]),\",\",p,\" \",q[1],\"A\",z,\",\",z,\" 0 0,\",g,\" \",q[0]):E.push(\"M\",V[0],\"A\",z,\",\",z,\" 0 1,\",g,\" \",q[0])}else E.push(\"M\",y,\",\",x);if(null!=k){var H=Ho([y,x],[k,M],s,-O,p),G=Ho([w,T],null==b?[y,x]:[b,_],s,-O,p);d===O?E.push(\"L\",G[0],\"A\",O,\",\",O,\" 0 0,\",g,\" \",G[1],\"A\",s,\",\",s,\" 0 \",p^qo(G[1][0],G[1][1],H[1][0],H[1][1]),\",\",1-p,\" \",H[1],\"A\",O,\",\",O,\" 0 0,\",g,\" \",H[0]):E.push(\"L\",G[0],\"A\",O,\",\",O,\" 0 0,\",g,\" \",H[0])}else E.push(\"L\",w,\",\",T)}else E.push(\"M\",y,\",\",x),null!=b&&E.push(\"A\",c,\",\",c,\" 0 \",C,\",\",p,\" \",b,\",\",_),E.push(\"L\",w,\",\",T),null!=k&&E.push(\"A\",s,\",\",s,\" 0 \",I,\",\",1-p,\" \",k,\",\",M);return E.push(\"Z\"),E.join(\"\")}function l(t,e){return\"M0,\"+t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+-t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+t}return s.innerRadius=function(e){return arguments.length?(t=de(e),s):t},s.outerRadius=function(t){return arguments.length?(e=de(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=de(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==Fo?Fo:de(t),s):n},s.startAngle=function(t){return arguments.length?(i=de(t),s):i},s.endAngle=function(t){return arguments.length?(a=de(t),s):a},s.padAngle=function(t){return arguments.length?(o=de(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Ct;return[Math.cos(n)*r,Math.sin(n)*r]},s};var Fo=\"auto\";function Bo(t){return t.innerRadius}function No(t){return t.outerRadius}function jo(t){return t.startAngle}function Uo(t){return t.endAngle}function Vo(t){return t&&t.padAngle}function qo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Ho(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,p=e[1]+c,d=(u+h)/2,g=(f+p)/2,m=h-u,v=p-f,y=m*m+v*v,x=r-n,b=u*p-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-m*_)/y,T=(-b*m-v*_)/y,k=(b*v+m*_)/y,M=(-b*m+v*_)/y,A=w-d,S=T-g,E=k-d,C=M-g;return A*A+S*S>E*E+C*C&&(w=k,T=M),[[w-l,T-c],[w*r/x,T*r/x]]}function Go(t){var e=ri,r=ni,n=Yr,i=Wo,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,f=a.length,h=de(e),p=de(r);function d(){l.push(\"M\",i(t(c),o))}for(;++u<f;)n.call(this,s=a[u],u)?c.push([+h.call(this,s,u),+p.call(this,s,u)]):c.length&&(d(),c=[]);return c.length&&d(),l.length?l.join(\"\"):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a=\"function\"==typeof t?i=t:(i=Yo.get(t)||Wo).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Go(L)};var Yo=t.map({linear:Wo,\"linear-closed\":Xo,step:function(t){var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];for(;++e<r;)i.push(\"H\",(n[0]+(n=t[e])[0])/2,\"V\",n[1]);r>1&&i.push(\"H\",n[0]);return i.join(\"\")},\"step-before\":Zo,\"step-after\":Jo,basis:$o,\"basis-open\":function(t){if(t.length<4)return Wo(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(ts(ns,a)+\",\"+ts(ns,o)),--n;for(;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),is(r,a,o);return r.join(\"\")},\"basis-closed\":function(t){var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];for(;++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);e=[ts(ns,o),\",\",ts(ns,s)],--n;for(;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),is(e,o,s);return e.join(\"\")},bundle:function(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,c=-1;++c<=r;)n=t[c],i=c/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return $o(t)},cardinal:function(t,e){return t.length<3?Wo(t):t[0]+Ko(t,Qo(t,e))},\"cardinal-open\":function(t,e){return t.length<4?Wo(t):t[1]+Ko(t.slice(1,-1),Qo(t,e))},\"cardinal-closed\":function(t,e){return t.length<3?Xo(t):t[0]+Ko((t.push(t[0]),t),Qo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Wo(t):t[0]+Ko(t,function(t){var e,r,n,i,a=[],o=function(t){var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=as(i,a);for(;++e<r;)n[e]=(o+(o=as(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=as(t[s],t[s+1]),y(e)<kt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++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}(t))}});function Wo(t){return t.length>1?t.join(\"L\"):t+\"Z\"}function Xo(t){return t.join(\"L\")+\"Z\"}function Zo(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 Jo(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 Ko(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Wo(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 c=2;c<e.length;c++,l++)a=t[l],s=e[c],n+=\"S\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1]}if(r){var u=t[l];n+=\"Q\"+(a[0]+2*s[0]/3)+\",\"+(a[1]+2*s[1]/3)+\",\"+u[0]+\",\"+u[1]}return n}function Qo(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 $o(t){if(t.length<3)return Wo(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\",ts(ns,o),\",\",ts(ns,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),is(l,o,s);return t.pop(),l.push(\"L\",n),l.join(\"\")}function ts(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Yo.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var es=[0,2/3,1/3,0],rs=[0,1/3,2/3,0],ns=[0,1/6,2/3,1/6];function is(t,e,r){t.push(\"C\",ts(es,e),\",\",ts(es,r),\",\",ts(rs,e),\",\",ts(rs,r),\",\",ts(ns,e),\",\",ts(ns,r))}function as(t,e){return(e[1]-t[1])/(e[0]-t[0])}function os(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-Ct,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function ss(t){var e=ri,r=ri,n=0,i=ni,a=Yr,o=Wo,s=o.key,l=o,c=\"L\",u=.7;function f(s){var f,h,p,d=[],g=[],m=[],v=-1,y=s.length,x=de(e),b=de(n),_=e===r?function(){return h}:de(r),w=n===i?function(){return p}:de(i);function T(){d.push(\"M\",o(t(m),u),c,l(t(g.reverse()),u),\"Z\")}for(;++v<y;)a.call(this,f=s[v],v)?(g.push([h=+x.call(this,f,v),p=+b.call(this,f,v)]),m.push([+_.call(this,f,v),+w.call(this,f,v)])):g.length&&(T(),g=[],m=[]);return g.length&&T(),d.length?d.join(\"\"):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=i=t,f):i},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(i=t,f):i},f.defined=function(t){return arguments.length?(a=t,f):a},f.interpolate=function(t){return arguments.length?(s=\"function\"==typeof t?o=t:(o=Yo.get(t)||Wo).key,l=o.reverse||o,c=o.closed?\"M\":\"L\",f):s},f.tension=function(t){return arguments.length?(u=t,f):u},f}function ls(t){return t.radius}function cs(t){return[t.x,t.y]}function us(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Ct;return[r*Math.cos(n),r*Math.sin(n)]}}function fs(){return 64}function hs(){return\"circle\"}function ps(t){var e=Math.sqrt(t/At);return\"M0,\"+e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+-e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+e+\"Z\"}t.svg.line.radial=function(){var t=Go(os);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Zo.reverse=Jo,Jo.reverse=Zo,t.svg.area=function(){return ss(L)},t.svg.area.radial=function(){var t=ss(os);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},t.svg.chord=function(){var t=Vn,e=qn,r=ls,n=jo,i=Uo;function a(r,n){var i,a,c=o(this,t,r,n),u=o(this,e,r,n);return\"M\"+c.p0+s(c.r,c.p1,c.a1-c.a0)+(a=u,((i=c).a0==a.a0&&i.a1==a.a1?l(c.r,c.p1,c.r,c.p0):l(c.r,c.p1,u.r,u.p0)+s(u.r,u.p1,u.a1-u.a0)+l(u.r,u.p1,c.r,c.p0))+\"Z\")}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),c=n.call(t,s,o)-Ct,u=i.call(t,s,o)-Ct;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(t,e,r){return\"A\"+t+\",\"+t+\" 0 \"+ +(r>At)+\",1 \"+e}function l(t,e,r,n){return\"Q 0,0 \"+n}return a.radius=function(t){return arguments.length?(r=de(t),a):r},a.source=function(e){return arguments.length?(t=de(e),a):t},a.target=function(t){return arguments.length?(e=de(t),a):e},a.startAngle=function(t){return arguments.length?(n=de(t),a):n},a.endAngle=function(t){return arguments.length?(i=de(t),a):i},a},t.svg.diagonal=function(){var t=Vn,e=qn,r=cs;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return\"M\"+(l=l.map(r))[0]+\"C\"+l[1]+\" \"+l[2]+\" \"+l[3]}return n.source=function(e){return arguments.length?(t=de(e),n):t},n.target=function(t){return arguments.length?(e=de(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=cs,n=e.projection;return e.projection=function(t){return arguments.length?n(us(r=t)):r},e},t.svg.symbol=function(){var t=hs,e=fs;function r(r,n){return(ds.get(t.call(this,r,n))||ps)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=de(e),r):t},r.size=function(t){return arguments.length?(e=de(t),r):e},r};var ds=t.map({circle:ps,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*ms)),r=e*ms;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/gs),r=e*gs/2;return\"M0,\"+r+\"L\"+e+\",\"+-r+\" \"+-e+\",\"+-r+\"Z\"},\"triangle-up\":function(t){var e=Math.sqrt(t/gs),r=e*gs/2;return\"M0,\"+-r+\"L\"+e+\",\"+r+\" \"+-e+\",\"+r+\"Z\"}});t.svg.symbolTypes=ds.keys();var gs=Math.sqrt(3),ms=Math.tan(30*Lt);Y.transition=function(t){for(var e,r,n=bs||++Ts,i=As(t),a=[],o=_s||{time:Date.now(),ease:ca,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(r=c[u])&&Ss(r,u,i,n,o),e.push(r)}return xs(a,i,n)},Y.interrupt=function(t){return this.each(null==t?vs:ys(As(t)))};var vs=ys(As());function ys(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function xs(t,e,r){return U(t,ws),t.namespace=e,t.id=r,t}var bs,_s,ws=[],Ts=0;function ks(t,e,r,n){var i=t.id,a=t.namespace;return ut(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 Ms(t){return null==t&&(t=\"\"),function(){this.textContent=t}}function As(t){return null==t?\"__transition__\":\"__transition_\"+t+\"__\"}function Ss(t,e,r,n,i){var a,o,s,l,c,u=t[r]||(t[r]={active:0,count:0}),f=u[n];function h(r){var i=u.active,h=u[i];for(var d in h&&(h.timer.c=null,h.timer.t=NaN,--u.count,delete u[i],h.event&&h.event.interrupt.call(t,t.__data__,h.index)),u)if(+d<n){var g=u[d];g.timer.c=null,g.timer.t=NaN,--u.count,delete u[d]}o.c=p,we((function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1}),0,a),u.active=n,f.event&&f.event.start.call(t,t.__data__,e),c=[],f.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)})),l=f.ease,s=f.duration}function p(i){for(var a=i/s,o=l(a),h=c.length;h>0;)c[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(a=i.time,o=we((function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h}),0,a),f=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}ws.call=Y.call,ws.empty=Y.empty,ws.node=Y.node,ws.size=Y.size,t.transition=function(e,r){return e&&e.transition?bs?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ws,ws.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var c=this[s],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,s))?(\"__data__\"in n&&(r.__data__=n.__data__),Ss(r,u,a,i,n[a][i]),e.push(r)):e.push(null)}return xs(o,a,i)},ws.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=X(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],h=-1,p=f.length;++h<p;)if(n=f[h]){a=n[s][o],r=t.call(n,n.__data__,h,c),l.push(e=[]);for(var d=-1,g=r.length;++d<g;)(i=r[d])&&Ss(i,d,s,o,a),e.push(i)}return xs(l,s,o)},ws.filter=function(t){var e,r,n=[];\"function\"!=typeof t&&(t=lt(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return xs(n,this.namespace,this.id)},ws.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ut(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},ws.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n=\"transform\"==e?ba:$i,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}function s(t){return null==t?a:(t+=\"\",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})}function l(t){return null==t?o:(t+=\"\",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}return ks(this,\"attr.\"+e,r,i.local?l:s)},ws.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween(\"attr.\"+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},ws.style=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){for(r in n<2&&(e=\"\"),t)this.style(r,t[r],e);return this}r=\"\"}function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+=\"\",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=$i(i,e),function(e){this.style.setProperty(t,n(e),r)})})}return ks(this,\"style.\"+t,e,a)},ws.styleTween=function(t,e,r){function n(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}}return arguments.length<3&&(r=\"\"),this.tween(\"style.\"+t,n)},ws.text=function(t){return ks(this,\"text\",t,Ms)},ws.remove=function(){var t=this.namespace;return this.each(\"end.transition\",(function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)}))},ws.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:(\"function\"!=typeof e&&(e=t.ease.apply(t,arguments)),ut(this,(function(t){t[n][r].ease=e})))},ws.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ut(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}))},ws.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ut(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}))},ws.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=_s,o=bs;try{bs=n,ut(this,(function(t,r,a){_s=t[i][n],e.call(t,t.__data__,r,a)}))}finally{_s=a,bs=o}}else ut(this,(function(a){var o=a[i][n];(o.event||(o.event=t.dispatch(\"start\",\"end\",\"interrupt\"))).on(e,r)}));return this},ws.transition=function(){for(var t,e,r,n=this.id,i=++Ts,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var c,u=0,f=(c=this[s]).length;u<f;u++)(e=c[u])&&Ss(e,u,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return xs(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=Es,a=6,o=6,s=3,l=[10],c=null;function u(n){n.each((function(){var n,u=t.select(this),f=this.__chart__||r,h=this.__chart__=r.copy(),p=null==c?h.ticks?h.ticks.apply(h,l):h.domain():c,d=null==e?h.tickFormat?h.tickFormat.apply(h,l):L:e,g=u.selectAll(\".tick\").data(p,h),m=g.enter().insert(\"g\",\".domain\").attr(\"class\",\"tick\").style(\"opacity\",kt),v=t.transition(g.exit()).style(\"opacity\",kt).remove(),y=t.transition(g.order()).style(\"opacity\",1),x=Math.max(a,0)+s,b=mo(h),_=u.selectAll(\".domain\").data([0]),w=(_.enter().append(\"path\").attr(\"class\",\"domain\"),t.transition(_));m.append(\"line\"),m.append(\"text\");var T,k,M,A,S=m.select(\"line\"),E=y.select(\"line\"),C=g.select(\"text\").text(d),I=m.select(\"text\"),P=y.select(\"text\"),z=\"top\"===i||\"left\"===i?-1:1;if(\"bottom\"===i||\"top\"===i?(n=Ls,T=\"x\",M=\"y\",k=\"x2\",A=\"y2\",C.attr(\"dy\",z<0?\"0em\":\".71em\").style(\"text-anchor\",\"middle\"),w.attr(\"d\",\"M\"+b[0]+\",\"+z*o+\"V0H\"+b[1]+\"V\"+z*o)):(n=Is,T=\"y\",M=\"x\",k=\"y2\",A=\"x2\",C.attr(\"dy\",\".32em\").style(\"text-anchor\",z<0?\"end\":\"start\"),w.attr(\"d\",\"M\"+z*o+\",\"+b[0]+\"H0V\"+b[1]+\"H\"+z*o)),S.attr(A,z*a),I.attr(M,z*x),E.attr(k,0).attr(A,z*a),P.attr(T,0).attr(M,z*x),h.rangeBand){var O=h,D=O.rangeBand()/2;f=h=function(t){return O(t)+D}}else f.rangeBand?f=h:v.call(n,h,f);m.call(n,f,h),y.call(n,h,h)}))}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(i=t in Cs?t+\"\":Es,u):i},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],u):a},u.innerTickSize=function(t){return arguments.length?(a=+t,u):a},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(s=+t,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var Es=\"bottom\",Cs={top:1,right:1,bottom:1,left:1};function Ls(t,e,r){t.attr(\"transform\",(function(t){var n=e(t);return\"translate(\"+(isFinite(n)?n:r(t))+\",0)\"}))}function Is(t,e,r){t.attr(\"transform\",(function(t){var n=e(t);return\"translate(0,\"+(isFinite(n)?n:r(t))+\")\"}))}t.svg.brush=function(){var e,r,n=N(h,\"brushstart\",\"brush\",\"brushend\"),i=null,a=null,s=[0,0],l=[0,0],c=!0,u=!0,f=zs[0];function h(e){e.each((function(){var e=t.select(this).style(\"pointer-events\",\"all\").style(\"-webkit-tap-highlight-color\",\"rgba(0,0,0,0)\").on(\"mousedown.brush\",m).on(\"touchstart.brush\",m),r=e.selectAll(\".background\").data([0]);r.enter().append(\"rect\").attr(\"class\",\"background\").style(\"visibility\",\"hidden\").style(\"cursor\",\"crosshair\"),e.selectAll(\".extent\").data([0]).enter().append(\"rect\").attr(\"class\",\"extent\").style(\"cursor\",\"move\");var n=e.selectAll(\".resize\").data(f,L);n.exit().remove(),n.enter().append(\"g\").attr(\"class\",(function(t){return\"resize \"+t})).style(\"cursor\",(function(t){return Ps[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\"),n.style(\"display\",h.empty()?\"none\":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=mo(i),l.attr(\"x\",o[0]).attr(\"width\",o[1]-o[0]),d(s)),a&&(o=mo(a),l.attr(\"y\",o[0]).attr(\"height\",o[1]-o[0]),g(s)),p(s)}))}function p(t){t.selectAll(\".resize\").attr(\"transform\",(function(t){return\"translate(\"+s[+/e$/.test(t)]+\",\"+l[+/^s/.test(t)]+\")\"}))}function d(t){t.select(\".extent\").attr(\"x\",s[0]),t.selectAll(\".extent,.n>rect,.s>rect\").attr(\"width\",s[1]-s[0])}function g(t){t.select(\".extent\").attr(\"y\",l[0]),t.selectAll(\".extent,.e>rect,.w>rect\").attr(\"height\",l[1]-l[0])}function m(){var f,m,v=this,y=t.select(t.event.target),x=n.of(v,arguments),b=t.select(v),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,T=!/^(e|w)$/.test(_)&&a,k=y.classed(\"extent\"),M=bt(v),A=t.mouse(v),S=t.select(o(v)).on(\"keydown.brush\",L).on(\"keyup.brush\",I);if(t.event.changedTouches?S.on(\"touchmove.brush\",P).on(\"touchend.brush\",O):S.on(\"mousemove.brush\",P).on(\"mouseup.brush\",O),b.interrupt().selectAll(\"*\").interrupt(),k)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(_){var E=+/w$/.test(_),C=+/^n/.test(_);m=[s[1-E]-A[0],l[1-C]-A[1]],A[0]=s[E],A[1]=l[C]}else t.event.altKey&&(f=A.slice());function L(){32==t.event.keyCode&&(k||(f=null,A[0]-=s[1],A[1]-=l[1],k=2),F())}function I(){32==t.event.keyCode&&2==k&&(A[0]+=s[1],A[1]+=l[1],k=0,F())}function P(){var e=t.mouse(v),r=!1;m&&(e[0]+=m[0],e[1]+=m[1]),k||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(e[0]<f[0])],A[1]=l[+(e[1]<f[1])]):f=null),w&&z(e,i,0)&&(d(b),r=!0),T&&z(e,a,1)&&(g(b),r=!0),r&&(p(b),x({type:\"brush\",mode:k?\"move\":\"resize\"}))}function z(t,n,i){var a,o,h=mo(n),p=h[0],d=h[1],g=A[i],m=i?l:s,v=m[1]-m[0];if(k&&(p-=g,d-=v+g),a=(i?u:c)?Math.max(p,Math.min(d,t[i])):t[i],k?o=(a+=g)+v:(f&&(g=Math.max(p,Math.min(d,2*f[i]-a))),g<a?(o=a,a=g):o=g),m[0]!=a||m[1]!=o)return i?r=null:e=null,m[0]=a,m[1]=o,!0}function O(){P(),b.style(\"pointer-events\",\"all\").selectAll(\".resize\").style(\"display\",h.empty()?\"none\":null),t.select(\"body\").style(\"cursor\",null),S.on(\"mousemove.brush\",null).on(\"mouseup.brush\",null).on(\"touchmove.brush\",null).on(\"touchend.brush\",null).on(\"keydown.brush\",null).on(\"keyup.brush\",null),M(),x({type:\"brushend\"})}b.style(\"pointer-events\",\"none\").selectAll(\".resize\").style(\"display\",null),t.select(\"body\").style(\"cursor\",y.style(\"cursor\")),x({type:\"brushstart\"}),P()}return h.event=function(i){i.each((function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,bs?t.select(this).transition().each(\"start.brush\",(function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:\"brushstart\"})})).tween(\"brush:brush\",(function(){var t=ta(s,a.x),n=ta(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:\"brush\",mode:\"resize\"})}})).each(\"end.brush\",(function(){e=a.i,r=a.j,i({type:\"brush\",mode:\"resize\"}),i({type:\"brushend\"})})):(i({type:\"brushstart\"}),i({type:\"brush\",mode:\"resize\"}),i({type:\"brushend\"}))}))},h.x=function(t){return arguments.length?(f=zs[!(i=t)<<1|!a],h):i},h.y=function(t){return arguments.length?(f=zs[!i<<1|!(a=t)],h):a},h.clamp=function(t){return arguments.length?(i&&a?(c=!!t[0],u=!!t[1]):i?c=!!t:a&&(u=!!t),h):i&&a?[c,u]:i?c:a?u:null},h.extent=function(t){var n,o,c,u,f;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(f=n,n=o,o=f),n==s[0]&&o==s[1]||(s=[n,o])),a&&(c=t[0],u=t[1],i&&(c=c[1],u=u[1]),r=[c,u],a.invert&&(c=a(c),u=a(u)),u<c&&(f=c,c=u,u=f),c==l[0]&&u==l[1]||(l=[c,u])),h):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(f=n,n=o,o=f))),a&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],a.invert&&(c=a.invert(c),u=a.invert(u)),u<c&&(f=c,c=u,u=f))),i&&a?[[n,c],[o,u]]:i?[n,o]:a&&[c,u])},h.clear=function(){return h.empty()||(s=[0,0],l=[0,0],e=r=null),h},h.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(h,n,\"on\")};var Ps={n:\"ns-resize\",e:\"ew-resize\",s:\"ns-resize\",w:\"ew-resize\",nw:\"nwse-resize\",ne:\"nesw-resize\",se:\"nwse-resize\",sw:\"nesw-resize\"},zs=[[\"n\",\"e\",\"s\",\"w\",\"nw\",\"ne\",\"se\",\"sw\"],[\"e\",\"w\"],[\"n\",\"s\"],[]],Os=Pe.format=sr.timeFormat,Ds=Os.utc,Rs=Ds(\"%Y-%m-%dT%H:%M:%S.%LZ\");function Fs(t){return t.toISOString()}function Bs(e,r,n){function i(t){return e(t)}function a(e,n){var i=(e[1]-e[0])/n,a=t.bisect(js,i);return a==js.length?[r.year,ko(e.map((function(t){return t/31536e6})),n)[2]]:a?r[i/js[a-1]<js[a]/i?a-1:a]:[qs,ko(e,n)[2]]}return i.invert=function(t){return Ns(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain().map(Ns)},i.nice=function(t,e){var r=i.domain(),n=go(r),o=null==t?a(n,10):\"number\"==typeof t&&a(n,t);function s(r){return!isNaN(r)&&!t.range(r,Ns(+r+1),e).length}return o&&(t=o[0],e=o[1]),i.domain(yo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Ns(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ns(+e+1);return e}}:t))},i.ticks=function(t,e){var r=go(i.domain()),n=null==t?a(r,10):\"number\"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ns(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Bs(e.copy(),r,n)},wo(i,e)}function Ns(t){return new Date(t)}Os.iso=Date.prototype.toISOString&&+new Date(\"2000-01-01T00:00:00.000Z\")?Fs:Rs,Fs.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Fs.toString=Rs.toString,Pe.second=Re((function(t){return new ze(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),Pe.seconds=Pe.second.range,Pe.seconds.utc=Pe.second.utc.range,Pe.minute=Re((function(t){return new ze(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),Pe.minutes=Pe.minute.range,Pe.minutes.utc=Pe.minute.utc.range,Pe.hour=Re((function(t){var e=t.getTimezoneOffset()/60;return new ze(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),Pe.hours=Pe.hour.range,Pe.hours.utc=Pe.hour.utc.range,Pe.month=Re((function(t){return(t=Pe.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),Pe.months=Pe.month.range,Pe.months.utc=Pe.month.utc.range;var js=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Us=[[Pe.second,1],[Pe.second,5],[Pe.second,15],[Pe.second,30],[Pe.minute,1],[Pe.minute,5],[Pe.minute,15],[Pe.minute,30],[Pe.hour,1],[Pe.hour,3],[Pe.hour,6],[Pe.hour,12],[Pe.day,1],[Pe.day,2],[Pe.week,1],[Pe.month,1],[Pe.month,3],[Pe.year,1]],Vs=Os.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\",Yr]]),qs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ns)},floor:L,ceil:L};Us.year=Pe.year,Pe.scale=function(){return Bs(t.scale.linear(),Us,Vs)};var Hs=Us.map((function(t){return[t[0].utc,t[1]]})),Gs=Ds.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\",Yr]]);function Ys(t){return JSON.parse(t.responseText)}function Ws(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Hs.year=Pe.year.utc,Pe.scale.utc=function(){return Bs(t.scale.linear(),Hs,Gs)},t.text=ge((function(t){return t.responseText})),t.json=function(t,e){return me(t,\"application/json\",Ys,e)},t.html=function(t,e){return me(t,\"text/html\",Ws,e)},t.xml=ge((function(t){return t.responseXML})),\"object\"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],170:[function(t,e,r){e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},{}],171:[function(t,e,r){\"use strict\";var n=t(\"incremental-convex-hull\"),i=t(\"uniq\");function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}e.exports=function(t,e){var r=t.length;if(0===r)return[];var s=t[0].length;if(s<1)return[];if(1===s)return function(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;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}r&&i.push([-1,i[0][1]],[i[t-1][1],-1]);return i}(r,t,e);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var f=t[u],h=new Array(s+1),p=0,d=0;d<s;++d){var g=f[d];h[d]=g,p+=g*g}h[s]=p,l[u]=new a(h,u),c=Math.max(p,c)}i(l,o),r=l.length;var m=new Array(r+s+1),v=new Array(r+s+1),y=(s+1)*(s+1)*c,x=new Array(s+1);for(u=0;u<=s;++u)x[u]=0;x[s]=y,m[0]=x.slice(),v[0]=-1;for(u=0;u<=s;++u){(h=x.slice())[u]=1,m[u+1]=h,v[u+1]=-1}for(u=0;u<r;++u){var b=l[u];m[u+s+1]=b.point,v[u+s+1]=b.index}var _=n(m,!1);_=e?_.filter((function(t){for(var e=0,r=0;r<=s;++r){var n=v[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(u=0;u<_.length;++u){h=(b=_[u])[0];b[0]=b[1],b[1]=h}return _}},{\"incremental-convex-hull\":459,uniq:597}],172:[function(t,e,r){\"use strict\";e.exports=a;var n=(a.canvas=document.createElement(\"canvas\")).getContext(\"2d\"),i=o([32,126]);function a(t,e){Array.isArray(t)&&(t=t.join(\", \"));var r,a={},s=16,l=.05;e&&(2===e.length&&\"number\"==typeof e[0]?r=o(e):Array.isArray(e)?r=e:(e.o?r=o(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=i),n.font=s+\"px \"+t;for(var c=0;c<r.length;c++){var u=r[c],f=n.measureText(u[0]).width+n.measureText(u[1]).width,h=n.measureText(u).width;if(Math.abs(f-h)>s*l){var p=(h-f)/s;a[u]=1e3*p}}return a}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i<t[1];i++){var a=n+String.fromCharCode(i);e.push(a)}return e}a.createPairs=o,a.ascii=i},{}],173:[function(t,e,r){(function(t){(function(){var r=!1;if(\"undefined\"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t(\"buffer\").Buffer)},{buffer:111}],174:[function(t,e,r){var n=t(\"abs-svg-path\"),i=t(\"normalize-svg-path\"),a={M:\"moveTo\",C:\"bezierCurveTo\"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)})),t.closePath()}},{\"abs-svg-path\":65,\"normalize-svg-path\":497}],175:[function(t,e,r){e.exports=function(t){switch(t){case\"int8\":return Int8Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"uint8\":return Uint8Array;case\"uint16\":return Uint16Array;case\"uint32\":return Uint32Array;case\"float32\":return Float32Array;case\"float64\":return Float64Array;case\"array\":return Array;case\"uint8_clamped\":return Uint8ClampedArray}}},{}],176:[function(t,e,r){\"use strict\";e.exports=function(t,e){switch(\"undefined\"==typeof e&&(e=0),typeof t){case\"number\":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case\"object\":if(\"number\"==typeof t.length)return function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a<i;++a)o[a]=r;else for(a=0;a<i;++a)o[a]=t(e,r,n+1);return o}(t,e,0)}return[]}},{}],177:[function(t,e,r){\"use strict\";function n(t,e,r){r=r||2;var n,s,l,c,u,p,d,m=e&&e.length,v=m?e[0]*r:t.length,y=i(t,0,v,r,!0),x=[];if(!y||y.next===y.prev)return x;if(m&&(y=function(t,e,r,n){var o,s,l,c,u,p=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,c=o<s-1?e[o+1]*n:t.length,(u=i(t,l,c,n,!1))===u.next&&(u.steiner=!0),p.push(g(u));for(p.sort(f),o=0;o<p.length;o++)h(p[o],r),r=a(r,r.next);return r}(t,e,y,r)),t.length>80*r){n=l=t[0],s=c=t[1];for(var b=r;b<v;b+=r)(u=t[b])<n&&(n=u),(p=t[b+1])<s&&(s=p),u>l&&(l=u),p>c&&(c=p);d=0!==(d=Math.max(l-n,c-s))?1/d:0}return o(y,x,r,n,s,d),x}function i(t,e,r,n,i){var a,o;if(i===E(t,e,r,n)>0)for(a=e;a<r;a+=n)o=M(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=M(a,t[a],t[a+1],o);return o&&x(o,o.next)&&(A(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!x(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,f,h){if(t){!h&&f&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=d(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,f);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,f?l(t,n,i,f):s(t))e.push(p.i/r),e.push(t.i/r),e.push(g.i/r),A(t),t=g.next,m=g.next;else if((t=g)===m){h?1===h?o(t=c(a(t),e,r),e,r,n,i,f,2):2===h&&u(t,e,r,n,i,f):o(a(t),e,r,n,i,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(m(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&y(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(y(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(s,l,e,r,n),h=d(c,u,e,r,n),p=t.prevZ,g=t.nextZ;p&&p.z>=f&&g&&g.z<=h;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==t.prev&&g!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=h;){if(g!==t.prev&&g!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!x(i,o)&&b(i,n,n.next,o)&&T(i,o)&&T(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),A(n),A(n.next),n=t=o),n=n.next}while(n!==t);return a(n)}function u(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&v(l,c)){var u=k(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r;var l,c=r,u=r.x,f=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&m(a<f?i:o,a,u,f,a<f?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),T(n,t)&&(l<h||l===h&&(n.x>r.x||n.x===r.x&&p(r,n)))&&(r=n,h=l)),n=n.next}while(n!==c);return r}(t,e)){var r=k(e,t);a(e,e.next),a(r,r.next)}}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function m(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||x(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,n){var i=w(y(t,e,r)),a=w(y(t,e,n)),o=w(y(r,n,t)),s=w(y(r,n,e));return i!==a&&o!==s||(!(0!==i||!_(t,r,e))||(!(0!==a||!_(t,n,e))||(!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n)))))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function T(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function k(t,e){var r=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function M(t,e,r,n){var i=new S(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}e.exports=n,e.exports.default=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(E(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(E(t,c,u,r))}var f=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,p=n[s+1]*r,d=n[s+2]*r;f+=Math.abs((t[h]-t[d])*(t[p+1]-t[h+1])-(t[h]-t[p])*(t[d+1]-t[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],178:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=t.length;if(\"number\"!=typeof e){e=0;for(var i=0;i<r;++i){var a=t[i];e=Math.max(e,a[0],a[1])}e=1+(0|e)}e|=0;var o=new Array(e);for(i=0;i<e;++i)o[i]=[];for(i=0;i<r;++i){a=t[i];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;s<e;++s)n(o[s],(function(t,e){return t-e}));return o};var n=t(\"uniq\")},{uniq:597}],179:[function(t,e,r){var n=t(\"strongly-connected-components\");e.exports=function(t,e){var r,i=[],a=[],o=[],s={},l=[];function c(t){var e,n,i=!1;for(a.push(t),o[t]=!0,e=0;e<l[t].length;e++)(n=l[t][e])===r?(u(r,a),i=!0):o[n]||(i=c(n));if(i)!function t(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(r){delete s[e][r],o[r]&&t(r)}))}(t);else for(e=0;e<l[t].length;e++){n=l[t][e];var f=s[n];f||(f={},s[n]=f),f[n]=!0}return a.pop(),i}function u(t,r){var n=[].concat(r).concat(t);e?e(c):i.push(n)}function f(e){!function(e){for(var r=0;r<t.length;r++)r<e&&(t[r]=[]),t[r]=t[r].filter((function(t){return t>=e}))}(e);for(var r,i=n(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o<i.length;o++)for(var s=0;s<i[o].length;s++)i[o][s]<a&&(a=i[o][s],r=o);var l=i[r];return!!l&&{leastVertex:a,adjList:t.map((function(t,e){return-1===l.indexOf(e)?[]:t.filter((function(t){return-1!==l.indexOf(t)}))}))}}r=0;for(var h=t.length;r<h;){var p=f(r);if(r=p.leastVertex,l=p.adjList){for(var d=0;d<l.length;d++)for(var g=0;g<l[d].length;g++){var m=l[d][g];o[+m]=!1,s[m]={}}c(r),r+=1}else r=h}return e?void 0:i}},{\"strongly-connected-components\":569}],180:[function(t,e,r){\"use strict\";var n=t(\"../../object/valid-value\");e.exports=function(){return n(this).length=0,this}},{\"../../object/valid-value\":211}],181:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?Array.from:t(\"./shim\")},{\"./is-implemented\":182,\"./shim\":183}],182:[function(t,e,r){\"use strict\";e.exports=function(){var t,e,r=Array.from;return\"function\"==typeof r&&(e=r(t=[\"raz\",\"dwa\"]),Boolean(e&&e!==t&&\"dwa\"===e[1]))}},{}],183:[function(t,e,r){\"use strict\";var n=t(\"es6-symbol\").iterator,i=t(\"../../function/is-arguments\"),a=t(\"../../function/is-function\"),o=t(\"../../number/to-pos-integer\"),s=t(\"../../object/valid-callable\"),l=t(\"../../object/valid-value\"),c=t(\"../../object/is-value\"),u=t(\"../../string/is-string\"),f=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(t){var e,r,g,m,v,y,x,b,_,w,T=arguments[1],k=arguments[2];if(t=Object(l(t)),c(T)&&s(T),this&&this!==Array&&a(this))e=this;else{if(!T){if(i(t))return 1!==(v=t.length)?Array.apply(null,t):((m=new Array(1))[0]=t[0],m);if(f(t)){for(m=new Array(v=t.length),r=0;r<v;++r)m[r]=t[r];return m}}m=[]}if(!f(t))if(void 0!==(_=t[n])){for(x=s(_).call(t),e&&(m=new e),b=x.next(),r=0;!b.done;)w=T?h.call(T,k,b.value,r):b.value,e?(p.value=w,d(m,r,p)):m[r]=w,b=x.next(),++r;v=r}else if(u(t)){for(v=t.length,e&&(m=new e),r=0,g=0;r<v;++r)w=t[r],r+1<v&&(y=w.charCodeAt(0))>=55296&&y<=56319&&(w+=t[++r]),w=T?h.call(T,k,w,g):w,e?(p.value=w,d(m,g,p)):m[g]=w,++g;v=g}if(void 0===v)for(v=o(t.length),e&&(m=new e(v)),r=0;r<v;++r)w=T?h.call(T,k,t[r],r):t[r],e?(p.value=w,d(m,r,p)):m[r]=w;return e&&(p.value=null,m.length=v),m}},{\"../../function/is-arguments\":184,\"../../function/is-function\":185,\"../../number/to-pos-integer\":191,\"../../object/is-value\":200,\"../../object/valid-callable\":209,\"../../object/valid-value\":211,\"../../string/is-string\":215,\"es6-symbol\":225}],184:[function(t,e,r){\"use strict\";var n=Object.prototype.toString,i=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===i}},{}],185:[function(t,e,r){\"use strict\";var n=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return\"function\"==typeof t&&i(n.call(t))}},{}],186:[function(t,e,r){\"use strict\";e.exports=function(){}},{}],187:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?Math.sign:t(\"./shim\")},{\"./is-implemented\":188,\"./shim\":189}],188:[function(t,e,r){\"use strict\";e.exports=function(){var t=Math.sign;return\"function\"==typeof t&&(1===t(10)&&-1===t(-20))}},{}],189:[function(t,e,r){\"use strict\";e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},{}],190:[function(t,e,r){\"use strict\";var n=t(\"../math/sign\"),i=Math.abs,a=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*a(i(t)):t}},{\"../math/sign\":187}],191:[function(t,e,r){\"use strict\";var n=t(\"./to-integer\"),i=Math.max;e.exports=function(t){return i(0,n(t))}},{\"./to-integer\":190}],192:[function(t,e,r){\"use strict\";var n=t(\"./valid-callable\"),i=t(\"./valid-value\"),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,c){var u,f=arguments[2],h=arguments[3];return r=Object(i(r)),n(c),u=s(r),h&&u.sort(\"function\"==typeof h?a.call(h,r):void 0),\"function\"!=typeof t&&(t=u[t]),o.call(t,u,(function(t,n){return l.call(r,t)?o.call(c,f,r[t],t,r,n):e}))}}},{\"./valid-callable\":209,\"./valid-value\":211}],193:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?Object.assign:t(\"./shim\")},{\"./is-implemented\":194,\"./shim\":195}],194:[function(t,e,r){\"use strict\";e.exports=function(){var t,e=Object.assign;return\"function\"==typeof e&&(e(t={foo:\"raz\"},{bar:\"dwa\"},{trzy:\"trzy\"}),t.foo+t.bar+t.trzy===\"razdwatrzy\")}},{}],195:[function(t,e,r){\"use strict\";var n=t(\"../keys\"),i=t(\"../valid-value\"),a=Math.max;e.exports=function(t,e){var r,o,s,l=a(arguments.length,2);for(t=Object(i(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o<l;++o)n(e=arguments[o]).forEach(s);if(void 0!==r)throw r;return t}},{\"../keys\":201,\"../valid-value\":211}],196:[function(t,e,r){\"use strict\";var n=t(\"../array/from\"),i=t(\"./assign\"),a=t(\"./valid-value\");e.exports=function(t){var e=Object(a(t)),r=arguments[1],o=Object(arguments[2]);if(e!==t&&!r)return e;var s={};return r?n(r,(function(e){(o.ensure||e in t)&&(s[e]=t[e])})):i(s,t),s}},{\"../array/from\":181,\"./assign\":193,\"./valid-value\":211}],197:[function(t,e,r){\"use strict\";var n,i,a,o,s=Object.create;t(\"./set-prototype-of/is-implemented\")()||(n=t(\"./set-prototype-of/shim\")),e.exports=n?1!==n.level?s:(i={},a={},o={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){a[t]=\"__proto__\"!==t?o:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(i,a),Object.defineProperty(n,\"nullPolyfill\",{configurable:!1,enumerable:!1,writable:!1,value:i}),function(t,e){return s(null===t?i:t,e)}):s},{\"./set-prototype-of/is-implemented\":207,\"./set-prototype-of/shim\":208}],198:[function(t,e,r){\"use strict\";e.exports=t(\"./_iterate\")(\"forEach\")},{\"./_iterate\":192}],199:[function(t,e,r){\"use strict\";var n=t(\"./is-value\"),i={function:!0,object:!0};e.exports=function(t){return n(t)&&i[typeof t]||!1}},{\"./is-value\":200}],200:[function(t,e,r){\"use strict\";var n=t(\"../function/noop\")();e.exports=function(t){return t!==n&&null!==t}},{\"../function/noop\":186}],201:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?Object.keys:t(\"./shim\")},{\"./is-implemented\":202,\"./shim\":203}],202:[function(t,e,r){\"use strict\";e.exports=function(){try{return Object.keys(\"primitive\"),!0}catch(t){return!1}}},{}],203:[function(t,e,r){\"use strict\";var n=t(\"../is-value\"),i=Object.keys;e.exports=function(t){return i(n(t)?Object(t):t)}},{\"../is-value\":200}],204:[function(t,e,r){\"use strict\";var n=t(\"./valid-callable\"),i=t(\"./for-each\"),a=Function.prototype.call;e.exports=function(t,e){var r={},o=arguments[2];return n(e),i(t,(function(t,n,i,s){r[n]=a.call(e,o,t,n,i,s)})),r}},{\"./for-each\":198,\"./valid-callable\":209}],205:[function(t,e,r){\"use strict\";var n=t(\"./is-value\"),i=Array.prototype.forEach,a=Object.create,o=function(t,e){var r;for(r in t)e[r]=t[r]};e.exports=function(t){var e=a(null);return i.call(arguments,(function(t){n(t)&&o(Object(t),e)})),e}},{\"./is-value\":200}],206:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?Object.setPrototypeOf:t(\"./shim\")},{\"./is-implemented\":207,\"./shim\":208}],207:[function(t,e,r){\"use strict\";var n=Object.create,i=Object.getPrototypeOf,a={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return\"function\"==typeof t&&i(t(e(null),a))===a}},{}],208:[function(t,e,r){\"use strict\";var n,i=t(\"../is-object\"),a=t(\"../valid-value\"),o=Object.prototype.isPrototypeOf,s=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(a(t),null===e||i(e))return t;throw new TypeError(\"Prototype must be null or an object\")},e.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var i;return n(e,r),(i=o.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,i&&s(t.nullPolyfill,\"__proto__\",l),e},Object.defineProperty(e,\"level\",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,\"__proto__\");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),t(\"../create\")},{\"../create\":197,\"../is-object\":199,\"../valid-value\":211}],209:[function(t,e,r){\"use strict\";e.exports=function(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");return t}},{}],210:[function(t,e,r){\"use strict\";var n=t(\"./is-object\");e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not an Object\");return t}},{\"./is-object\":199}],211:[function(t,e,r){\"use strict\";var n=t(\"./is-value\");e.exports=function(t){if(!n(t))throw new TypeError(\"Cannot use null or undefined\");return t}},{\"./is-value\":200}],212:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?String.prototype.contains:t(\"./shim\")},{\"./is-implemented\":213,\"./shim\":214}],213:[function(t,e,r){\"use strict\";var n=\"razdwatrzy\";e.exports=function(){return\"function\"==typeof n.contains&&(!0===n.contains(\"dwa\")&&!1===n.contains(\"foo\"))}},{}],214:[function(t,e,r){\"use strict\";var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-1}},{}],215:[function(t,e,r){\"use strict\";var n=Object.prototype.toString,i=n.call(\"\");e.exports=function(t){return\"string\"==typeof t||t&&\"object\"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},{}],216:[function(t,e,r){\"use strict\";var n=Object.create(null),i=Math.random;e.exports=function(){var t;do{t=i().toString(36).slice(2)}while(n[t]);return t}},{}],217:[function(t,e,r){\"use strict\";var n,i=t(\"es5-ext/object/set-prototype-of\"),a=t(\"es5-ext/string/#/contains\"),o=t(\"d\"),s=t(\"es6-symbol\"),l=t(\"./\"),c=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");l.call(this,t),e=e?a.call(e,\"key+value\")?\"key+value\":a.call(e,\"key\")?\"key\":\"value\":\"value\",c(this,\"__kind__\",o(\"\",e))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return\"value\"===this.__kind__?this.__list__[t]:\"key+value\"===this.__kind__?[t,this.__list__[t]]:t}))}),c(n.prototype,s.toStringTag,o(\"c\",\"Array Iterator\"))},{\"./\":220,d:155,\"es5-ext/object/set-prototype-of\":206,\"es5-ext/string/#/contains\":212,\"es6-symbol\":225}],218:[function(t,e,r){\"use strict\";var n=t(\"es5-ext/function/is-arguments\"),i=t(\"es5-ext/object/valid-callable\"),a=t(\"es5-ext/string/is-string\"),o=t(\"./get\"),s=Array.isArray,l=Function.prototype.call,c=Array.prototype.some;e.exports=function(t,e){var r,u,f,h,p,d,g,m,v=arguments[2];if(s(t)||n(t)?r=\"array\":a(t)?r=\"string\":t=o(t),i(e),f=function(){h=!0},\"array\"!==r)if(\"string\"!==r)for(u=t.next();!u.done;){if(l.call(e,v,u.value,f),h)return;u=t.next()}else for(d=t.length,p=0;p<d&&(g=t[p],p+1<d&&(m=g.charCodeAt(0))>=55296&&m<=56319&&(g+=t[++p]),l.call(e,v,g,f),!h);++p);else c.call(t,(function(t){return l.call(e,v,t,f),h}))}},{\"./get\":219,\"es5-ext/function/is-arguments\":184,\"es5-ext/object/valid-callable\":209,\"es5-ext/string/is-string\":215}],219:[function(t,e,r){\"use strict\";var n=t(\"es5-ext/function/is-arguments\"),i=t(\"es5-ext/string/is-string\"),a=t(\"./array\"),o=t(\"./string\"),s=t(\"./valid-iterable\"),l=t(\"es6-symbol\").iterator;e.exports=function(t){return\"function\"==typeof s(t)[l]?t[l]():n(t)?new a(t):i(t)?new o(t):new a(t)}},{\"./array\":217,\"./string\":222,\"./valid-iterable\":223,\"es5-ext/function/is-arguments\":184,\"es5-ext/string/is-string\":215,\"es6-symbol\":225}],220:[function(t,e,r){\"use strict\";var n,i=t(\"es5-ext/array/#/clear\"),a=t(\"es5-ext/object/assign\"),o=t(\"es5-ext/object/valid-callable\"),s=t(\"es5-ext/object/valid-value\"),l=t(\"d\"),c=t(\"d/auto-bind\"),u=t(\"es6-symbol\"),f=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");h(this,{__list__:l(\"w\",s(t)),__context__:l(\"w\",e),__nextIndex__:l(\"w\",0)}),e&&(o(e.on),e.on(\"_add\",this._onAdd),e.on(\"_delete\",this._onDelete),e.on(\"_clear\",this._onClear))},delete n.prototype.constructor,h(n.prototype,a({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:l((function(){return this._createResult(this._next())})),_createResult:l((function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}})),_resolve:l((function(t){return this.__list__[t]})),_unBind:l((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off(\"_add\",this._onAdd),this.__context__.off(\"_delete\",this._onDelete),this.__context__.off(\"_clear\",this._onClear),this.__context__=null)})),toString:l((function(){return\"[object \"+(this[u.toStringTag]||\"Object\")+\"]\"}))},c({_onAdd:l((function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):f(this,\"__redo__\",l(\"c\",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,u.iterator,l((function(){return this})))},{d:155,\"d/auto-bind\":154,\"es5-ext/array/#/clear\":180,\"es5-ext/object/assign\":193,\"es5-ext/object/valid-callable\":209,\"es5-ext/object/valid-value\":211,\"es6-symbol\":225}],221:[function(t,e,r){\"use strict\";var n=t(\"es5-ext/function/is-arguments\"),i=t(\"es5-ext/object/is-value\"),a=t(\"es5-ext/string/is-string\"),o=t(\"es6-symbol\").iterator,s=Array.isArray;e.exports=function(t){return!!i(t)&&(!!s(t)||(!!a(t)||(!!n(t)||\"function\"==typeof t[o])))}},{\"es5-ext/function/is-arguments\":184,\"es5-ext/object/is-value\":200,\"es5-ext/string/is-string\":215,\"es6-symbol\":225}],222:[function(t,e,r){\"use strict\";var n,i=t(\"es5-ext/object/set-prototype-of\"),a=t(\"d\"),o=t(\"es6-symbol\"),s=t(\"./\"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");t=String(t),s.call(this,t),l(this,\"__length__\",a(\"\",t.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:a((function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,a(\"c\",\"String Iterator\"))},{\"./\":220,d:155,\"es5-ext/object/set-prototype-of\":206,\"es6-symbol\":225}],223:[function(t,e,r){\"use strict\";var n=t(\"./is-iterable\");e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not iterable\");return t}},{\"./is-iterable\":221}],224:[function(t,e,r){(function(n,i){(function(){\n",
"/*!\n",
" * @overview es6-promise - a tiny implementation of Promises/A+.\n",
" * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n",
" * @license Licensed under MIT license\n",
" * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n",
" * @version v4.2.8+1e68dce6\n",
" */\n",
"!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,(function(){\"use strict\";function e(t){return\"function\"==typeof t}var r=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)},a=0,o=void 0,s=void 0,l=function(t,e){g[a]=t,g[a+1]=e,2===(a+=2)&&(s?s(m):_())};var c=\"undefined\"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,h=\"undefined\"==typeof self&&\"undefined\"!=typeof n&&\"[object process]\"==={}.toString.call(n),p=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(m,1)}}var g=new Array(1e3);function m(){for(var t=0;t<a;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}a=0}var v,y,x,b,_=void 0;function w(t,e){var r=this,n=new this.constructor(M);void 0===n[k]&&D(n);var i=r._state;if(i){var a=arguments[i-1];l((function(){return z(i,n,a,r._result)}))}else I(r,n,t,e);return n}function T(t){if(t&&\"object\"==typeof t&&t.constructor===this)return t;var e=new this(M);return S(e,t),e}h?_=function(){return n.nextTick(m)}:f?(y=0,x=new f(m),b=document.createTextNode(\"\"),x.observe(b,{characterData:!0}),_=function(){b.data=y=++y%2}):p?((v=new MessageChannel).port1.onmessage=m,_=function(){return v.port2.postMessage(0)}):_=void 0===c&&\"function\"==typeof t?function(){try{var t=Function(\"return this\")().require(\"vertx\");return\"undefined\"!=typeof(o=t.runOnLoop||t.runOnContext)?function(){o(m)}:d()}catch(t){return d()}}():d();var k=Math.random().toString(36).substring(2);function M(){}function A(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===T?function(t,e){1===e._state?C(t,e._result):2===e._state?L(t,e._result):I(e,void 0,(function(e){return S(t,e)}),(function(e){return L(t,e)}))}(t,r):void 0===n?C(t,r):e(n)?function(t,e,r){l((function(t){var n=!1,i=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?S(t,r):C(t,r))}),(function(e){n||(n=!0,L(t,e))}),t._label);!n&&i&&(n=!0,L(t,i))}),t)}(t,r,n):C(t,r)}function S(t,e){if(t===e)L(t,new TypeError(\"You cannot resolve a promise with itself\"));else if(i=typeof(n=e),null===n||\"object\"!==i&&\"function\"!==i)C(t,e);else{var r=void 0;try{r=e.then}catch(e){return void L(t,e)}A(t,e,r)}var n,i}function E(t){t._onerror&&t._onerror(t._result),P(t)}function C(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&l(P,t))}function L(t,e){void 0===t._state&&(t._state=2,t._result=e,l(E,t))}function I(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+1]=r,i[a+2]=n,0===a&&t._state&&l(P,t)}function P(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?z(r,n,i,a):i(a);t._subscribers.length=0}}function z(t,r,n,i){var a=e(n),o=void 0,s=void 0,l=!0;if(a){try{o=n(i)}catch(t){l=!1,s=t}if(r===o)return void L(r,new TypeError(\"A promises callback cannot return that same promise.\"))}else o=i;void 0!==r._state||(a&&l?S(r,o):!1===l?L(r,s):1===t?C(r,o):2===t&&L(r,o))}var O=0;function D(t){t[k]=O++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(M),this.promise[k]||D(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&C(this.promise,this._result))):L(this.promise,new Error(\"Array Methods must be provided an Array\"))}return t.prototype._enumerate=function(t){for(var e=0;void 0===this._state&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===T){var i=void 0,a=void 0,o=!1;try{i=t.then}catch(t){o=!0,a=t}if(i===w&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof i)this._remaining--,this._result[e]=t;else if(r===F){var s=new r(M);o?L(s,a):A(s,t,i),this._willSettleAt(s,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===t?L(n,r):this._result[e]=r),0===this._remaining&&C(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}();var F=function(){function t(e){this[k]=O++,this._result=this._state=void 0,this._subscribers=[],M!==e&&(\"function\"!=typeof e&&function(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}(),this instanceof t?function(t,e){try{e((function(e){S(t,e)}),(function(e){L(t,e)}))}catch(e){L(t,e)}}(this,e):function(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var r=this.constructor;return e(t)?this.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return F.prototype.then=w,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return r(t)?new e((function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)})):new e((function(t,e){return e(new TypeError(\"You must pass an array to race.\"))}))},F.resolve=T,F.reject=function(t){var e=new this(M);return L(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){l=t},F._asap=l,F.polyfill=function(){var t=void 0;if(\"undefined\"!=typeof i)t=i;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(t){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if(\"[object Promise]\"===r&&!e.cast)return}t.Promise=F},F.Promise=F,F}))}).call(this)}).call(this,t(\"_process\"),\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{_process:526}],225:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?t(\"ext/global-this\").Symbol:t(\"./polyfill\")},{\"./is-implemented\":226,\"./polyfill\":231,\"ext/global-this\":238}],226:[function(t,e,r){\"use strict\";var n=t(\"ext/global-this\"),i={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if(\"function\"!=typeof e)return!1;t=e(\"test symbol\");try{String(t)}catch(t){return!1}return!!i[typeof e.iterator]&&(!!i[typeof e.toPrimitive]&&!!i[typeof e.toStringTag])}},{\"ext/global-this\":238}],227:[function(t,e,r){\"use strict\";e.exports=function(t){return!!t&&(\"symbol\"==typeof t||!!t.constructor&&(\"Symbol\"===t.constructor.name&&\"Symbol\"===t[t.constructor.toStringTag]))}},{}],228:[function(t,e,r){\"use strict\";var n=t(\"d\"),i=Object.create,a=Object.defineProperty,o=Object.prototype,s=i(null);e.exports=function(t){for(var e,r,i=0;s[t+(i||\"\")];)++i;return s[t+=i||\"\"]=!0,a(o,e=\"@@\"+t,n.gs(null,(function(t){r||(r=!0,a(this,e,n(t)),r=!1)}))),e}},{d:155}],229:[function(t,e,r){\"use strict\";var n=t(\"d\"),i=t(\"ext/global-this\").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n(\"\",i&&i.hasInstance||t(\"hasInstance\")),isConcatSpreadable:n(\"\",i&&i.isConcatSpreadable||t(\"isConcatSpreadable\")),iterator:n(\"\",i&&i.iterator||t(\"iterator\")),match:n(\"\",i&&i.match||t(\"match\")),replace:n(\"\",i&&i.replace||t(\"replace\")),search:n(\"\",i&&i.search||t(\"search\")),species:n(\"\",i&&i.species||t(\"species\")),split:n(\"\",i&&i.split||t(\"split\")),toPrimitive:n(\"\",i&&i.toPrimitive||t(\"toPrimitive\")),toStringTag:n(\"\",i&&i.toStringTag||t(\"toStringTag\")),unscopables:n(\"\",i&&i.unscopables||t(\"unscopables\"))})}},{d:155,\"ext/global-this\":238}],230:[function(t,e,r){\"use strict\";var n=t(\"d\"),i=t(\"../../../validate-symbol\"),a=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return a[e]?a[e]:a[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in i(t),a)if(a[e]===t)return e}))})}},{\"../../../validate-symbol\":232,d:155}],231:[function(t,e,r){\"use strict\";var n,i,a,o=t(\"d\"),s=t(\"./validate-symbol\"),l=t(\"ext/global-this\").Symbol,c=t(\"./lib/private/generate-name\"),u=t(\"./lib/private/setup/standard-symbols\"),f=t(\"./lib/private/setup/symbol-registry\"),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if(\"function\"==typeof l)try{String(l()),a=!0}catch(t){}else l=null;i=function(t){if(this instanceof i)throw new TypeError(\"Symbol is not a constructor\");return n(t)},e.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError(\"Symbol is not a constructor\");return a?l(e):(r=h(i.prototype),e=void 0===e?\"\":String(e),p(r,{__description__:o(\"\",e),__name__:o(\"\",c(e))}))},u(n),f(n),p(i.prototype,{constructor:o(n),toString:o(\"\",(function(){return this.__name__}))}),p(n.prototype,{toString:o((function(){return\"Symbol (\"+s(this).__description__+\")\"})),valueOf:o((function(){return s(this)}))}),d(n.prototype,n.toPrimitive,o(\"\",(function(){var t=s(this);return\"symbol\"==typeof t?t:t.toString()}))),d(n.prototype,n.toStringTag,o(\"c\",\"Symbol\")),d(i.prototype,n.toStringTag,o(\"c\",n.prototype[n.toStringTag])),d(i.prototype,n.toPrimitive,o(\"c\",n.prototype[n.toPrimitive]))},{\"./lib/private/generate-name\":228,\"./lib/private/setup/standard-symbols\":229,\"./lib/private/setup/symbol-registry\":230,\"./validate-symbol\":232,d:155,\"ext/global-this\":238}],232:[function(t,e,r){\"use strict\";var n=t(\"./is-symbol\");e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not a symbol\");return t}},{\"./is-symbol\":227}],233:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?WeakMap:t(\"./polyfill\")},{\"./is-implemented\":234,\"./polyfill\":236}],234:[function(t,e,r){\"use strict\";e.exports=function(){var t,e;if(\"function\"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},\"one\"],[{},\"two\"],[{},\"three\"]])}catch(t){return!1}return\"[object WeakMap]\"===String(t)&&(\"function\"==typeof t.set&&(t.set({},1)===t&&(\"function\"==typeof t.delete&&(\"function\"==typeof t.has&&\"one\"===t.get(e)))))}},{}],235:[function(t,e,r){\"use strict\";e.exports=\"function\"==typeof WeakMap&&\"[object WeakMap]\"===Object.prototype.toString.call(new WeakMap)},{}],236:[function(t,e,r){\"use strict\";var n,i=t(\"es5-ext/object/is-value\"),a=t(\"es5-ext/object/set-prototype-of\"),o=t(\"es5-ext/object/valid-object\"),s=t(\"es5-ext/object/valid-value\"),l=t(\"es5-ext/string/random-uniq\"),c=t(\"d\"),u=t(\"es6-iterator/get\"),f=t(\"es6-iterator/for-of\"),h=t(\"es6-symbol\").toStringTag,p=t(\"./is-native-implemented\"),d=Array.isArray,g=Object.defineProperty,m=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");return t=p&&a&&WeakMap!==n?a(new WeakMap,v(this)):this,i(e)&&(d(e)||(e=u(e))),g(t,\"__weakMapData__\",c(\"c\",\"$weakMap$\"+l())),e?(f(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},p&&(a&&a(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:c(n)})),Object.defineProperties(n.prototype,{delete:c((function(t){return!!m.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:c((function(t){if(m.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:c((function(t){return m.call(o(t),this.__weakMapData__)})),set:c((function(t,e){return g(o(t),this.__weakMapData__,c(\"c\",e)),this})),toString:c((function(){return\"[object WeakMap]\"}))}),g(n.prototype,h,c(\"c\",\"WeakMap\"))},{\"./is-native-implemented\":235,d:155,\"es5-ext/object/is-value\":200,\"es5-ext/object/set-prototype-of\":206,\"es5-ext/object/valid-object\":210,\"es5-ext/object/valid-value\":211,\"es5-ext/string/random-uniq\":216,\"es6-iterator/for-of\":218,\"es6-iterator/get\":219,\"es6-symbol\":225}],237:[function(t,e,r){var n=function(){if(\"object\"==typeof self&&self)return self;if(\"object\"==typeof window&&window)return window;throw new Error(\"Unable to resolve global `this`\")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,\"__global__\",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],238:[function(t,e,r){\"use strict\";e.exports=t(\"./is-implemented\")()?globalThis:t(\"./implementation\")},{\"./implementation\":237,\"./is-implemented\":239}],239:[function(t,e,r){\"use strict\";e.exports=function(){return\"object\"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],240:[function(t,e,r){\"use strict\";e.exports=function(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]]]}},{}],241:[function(t,e,r){\"use strict\";var n=t(\"is-string-blank\");e.exports=function(t){var e=typeof t;if(\"string\"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if(\"number\"!==e)return!1;return t-t<1}},{\"is-string-blank\":470}],242:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return\"number\"==typeof t?new o(n=l(t),n,0):new o(t,l(t.length),0);case 2:if(\"number\"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error(\"state and velocity lengths must match\");return new o(t,e,r)}};var n=t(\"cubic-hermite\"),i=t(\"binary-search-bounds\");function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(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()]}var s=o.prototype;function l(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}s.flush=function(t){var e=i.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},s.curve=function(t){var e=this._time,r=e.length,o=i.le(e,t),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,f=this.bounds;if(o<0)for(var h=u-1,p=0;p<u;++p,--h)s[p]=l[h];else if(o>=r-1){h=l.length-1;var d=t-e[r-1];for(p=0;p<u;++p,--h)s[p]=l[h]+d*c[h]}else{h=u*(o+1)-1;var g=e[o],m=e[o+1]-g||1,v=this._scratch[1],y=this._scratch[2],x=this._scratch[3],b=this._scratch[4],_=!0;for(p=0;p<u;++p,--h)v[p]=l[h],x[p]=c[h]*m,y[p]=l[h+u],b[p]=c[h+u]*m,_=_&&v[p]===y[p]&&x[p]===b[p]&&0===x[p];if(_)for(p=0;p<u;++p)s[p]=v[p];else n(v,x,y,b,(t-g)/m,s)}var w=f[0],T=f[1];for(p=0;p<u;++p)s[p]=a(w[p],T[p],s[p]);return s},s.dcurve=function(t){var e=this._time,r=e.length,a=i.le(e,t),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(a>=r-1)for(var u=s.length-1,f=(e[r-1],0);f<c;++f,--u)o[f]=l[u];else{u=c*(a+1)-1;var h=e[a],p=e[a+1]-h||1,d=this._scratch[1],g=this._scratch[2],m=this._scratch[3],v=this._scratch[4],y=!0;for(f=0;f<c;++f,--u)d[f]=s[u],m[f]=l[u]*p,g[f]=s[u+c],v[f]=l[u+c]*p,y=y&&d[f]===g[f]&&m[f]===v[f]&&0===m[f];if(y)for(f=0;f<c;++f)o[f]=0;else{n.derivative(d,m,g,v,(t-h)/p,o);for(f=0;f<c;++f)o[f]/=p}}return o},s.lastT=function(){var t=this._time;return t[t.length-1]},s.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(e,t);for(var u=0;u<2;++u)for(var f=0;f<r;++f)n.push(n[o++]),i.push(0);this._time.push(t);for(f=r;f>0;--f)n.push(a(l[f-1],c[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=t-e,l=this.bounds,c=l[0],u=l[1],f=s>1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=a(c[h-1],u[h-1],arguments[h]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,n=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(t);for(var l=e;l>0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];n.push(a(l[h-1],c[h-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,n=this._state,i=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=t-e;this._time.push(t);for(var f=r-1;f>=0;--f)n.push(a(l[f],c[f],n[o]+u*i[o])),i.push(0),o+=1}}},{\"binary-search-bounds\":243,\"cubic-hermite\":150}],243:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){var o=[\"function \",t,\"(a,l,h,\",n.join(\",\"),\"){\",a?\"\":\"var i=\",r?\"l-1\":\"h+1\",\";while(l<=h){var m=(l+h)>>>1,x=a\",i?\".get(m)\":\"[m]\"];return a?e.indexOf(\"c\")<0?o.push(\";if(x===y){return m}else if(x<=y){\"):o.push(\";var p=c(x,y);if(p===0){return m}else if(p<=0){\"):o.push(\";if(\",e,\"){i=m;\"),r?o.push(\"l=m+1}else{h=m-1}\"):o.push(\"h=m-1}else{l=m+1}\"),o.push(\"}\"),a?o.push(\"return -1};\"):o.push(\"return i};\"),o.join(\"\")}function i(t,e,r,i){return new Function([n(\"A\",\"x\"+t+\"y\",e,[\"y\"],!1,i),n(\"B\",\"x\"+t+\"y\",e,[\"y\"],!0,i),n(\"P\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],!1,i),n(\"Q\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],!0,i),\"function dispatchBsearch\",r,\"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch\",r].join(\"\"))()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],244:[function(t,e,r){var n=t(\"dtype\");e.exports=function(t,e,r){if(!t)throw new TypeError(\"must specify data as first parameter\");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&\"number\"==typeof t[0][0]){var i,a,o,s,l=t[0].length,c=t.length*l;e&&\"string\"!=typeof e||(e=new(n(e||\"float32\"))(c+r));var u=e.length-r;if(c!==u)throw new Error(\"source length \"+c+\" (\"+l+\"x\"+t.length+\") does not match destination length \"+u);for(i=0,o=r;i<t.length;i++)for(a=0;a<l;a++)e[o++]=null===t[i][a]?NaN:t[i][a]}else if(e&&\"string\"!=typeof e)e.set(t,r);else{var f=n(e||\"float32\");if(Array.isArray(t)||\"array\"===e)for(e=new f(t.length+r),i=0,o=r,s=e.length;o<s;o++,i++)e[o]=null===t[i]?NaN:t[i];else 0===r?e=new f(t):(e=new f(t.length+r)).set(t,r)}return e}},{dtype:175}],245:[function(t,e,r){\"use strict\";var n=t(\"css-font/stringify\"),i=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],r=t.canvas||document.createElement(\"canvas\"),a=t.font,o=\"number\"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||i;a&&\"string\"!=typeof a&&(a=n(a));if(Array.isArray(s)){if(2===s.length&&\"number\"==typeof s[0]&&\"number\"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split(\"\");e=e.slice(),r.width=e[0],r.height=e[1];var f=r.getContext(\"2d\");f.fillStyle=\"#000\",f.fillRect(0,0,r.width,r.height),f.font=a,f.textAlign=\"center\",f.textBaseline=\"middle\",f.fillStyle=\"#fff\";var h=o[0]/2,p=o[1]/2;for(c=0;c<s.length;c++)f.fillText(s[c],h,p),(h+=o[0])>e[0]-o[0]/2&&(h=o[0]/2,p+=o[1]);return r}},{\"css-font/stringify\":147}],246:[function(t,e,r){\"use strict\";function n(t,e){e||(e={}),(\"string\"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(\", \"):e.family;if(!r)throw Error(\"`family` must be defined\");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||\"\",c=(t=[e.style||e.fontStyle||\"\",l,s].join(\" \")+\"px \"+r,e.origin||\"top\");if(n.cache[r]&&s<=n.cache[r].em)return i(n.cache[r],c);var u=e.canvas||n.canvas,f=u.getContext(\"2d\"),h={upper:void 0!==e.upper?e.upper:\"H\",lower:void 0!==e.lower?e.lower:\"x\",descent:void 0!==e.descent?e.descent:\"p\",ascent:void 0!==e.ascent?e.ascent:\"h\",tittle:void 0!==e.tittle?e.tittle:\"i\",overshoot:void 0!==e.overshoot?e.overshoot:\"O\"},p=Math.ceil(1.5*s);u.height=p,u.width=.5*p,f.font=t;var d={top:0};f.clearRect(0,0,p,p),f.textBaseline=\"top\",f.fillStyle=\"black\",f.fillText(\"H\",0,0);var g=a(f.getImageData(0,0,p,p));f.clearRect(0,0,p,p),f.textBaseline=\"bottom\",f.fillText(\"H\",0,p);var m=a(f.getImageData(0,0,p,p));d.lineHeight=d.bottom=p-m+g,f.clearRect(0,0,p,p),f.textBaseline=\"alphabetic\",f.fillText(\"H\",0,p);var v=p-a(f.getImageData(0,0,p,p))-1+g;d.baseline=d.alphabetic=v,f.clearRect(0,0,p,p),f.textBaseline=\"middle\",f.fillText(\"H\",0,.5*p);var y=a(f.getImageData(0,0,p,p));d.median=d.middle=p-y-1+g-.5*p,f.clearRect(0,0,p,p),f.textBaseline=\"hanging\",f.fillText(\"H\",0,.5*p);var x=a(f.getImageData(0,0,p,p));d.hanging=p-x-1+g-.5*p,f.clearRect(0,0,p,p),f.textBaseline=\"ideographic\",f.fillText(\"H\",0,p);var b=a(f.getImageData(0,0,p,p));if(d.ideographic=p-b-1+g,h.upper&&(f.clearRect(0,0,p,p),f.textBaseline=\"top\",f.fillText(h.upper,0,0),d.upper=a(f.getImageData(0,0,p,p)),d.capHeight=d.baseline-d.upper),h.lower&&(f.clearRect(0,0,p,p),f.textBaseline=\"top\",f.fillText(h.lower,0,0),d.lower=a(f.getImageData(0,0,p,p)),d.xHeight=d.baseline-d.lower),h.tittle&&(f.clearRect(0,0,p,p),f.textBaseline=\"top\",f.fillText(h.tittle,0,0),d.tittle=a(f.getImageData(0,0,p,p))),h.ascent&&(f.clearRect(0,0,p,p),f.textBaseline=\"top\",f.fillText(h.ascent,0,0),d.ascent=a(f.getImageData(0,0,p,p))),h.descent&&(f.clearRect(0,0,p,p),f.textBaseline=\"top\",f.fillText(h.descent,0,0),d.descent=o(f.getImageData(0,0,p,p))),h.overshoot){f.clearRect(0,0,p,p),f.textBaseline=\"top\",f.fillText(h.overshoot,0,0);var _=o(f.getImageData(0,0,p,p));d.overshoot=_-v}for(var w in d)d[w]/=s;return d.em=s,n.cache[r]=d,i(d,c)}function i(t,e){var r={};for(var n in\"string\"==typeof e&&(e=t[e]),t)\"em\"!==n&&(r[n]=t[n]-e);return r}function a(t){for(var e=t.height,r=t.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}function o(t){for(var e=t.height,r=t.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement(\"canvas\"),n.cache={}},{}],247:[function(t,e,r){\"use strict\";e.exports=function(t){return new s(t||g,null)};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}var l=s.prototype;function c(t,e){var r;if(e.left&&(r=c(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?c(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left)if(i=u(t,e,r,n.left))return i;if(i=r(n.key,n.value))return i}if(n.right)return u(t,e,r,n.right)}function f(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=f(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return f(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,\"keys\",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,\"values\",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,\"length\",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(1===h._color||1===i._color)break;var p=l[f-2];if(p.left===h)if(h.left===i){if(!(d=p.right)||0!==d._color){if(p._color=0,p.left=h.right,h._color=1,h.right=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(g=l[f-3]).left===p?g.left=h:g.right=h;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else{if(!(d=p.right)||0!==d._color){if(h.right=i.left,p._color=0,p.left=i.right,i._color=1,i.left=h,i.right=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(g=l[f-3]).left===p?g.left=i:g.right=i;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else if(h.right===i){if(!(d=p.left)||0!==d._color){if(p._color=0,p.right=h.left,h._color=1,h.left=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(g=l[f-3]).right===p?g.right=h:g.left=h;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}else{var d;if(!(d=p.left)||0!==d._color){var g;if(h.left=i.right,p._color=0,p.right=i.left,i._color=1,i.right=h,i.left=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(g=l[f-3]).right===p?g.right=i:g.left=i;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return c(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,\"begin\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,\"end\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.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,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var p=h.prototype;function d(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 g(t,e){return t<e?-1:t>e?1:0}Object.defineProperty(p,\"valid\",{get:function(){return this._stack.length>0}}),Object.defineProperty(p,\"node\",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new h(this.tree,this._stack.slice())},p.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l<e.length;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?d(r,r.left):r.right&&d(r,r.right),r._color=1;for(l=0;l<e.length-1;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(l=0;l<e.length;++l)e[l]._count--;var h=e[e.length-2];return function(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=i(n)).right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).left===r?c.left=n:c.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).left===r?c.left=s:c.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=a(0,n));r.right=a(0,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.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).left&&0===n.left._color){if(s=(n=r.left=i(n)).left=i(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).right===r?c.right=n:c.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).right===r?c.right=s:c.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=a(0,n));r.left=a(0,n);continue}var c;n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).right===r?c.right=n:c.left=n),t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}(e),h.left===r?h.left=null:h.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(p,\"key\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,\"value\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,\"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}),p.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(p,\"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}}),p.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]).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])},p.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(p,\"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}})},{}],248:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function a(t){if(t<0)return Number(\"0/0\");for(var e=i[0],r=i.length-1;r>0;--r)e+=i[r]/(t+r);var n=t+607/128+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(a(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=a},{}],249:[function(t,e,r){e.exports=function(t,e){if(\"string\"!=typeof t)throw new TypeError(\"must specify type string\");if(e=e||{},\"undefined\"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement(\"canvas\");\"number\"==typeof e.width&&(r.width=e.width);\"number\"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf(\"webgl\")&&a.push(\"experimental-\"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}},{}],250:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=new u(t);return r.update(e),r};var n=t(\"./lib/text.js\"),i=t(\"./lib/lines.js\"),a=t(\"./lib/background.js\"),o=t(\"./lib/cube.js\"),s=t(\"./lib/ticks.js\"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(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.tickAlign=[\"auto\",\"auto\",\"auto\"],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.labelAlign=[\"auto\",\"auto\",\"auto\"],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=a(t)}var f=u.prototype;function h(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,f=!1;if(\"bounds\"in t)for(var h=t.bounds,p=0;p<2;++p)for(var d=0;d<3;++d)h[p][d]!==this.bounds[p][d]&&(f=!0),this.bounds[p][d]=h[p][d];if(\"ticks\"in t){r=t.ticks,u=!0,this.autoTicks=!1;for(p=0;p<3;++p)this.tickSpacing[p]=0}else a(\"tickSpacing\")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&(\"ticks\"in t||\"tickSpacing\"in t||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(p=0;p<3;++p)r[p].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o(\"tickEnable\"),l(\"tickFont\")&&(u=!0),a(\"tickSize\"),a(\"tickAngle\"),a(\"tickPad\"),c(\"tickColor\");var g=l(\"labels\");l(\"labelFont\")&&(g=!0),o(\"labelEnable\"),a(\"labelSize\"),a(\"labelPad\"),c(\"labelColor\"),o(\"lineEnable\"),o(\"lineMirror\"),a(\"lineWidth\"),c(\"lineColor\"),o(\"lineTickEnable\"),o(\"lineTickMirror\"),a(\"lineTickLength\"),a(\"lineTickWidth\"),c(\"lineTickColor\"),o(\"gridEnable\"),a(\"gridWidth\"),c(\"gridColor\"),o(\"zeroEnable\"),c(\"zeroLineColor\"),a(\"zeroLineWidth\"),o(\"backgroundEnable\"),c(\"backgroundColor\"),this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var p=[new h,new h,new h];function d(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var f=a,h=s,p=o,d=l;c&1<<u&&(f=s,h=a,p=l,d=o),f[u]=r[0][u],h[u]=r[1][u],i[u]>0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var g=[0,0,0],m={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(t){t=t||m;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),f=u.cubeEdges,h=u.axis,b=n[12],_=n[13],w=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*T)/e.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=f[M],this.lastCubeProps.axis[M]=h[M];var A=p;for(M=0;M<3;++M)d(p[M],M,this.bounds,f,h);e=this.gl;var S,E=g;for(M=0;M<3;++M)this.backgroundEnable[M]?E[M]=h[M]:E[M]=0;this._background.draw(r,n,i,a,E,this.backgroundColor),this._lines.bind(r,n,i,this);for(M=0;M<3;++M){var C=[0,0,0];h[M]>0?C[M]=a[1][M]:C[M]=a[0][M];for(var L=0;L<2;++L){var I=(M+1+L)%3,P=(M+1+(1^L))%3;this.gridEnable[I]&&this._lines.drawGrid(I,P,this.bounds,C,this.gridColor[I],this.gridWidth[I]*this.pixelRatio)}for(L=0;L<2;++L){I=(M+1+L)%3,P=(M+1+(1^L))%3;this.zeroEnable[P]&&Math.min(a[0][P],a[1][P])<=0&&Math.max(a[0][P],a[1][P])>=0&&this._lines.drawZero(I,P,this.bounds,C,this.zeroLineColor[P],this.zeroLineWidth[P]*this.pixelRatio)}}for(M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);var z=c(v,A[M].primalMinor),O=c(y,A[M].mirrorMinor),D=this.lineTickLength;for(L=0;L<3;++L){var R=k/r[5*L];z[L]*=D[L]*R,O[L]*=D[L]*R}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,A[M].primalOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,A[M].mirrorOffset,O,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);var F,B;function N(t){(B=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(M=0;M<3;++M){var U=A[M].primalMinor,V=A[M].mirrorMinor,q=c(x,A[M].primalOffset);for(L=0;L<3;++L)this.lineTickEnable[M]&&(q[L]+=k*U[L]*Math.max(this.lineTickLength[L],0)/r[5*L]);var H=[0,0,0];if(H[M]=1,this.tickEnable[M]){-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]=\"auto\"):this.tickAlign[M]=-1,F=1,\"auto\"===(S=[this.tickAlign[M],.5,F])[0]?S[0]=0:S[0]=parseInt(\"\"+S[0]),B=[0,0,0],j(M,U,V);for(L=0;L<3;++L)q[L]+=k*U[L]*this.tickPad[L]/r[5*L];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],q,this.tickColor[M],H,B,S)}if(this.labelEnable[M]){F=0,B=[0,0,0],this.labels[M].length>4&&(N(M),F=1),\"auto\"===(S=[this.labelAlign[M],.5,F])[0]?S[0]=0:S[0]=parseInt(\"\"+S[0]);for(L=0;L<3;++L)q[L]+=k*U[L]*this.labelPad[L]/r[5*L];q[M]+=.5*(a[0][M]+a[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],q,this.labelColor[M],[0,0,0],B,S)}}this._text.unbind()},f.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\":251,\"./lib/cube.js\":252,\"./lib/lines.js\":253,\"./lib/text.js\":255,\"./lib/ticks.js\":256}],251:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,h[l]=p;for(var d=-1;d<=1;d+=2){f[c]=d;for(var g=-1;g<=1;g+=2)f[u]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var m=c;c=u,u=m}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders\").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders\":254,\"gl-buffer\":259,\"gl-vao\":358}],252:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],h(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]<c[w][2])&&(w=x)}if(w<0){w=0;for(var M=0;M<3;++M){for(var A=(M+2)%3,S=(M+1)%3,E=-1,C=-1,L=0;L<2;++L){var I=(z=L<<M)+(L<<A)+(1-L<<S),P=z+(1-L<<A)+(L<<S);o(c[z],c[I],c[P],f)<0||(L?E=1:C=1)}if(E<0||C<0)C>E&&(w|=1<<M);else{for(L=0;L<2;++L){I=(z=L<<M)+(L<<A)+(1-L<<S),P=z+(1-L<<A)+(L<<S);var z,O=d([l[z],l[I],l[P],l[z+(1<<A)+(1<<S)]]);L?E=O:C=O}C>E&&(w|=1<<M)}}}var D=7^w,R=-1;for(x=0;x<8;++x)x!==w&&x!==D&&(R<0||c[R][1]>c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x){if((N=R^1<<x)!==w&&N!==D)F<0&&(F=N),(S=c[N])[0]<c[F][0]&&(F=N)}var B=-1;for(x=0;x<3;++x){var N;if((N=R^1<<x)!==w&&N!==D&&N!==F)B<0&&(B=N),(S=c[N])[0]>c[B][0]&&(B=N)}var j=g;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var U=7^B;U===w||U===D?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var V=m,q=w;for(M=0;M<3;++M)V[M]=q&1<<M?-1:1;return v};var n=t(\"bit-twiddle\"),i=t(\"gl-mat4/multiply\"),a=t(\"split-polygon\"),o=t(\"robust-orientation\"),s=new Array(16),l=new Array(8),c=new Array(8),u=new Array(3),f=[0,0,0];function h(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}!function(){for(var t=0;t<8;++t)l[t]=[1,1,1,1],c[t]=[1,1,1]}();var p=[[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]];function d(t){for(var e=0;e<p.length;++e)if((t=a.positive(t,p[e])).length<3)return 0;var r=t[0],n=r[0]/r[3],i=r[1]/r[3],o=0;for(e=1;e+1<t.length;++e){var s=t[e],l=t[e+1],c=s[0]/s[3]-n,u=s[1]/s[3]-i,f=l[0]/l[3]-n,h=l[1]/l[3]-i;o+=Math.abs(c*h-u*f)}return o}var g=[1,1,1],m=[0,0,0],v={cubeEdges:g,axis:m}},{\"bit-twiddle\":97,\"gl-mat4/multiply\":295,\"robust-orientation\":548,\"split-polygon\":566}],253:[function(t,e,r){\"use strict\";e.exports=function(t,e,r){var o=[],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;f<3;++f){for(var h=o.length/3|0,d=0;d<r[f].length;++d){var g=+r[f][d].x;o.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}var m=o.length/3|0;s[f]=h,l[f]=m-h;h=o.length/3|0;for(var v=0;v<r[f].length;++v){g=+r[f][v].x;o.push(g,0,1,g,1,1,g,0,-1,g,0,-1,g,1,1,g,1,-1)}m=o.length/3|0;c[f]=h,u[f]=m-h}var y=n(t,new Float32Array(o)),x=i(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),b=a(t);return b.attributes.position.location=0,new p(t,y,x,b,l,s,u,c)};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders\").line,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function f(t){return t[0]=t[1]=t[2]=0,t}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(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}var d=p.prototype;d.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},d.unbind=function(){this.vao.unbind()},d.drawAxisLine=function(t,e,r,n,i){var a=f(s);this.shader.uniforms.majorAxis=s,a[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=a;var o,u=h(c,r);u[t]+=e[0][t],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=n,(o=f(l))[(t+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=f(l))[(t+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},d.drawAxisTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=f(o);a[t]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=i;var s=f(l);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},d.drawGrid=function(t,e,r,n,i,a){if(this.gridCount[t]){var u=f(s);u[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=u;var p=h(c,n);p[e]+=r[0][e],this.shader.uniforms.offset=p;var d=f(o);d[t]=1,this.shader.uniforms.majorAxis=d;var g=f(l);g[t]=1,this.shader.uniforms.screenAxis=g,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},d.drawZero=function(t,e,r,n,i,a){var o=f(s);this.shader.uniforms.majorAxis=o,o[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=o;var u=h(c,n);u[t]+=r[0][t],this.shader.uniforms.offset=u;var p=f(l);p[e]=1,this.shader.uniforms.screenAxis=p,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,6)},d.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{\"./shaders\":254,\"gl-buffer\":259,\"gl-vao\":358}],254:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\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\"]),o=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\"]);r.line=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec3\"}])};var s=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 offset, axis, alignDir, alignOpt;\\nuniform float scale, angle, pixelScale;\\nuniform vec2 resolution;\\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\\nfloat computeViewAngle(vec3 a, vec3 b) {\\n vec3 A = project(a);\\n vec3 B = project(b);\\n\\n return atan(\\n (B.y - A.y) * resolution.y,\\n (B.x - A.x) * resolution.x\\n );\\n}\\n\\nconst float PI = 3.141592;\\nconst float TWO_PI = 2.0 * PI;\\nconst float HALF_PI = 0.5 * PI;\\nconst float ONE_AND_HALF_PI = 1.5 * PI;\\n\\nint option = int(floor(alignOpt.x + 0.001));\\nfloat hv_ratio = alignOpt.y;\\nbool enableAlign = (alignOpt.z != 0.0);\\n\\nfloat mod_angle(float a) {\\n return mod(a, PI);\\n}\\n\\nfloat positive_angle(float a) {\\n return mod_angle((a < 0.0) ?\\n a + TWO_PI :\\n a\\n );\\n}\\n\\nfloat look_upwards(float a) {\\n float b = positive_angle(a);\\n return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\\n b - PI :\\n b;\\n}\\n\\nfloat look_horizontal_or_vertical(float a, float ratio) {\\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\\n // if ratio is set to 0.5 then it is 50%, 50%.\\n // when using a higher ratio e.g. 0.75 the result would\\n // likely be more horizontal than vertical.\\n\\n float b = positive_angle(a);\\n\\n return\\n (b < ( ratio) * HALF_PI) ? 0.0 :\\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\\n 0.0;\\n}\\n\\nfloat roundTo(float a, float b) {\\n return float(b * floor((a + 0.5 * b) / b));\\n}\\n\\nfloat look_round_n_directions(float a, int n) {\\n float b = positive_angle(a);\\n float div = TWO_PI / float(n);\\n float c = roundTo(b, div);\\n return look_upwards(c);\\n}\\n\\nfloat applyAlignOption(float rawAngle, float delta) {\\n return\\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\\n rawAngle; // otherwise return back raw input angle\\n}\\n\\nbool isAxisTitle = (axis.x == 0.0) &&\\n (axis.y == 0.0) &&\\n (axis.z == 0.0);\\n\\nvoid main() {\\n //Compute world offset\\n float axisDistance = position.z;\\n vec3 dataPosition = axisDistance * axis + offset;\\n\\n float beta = angle; // i.e. user defined attributes for each tick\\n\\n float axisAngle;\\n float clipAngle;\\n float flip;\\n\\n if (enableAlign) {\\n axisAngle = (isAxisTitle) ? HALF_PI :\\n computeViewAngle(dataPosition, dataPosition + axis);\\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\\n\\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\\n\\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\\n\\n beta += applyAlignOption(clipAngle, flip * PI);\\n }\\n\\n //Compute plane offset\\n vec2 planeCoord = position.xy * pixelScale;\\n\\n mat2 planeXform = scale * mat2(\\n cos(beta), sin(beta),\\n -sin(beta), cos(beta)\\n );\\n\\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\\n\\n //Compute clip position\\n vec3 clipPosition = project(dataPosition);\\n\\n //Apply text offset in clip coordinates\\n clipPosition += vec3(viewOffset, 0.0);\\n\\n //Done\\n gl_Position = vec4(clipPosition, 1.0);\\n}\"]),l=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\"]);r.text=function(t){return i(t,s,l,null,[{name:\"position\",type:\"vec3\"}])};var c=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\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\\n vec3 signAxis = sign(bounds[1] - bounds[0]);\\n\\n vec3 realNormal = signAxis * normal;\\n\\n if(dot(realNormal, enable) > 0.0) {\\n vec3 minRange = min(bounds[0], bounds[1]);\\n vec3 maxRange = max(bounds[0], bounds[1]);\\n vec3 nPosition = mix(minRange, maxRange, 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\\n colorChannel = abs(realNormal);\\n}\"]),u=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform vec4 colors[3];\\n\\nvarying vec3 colorChannel;\\n\\nvoid main() {\\n gl_FragColor = colorChannel.x * colors[0] +\\n colorChannel.y * colors[1] +\\n colorChannel.z * colors[2];\\n}\"]);r.bg=function(t){return i(t,c,u,null,[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}])}},{\"gl-shader\":335,glslify:257}],255:[function(t,e,r){(function(r){(function(){\"use strict\";e.exports=function(t,e,r,a,s,l){var u=n(t),f=i(t,[{buffer:u,size:3}]),h=o(t);h.attributes.position.location=0;var p=new c(t,h,u,f);return p.update(e,r,a,s,l),p};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"vectorize-text\"),o=t(\"./shaders\").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(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}var u=c.prototype,f=[0,0];u.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,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:\"'+t+'\" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:\"center\",textBaseline:\"middle\",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=u.positions,p=u.cells,d=0,g=p.length;d<g;++d)for(var m=p[d],v=2;v>=0;--v){var y=h[m[v]];o.push(f*y[0],-f*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),h[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var g=0;g<n[d].length;++g)n[d][g].text&&s(n[d][g].x,n[d][g].text,n[d][g].font||i,n[d][g].fontSize||12,1.25,p);u[d]=(o.length/3|0)-c[d]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=f,this.labelCount=h},u.drawTicks=function(t,e,r,n,i,a,o,s){this.tickCount[t]&&(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.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t]))},u.drawLabel=function(t,e,r,n,i,a,o,s){this.labelCount[t]&&(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.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},u.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this)}).call(this,t(\"_process\"))},{\"./shaders\":254,_process:526,\"gl-buffer\":259,\"gl-vao\":358,\"vectorize-text\":600}],256:[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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=\"\"+l;if(o<0&&(u=\"-\"+u),i){for(var f=\"\"+c;f.length<i;)f=\"0\"+f;return u+\".\"+f}return u}r.create=function(t,e){for(var r=[],i=0;i<3;++i){for(var a=[],o=(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(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},r.equal=function(t,e){for(var r=0;r<3;++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||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}},{}],257:[function(t,e,r){e.exports=function(t){\"string\"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||\"\");return r.push(t[n]),r.join(\"\")}},{}],258:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,l,f){var h=e.model||c,p=e.view||c,v=e.projection||c,y=e._ortho||!1,x=t.bounds,b=(f=f||a(h,p,v,x,y)).axis;o(u,p,h),o(u,v,u);for(var _=g,w=0;w<3;++w)_[w].lo=1/0,_[w].hi=-1/0,_[w].pixelsPerDataUnit=1/0;var T=n(s(u,u));s(u,u);for(var k=0;k<3;++k){var M=(k+1)%3,A=(k+2)%3,S=m;t:for(w=0;w<2;++w){var E=[];if(b[k]<0!=!!w){S[k]=x[w][k];for(var C=0;C<2;++C){S[M]=x[C^w][M];for(var L=0;L<2;++L)S[A]=x[L^C^w][A],E.push(S.slice())}var I=y?5:4;for(C=I;C===I;++C){if(0===E.length)continue t;E=i.positive(E,T[C])}for(C=0;C<E.length;++C){A=E[C];var P=d(m,u,A,r,l);for(L=0;L<3;++L)_[L].lo=Math.min(_[L].lo,A[L]),_[L].hi=Math.max(_[L].hi,A[L]),L!==k&&(_[L].pixelsPerDataUnit=Math.min(_[L].pixelsPerDataUnit,Math.abs(P[L])))}}}}return _};var n=t(\"extract-frustum-planes\"),i=t(\"split-polygon\"),a=t(\"./lib/cube.js\"),o=t(\"gl-mat4/multiply\"),s=t(\"gl-mat4/transpose\"),l=t(\"gl-vec4/transformMat4\"),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function f(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}var h=[0,0,0,1],p=[0,0,0,1];function d(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=h,s=p,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[a]+=1,l(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,l(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,f=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+f*f)}return t}var g=[new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0),new f(1/0,-1/0,1/0)],m=[0,0,0]},{\"./lib/cube.js\":252,\"extract-frustum-planes\":240,\"gl-mat4/multiply\":295,\"gl-mat4/transpose\":306,\"gl-vec4/transformMat4\":429,\"split-polygon\":566}],259:[function(t,e,r){\"use strict\";var n=t(\"typedarray-pool\"),i=t(\"ndarray-ops\"),a=t(\"ndarray\"),o=[\"uint8\",\"uint8_clamped\",\"uint16\",\"uint32\",\"int8\",\"int16\",\"int32\",\"float32\"];function s(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}var l=s.prototype;function c(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)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 u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a<i;++a)r[a]=t[a];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if(\"number\"!=typeof e&&(e=-1),this.bind(),\"object\"==typeof t&&\"undefined\"!=typeof t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r=\"float32\"),this.type===this.gl.ELEMENT_ARRAY_BUFFER)r=gl.getExtension(\"OES_element_index_uint\")&&\"uint16\"!==r?\"uint32\":\"uint16\";if(r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,\"uint16\"):u(t,\"float32\"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if(\"object\"==typeof t&&\"number\"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if(\"number\"!=typeof t&&void 0!==t)throw new Error(\"gl-buffer: Invalid data type\");if(e>=0)throw new Error(\"gl-buffer: Cannot specify offset when resizing buffer\");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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 i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:495,\"ndarray-ops\":490,\"typedarray-pool\":595}],260:[function(t,e,r){\"use strict\";var n=t(\"gl-vec3\");e.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,f=1/0,h=-1/0,p=null,d=null,g=[],m=1/0,v=!1,y=0;y<r.length;y++){var x=r[y];s=Math.min(x[0],s),l=Math.max(x[0],l),c=Math.min(x[1],c),u=Math.max(x[1],u),f=Math.min(x[2],f),h=Math.max(x[2],h);var b=i[y];if(n.length(b)>o&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(m=Math.min(m,_),v=!1):v=!0}v||(p=x,d=b),g.push(b)}var w=[s,c,f],T=[l,u,h];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var k=1/o;isFinite(m)||(m=1),a.vectorScale=m;var M=t.coneSize||.5;t.absoluteConeSize&&(M=t.absoluteConeSize*k),a.coneScale=M;y=0;for(var A=0;y<r.length;y++)for(var S=(x=r[y])[0],E=x[1],C=x[2],L=g[y],I=n.length(L)*k,P=0;P<8;P++){a.positions.push([S,E,C,A++]),a.positions.push([S,E,C,A++]),a.positions.push([S,E,C,A++]),a.positions.push([S,E,C,A++]),a.positions.push([S,E,C,A++]),a.positions.push([S,E,C,A++]),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vertexIntensity.push(I,I,I),a.vertexIntensity.push(I,I,I);var z=a.positions.length;a.cells.push([z-6,z-5,z-4],[z-3,z-2,z-1])}return a};var i=t(\"./lib/shaders\");e.exports.createMesh=t(\"./create_mesh\"),e.exports.createConeMesh=function(t,r){return e.exports.createMesh(t,r,{shaders:i,traceType:\"cone\"})}},{\"./create_mesh\":261,\"./lib/shaders\":262,\"gl-vec3\":377}],261:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=t(\"gl-texture2d\"),s=t(\"gl-mat4/multiply\"),l=t(\"gl-mat4/invert\"),c=t(\"ndarray\"),u=t(\"colormap\"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e,r,n,i,a,o,s,l,c,u){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=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.traceType=u,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=f,this._view=f,this._projection=f,this._resolution=[1,1]}var p=h.prototype;function d(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}function g(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}p.isOpaque=function(){return this.opacity>=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,\"lightPosition\"in t&&(this.lightPosition=t.lightPosition),\"opacity\"in t&&(this.opacity=t.opacity),\"ambient\"in t&&(this.ambientLight=t.ambient),\"diffuse\"in t&&(this.diffuseLight=t.diffuse),\"specular\"in t&&(this.specularLight=t.specular),\"roughness\"in t&&(this.roughness=t.roughness),\"fresnel\"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:\"rgba\"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var h=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,g=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],g=+t.vertexIntensityBounds[1];else for(var m=0;m<p.length;++m){var v=p[m];d=Math.min(d,v),g=Math.max(g,v)}else for(m=0;m<n.length;++m){v=n[m][2];d=Math.min(d,v),g=Math.max(g,v)}this.intensity=p||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(m=0;m<n.length;++m)for(var y=n[m],x=0;x<3;++x)!isNaN(y[x])&&isFinite(y[x])&&(this.bounds[0][x]=Math.min(this.bounds[0][x],y[x]),this.bounds[1][x]=Math.max(this.bounds[1][x],y[x]));var b=0;t:for(m=0;m<r.length;++m){var _=r[m];switch(_.length){case 3:for(x=0;x<3;++x){y=n[T=_[x]];for(var w=0;w<3;++w)if(isNaN(y[w])||!isFinite(y[w]))continue t}for(x=0;x<3;++x){var T;y=n[T=_[2-x]];a.push(y[0],y[1],y[2],y[3]);var k=i[T];o.push(k[0],k[1],k[2],k[3]||0);var M,A=h;3===A.length?s.push(A[0],A[1],A[2],1):s.push(A[0],A[1],A[2],A[3]),M=p?[(p[T]-d)/(g-d),0]:[(y[2]-d)/(g-d),0],l.push(M[0],M[1]),f.push(m)}b+=1}}this.triangleCount=b,this.trianglePositions.update(a),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(l),this.triangleIds.update(new Uint32Array(f))}},p.drawTransparent=p.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var c={model:r,view:n,projection:i,inverseModel:f.slice(),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,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};c.inverseModel=l(c.inverseModel,c.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u=new Array(16);s(u,c.view,c.model),s(u,c.projection,u),l(u,u);for(o=0;o<3;++o)c.eyePosition[o]=u[12+o]/u[15];var h=u[15];for(o=0;o<3;++o)h+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],d=0;d<3;++d)p+=u[4*d+o]*this.lightPosition[d];c.lightPosition[o]=p/h}if(this.triangleCount>0){var g=this.triShader;g.bind(),g.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return\"cone\"===this.traceType?i.index=Math.floor(r[1]/48):\"streamtube\"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=d(t,n),l=g(t,n),u=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=t.LINEAR_MIPMAP_LINEAR,u.magFilter=t.LINEAR;var f=i(t),p=i(t),m=i(t),v=i(t),y=i(t),x=a(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),b=new h(t,u,s,l,f,p,y,m,v,x,r.traceType||\"cone\");return b.update(e),b}},{colormap:131,\"gl-buffer\":259,\"gl-mat4/invert\":293,\"gl-mat4/multiply\":295,\"gl-shader\":335,\"gl-texture2d\":353,\"gl-vao\":358,ndarray:495}],262:[function(t,e,r){var n=t(\"glslify\"),i=n([\"precision highp float;\\n\\nprecision highp float;\\n#define GLSLIFY 1\\n\\nvec3 getOrthogonalVector(vec3 v) {\\n // Return up-vector for only-z vector.\\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\\n // Assign z = 0, x = -b, y = a:\\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\\n return normalize(vec3(-v.y, v.x, 0.0));\\n } else {\\n return normalize(vec3(0.0, v.z, -v.y));\\n }\\n}\\n\\n// Calculate the cone vertex and normal at the given index.\\n//\\n// The returned vertex is for a cone with its top at origin and height of 1.0,\\n// pointing in the direction of the vector attribute.\\n//\\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\\n// These vertices are used to make up the triangles of the cone by the following:\\n// segment + 0 top vertex\\n// segment + 1 perimeter vertex a+1\\n// segment + 2 perimeter vertex a\\n// segment + 3 center base vertex\\n// segment + 4 perimeter vertex a\\n// segment + 5 perimeter vertex a+1\\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\\n// To go from index to segment, floor(index / 6)\\n// To go from segment to angle, 2*pi * (segment/segmentCount)\\n// To go from index to segment index, index - (segment*6)\\n//\\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\\n\\n const float segmentCount = 8.0;\\n\\n float index = rawIndex - floor(rawIndex /\\n (segmentCount * 6.0)) *\\n (segmentCount * 6.0);\\n\\n float segment = floor(0.001 + index/6.0);\\n float segmentIndex = index - (segment*6.0);\\n\\n normal = -normalize(d);\\n\\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\\n return mix(vec3(0.0), -d, coneOffset);\\n }\\n\\n float nextAngle = (\\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\\n (segmentIndex > 4.99 && segmentIndex < 5.01)\\n ) ? 1.0 : 0.0;\\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\\n\\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\\n vec3 v2 = v1 - d;\\n\\n vec3 u = getOrthogonalVector(d);\\n vec3 v = normalize(cross(u, d));\\n\\n vec3 x = u * cos(angle) * length(d)*0.25;\\n vec3 y = v * sin(angle) * length(d)*0.25;\\n vec3 v3 = v2 + x + y;\\n if (segmentIndex < 3.0) {\\n vec3 tx = u * sin(angle);\\n vec3 ty = v * -cos(angle);\\n vec3 tangent = tx + ty;\\n normal = normalize(cross(v3 - v1, tangent));\\n }\\n\\n if (segmentIndex == 0.0) {\\n return mix(d, vec3(0.0), coneOffset);\\n }\\n return v3;\\n}\\n\\nattribute vec3 vector;\\nattribute vec4 color, position;\\nattribute vec2 uv;\\n\\nuniform float vectorScale, coneScale, coneOffset;\\nuniform mat4 model, view, projection, inverseModel;\\nuniform vec3 eyePosition, lightPosition;\\n\\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n // Scale the vector magnitude to stay constant with\\n // model & view changes.\\n vec3 normal;\\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\\n\\n //Lighting geometry parameters\\n vec4 cameraCoordinate = view * conePosition;\\n cameraCoordinate.xyz /= cameraCoordinate.w;\\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\\n\\n // vec4 m_position = model * vec4(conePosition, 1.0);\\n vec4 t_position = view * conePosition;\\n gl_Position = projection * t_position;\\n\\n f_color = color;\\n f_data = conePosition.xyz;\\n f_position = position.xyz;\\n f_uv = uv;\\n}\\n\"]),a=n([\"#extension GL_OES_standard_derivatives : enable\\n\\nprecision highp float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution(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\\nfloat cookTorranceSpecular(\\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(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\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\\nuniform sampler2D texture;\\n\\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\\n\"]),o=n([\"precision highp float;\\n\\nprecision highp float;\\n#define GLSLIFY 1\\n\\nvec3 getOrthogonalVector(vec3 v) {\\n // Return up-vector for only-z vector.\\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\\n // Assign z = 0, x = -b, y = a:\\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\\n return normalize(vec3(-v.y, v.x, 0.0));\\n } else {\\n return normalize(vec3(0.0, v.z, -v.y));\\n }\\n}\\n\\n// Calculate the cone vertex and normal at the given index.\\n//\\n// The returned vertex is for a cone with its top at origin and height of 1.0,\\n// pointing in the direction of the vector attribute.\\n//\\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\\n// These vertices are used to make up the triangles of the cone by the following:\\n// segment + 0 top vertex\\n// segment + 1 perimeter vertex a+1\\n// segment + 2 perimeter vertex a\\n// segment + 3 center base vertex\\n// segment + 4 perimeter vertex a\\n// segment + 5 perimeter vertex a+1\\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\\n// To go from index to segment, floor(index / 6)\\n// To go from segment to angle, 2*pi * (segment/segmentCount)\\n// To go from index to segment index, index - (segment*6)\\n//\\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\\n\\n const float segmentCount = 8.0;\\n\\n float index = rawIndex - floor(rawIndex /\\n (segmentCount * 6.0)) *\\n (segmentCount * 6.0);\\n\\n float segment = floor(0.001 + index/6.0);\\n float segmentIndex = index - (segment*6.0);\\n\\n normal = -normalize(d);\\n\\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\\n return mix(vec3(0.0), -d, coneOffset);\\n }\\n\\n float nextAngle = (\\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\\n (segmentIndex > 4.99 && segmentIndex < 5.01)\\n ) ? 1.0 : 0.0;\\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\\n\\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\\n vec3 v2 = v1 - d;\\n\\n vec3 u = getOrthogonalVector(d);\\n vec3 v = normalize(cross(u, d));\\n\\n vec3 x = u * cos(angle) * length(d)*0.25;\\n vec3 y = v * sin(angle) * length(d)*0.25;\\n vec3 v3 = v2 + x + y;\\n if (segmentIndex < 3.0) {\\n vec3 tx = u * sin(angle);\\n vec3 ty = v * -cos(angle);\\n vec3 tangent = tx + ty;\\n normal = normalize(cross(v3 - v1, tangent));\\n }\\n\\n if (segmentIndex == 0.0) {\\n return mix(d, vec3(0.0), coneOffset);\\n }\\n return v3;\\n}\\n\\nattribute vec4 vector;\\nattribute vec4 position;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform float vectorScale, coneScale, coneOffset;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n vec3 normal;\\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\\n gl_Position = projection * view * conePosition;\\n f_id = id;\\n f_position = position.xyz;\\n}\\n\"]),s=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\\n\\n gl_FragColor = vec4(pickId, f_id.xyz);\\n}\"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:\"position\",type:\"vec4\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"},{name:\"vector\",type:\"vec3\"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:\"position\",type:\"vec4\"},{name:\"id\",type:\"vec4\"},{name:\"vector\",type:\"vec3\"}]}},{glslify:263}],263:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],264:[function(t,e,r){e.exports={0:\"NONE\",1:\"ONE\",2:\"LINE_LOOP\",3:\"LINE_STRIP\",4:\"TRIANGLES\",5:\"TRIANGLE_STRIP\",6:\"TRIANGLE_FAN\",256:\"DEPTH_BUFFER_BIT\",512:\"NEVER\",513:\"LESS\",514:\"EQUAL\",515:\"LEQUAL\",516:\"GREATER\",517:\"NOTEQUAL\",518:\"GEQUAL\",519:\"ALWAYS\",768:\"SRC_COLOR\",769:\"ONE_MINUS_SRC_COLOR\",770:\"SRC_ALPHA\",771:\"ONE_MINUS_SRC_ALPHA\",772:\"DST_ALPHA\",773:\"ONE_MINUS_DST_ALPHA\",774:\"DST_COLOR\",775:\"ONE_MINUS_DST_COLOR\",776:\"SRC_ALPHA_SATURATE\",1024:\"STENCIL_BUFFER_BIT\",1028:\"FRONT\",1029:\"BACK\",1032:\"FRONT_AND_BACK\",1280:\"INVALID_ENUM\",1281:\"INVALID_VALUE\",1282:\"INVALID_OPERATION\",1285:\"OUT_OF_MEMORY\",1286:\"INVALID_FRAMEBUFFER_OPERATION\",2304:\"CW\",2305:\"CCW\",2849:\"LINE_WIDTH\",2884:\"CULL_FACE\",2885:\"CULL_FACE_MODE\",2886:\"FRONT_FACE\",2928:\"DEPTH_RANGE\",2929:\"DEPTH_TEST\",2930:\"DEPTH_WRITEMASK\",2931:\"DEPTH_CLEAR_VALUE\",2932:\"DEPTH_FUNC\",2960:\"STENCIL_TEST\",2961:\"STENCIL_CLEAR_VALUE\",2962:\"STENCIL_FUNC\",2963:\"STENCIL_VALUE_MASK\",2964:\"STENCIL_FAIL\",2965:\"STENCIL_PASS_DEPTH_FAIL\",2966:\"STENCIL_PASS_DEPTH_PASS\",2967:\"STENCIL_REF\",2968:\"STENCIL_WRITEMASK\",2978:\"VIEWPORT\",3024:\"DITHER\",3042:\"BLEND\",3088:\"SCISSOR_BOX\",3089:\"SCISSOR_TEST\",3106:\"COLOR_CLEAR_VALUE\",3107:\"COLOR_WRITEMASK\",3317:\"UNPACK_ALIGNMENT\",3333:\"PACK_ALIGNMENT\",3379:\"MAX_TEXTURE_SIZE\",3386:\"MAX_VIEWPORT_DIMS\",3408:\"SUBPIXEL_BITS\",3410:\"RED_BITS\",3411:\"GREEN_BITS\",3412:\"BLUE_BITS\",3413:\"ALPHA_BITS\",3414:\"DEPTH_BITS\",3415:\"STENCIL_BITS\",3553:\"TEXTURE_2D\",4352:\"DONT_CARE\",4353:\"FASTEST\",4354:\"NICEST\",5120:\"BYTE\",5121:\"UNSIGNED_BYTE\",5122:\"SHORT\",5123:\"UNSIGNED_SHORT\",5124:\"INT\",5125:\"UNSIGNED_INT\",5126:\"FLOAT\",5386:\"INVERT\",5890:\"TEXTURE\",6401:\"STENCIL_INDEX\",6402:\"DEPTH_COMPONENT\",6406:\"ALPHA\",6407:\"RGB\",6408:\"RGBA\",6409:\"LUMINANCE\",6410:\"LUMINANCE_ALPHA\",7680:\"KEEP\",7681:\"REPLACE\",7682:\"INCR\",7683:\"DECR\",7936:\"VENDOR\",7937:\"RENDERER\",7938:\"VERSION\",9728:\"NEAREST\",9729:\"LINEAR\",9984:\"NEAREST_MIPMAP_NEAREST\",9985:\"LINEAR_MIPMAP_NEAREST\",9986:\"NEAREST_MIPMAP_LINEAR\",9987:\"LINEAR_MIPMAP_LINEAR\",10240:\"TEXTURE_MAG_FILTER\",10241:\"TEXTURE_MIN_FILTER\",10242:\"TEXTURE_WRAP_S\",10243:\"TEXTURE_WRAP_T\",10497:\"REPEAT\",10752:\"POLYGON_OFFSET_UNITS\",16384:\"COLOR_BUFFER_BIT\",32769:\"CONSTANT_COLOR\",32770:\"ONE_MINUS_CONSTANT_COLOR\",32771:\"CONSTANT_ALPHA\",32772:\"ONE_MINUS_CONSTANT_ALPHA\",32773:\"BLEND_COLOR\",32774:\"FUNC_ADD\",32777:\"BLEND_EQUATION_RGB\",32778:\"FUNC_SUBTRACT\",32779:\"FUNC_REVERSE_SUBTRACT\",32819:\"UNSIGNED_SHORT_4_4_4_4\",32820:\"UNSIGNED_SHORT_5_5_5_1\",32823:\"POLYGON_OFFSET_FILL\",32824:\"POLYGON_OFFSET_FACTOR\",32854:\"RGBA4\",32855:\"RGB5_A1\",32873:\"TEXTURE_BINDING_2D\",32926:\"SAMPLE_ALPHA_TO_COVERAGE\",32928:\"SAMPLE_COVERAGE\",32936:\"SAMPLE_BUFFERS\",32937:\"SAMPLES\",32938:\"SAMPLE_COVERAGE_VALUE\",32939:\"SAMPLE_COVERAGE_INVERT\",32968:\"BLEND_DST_RGB\",32969:\"BLEND_SRC_RGB\",32970:\"BLEND_DST_ALPHA\",32971:\"BLEND_SRC_ALPHA\",33071:\"CLAMP_TO_EDGE\",33170:\"GENERATE_MIPMAP_HINT\",33189:\"DEPTH_COMPONENT16\",33306:\"DEPTH_STENCIL_ATTACHMENT\",33635:\"UNSIGNED_SHORT_5_6_5\",33648:\"MIRRORED_REPEAT\",33901:\"ALIASED_POINT_SIZE_RANGE\",33902:\"ALIASED_LINE_WIDTH_RANGE\",33984:\"TEXTURE0\",33985:\"TEXTURE1\",33986:\"TEXTURE2\",33987:\"TEXTURE3\",33988:\"TEXTURE4\",33989:\"TEXTURE5\",33990:\"TEXTURE6\",33991:\"TEXTURE7\",33992:\"TEXTURE8\",33993:\"TEXTURE9\",33994:\"TEXTURE10\",33995:\"TEXTURE11\",33996:\"TEXTURE12\",33997:\"TEXTURE13\",33998:\"TEXTURE14\",33999:\"TEXTURE15\",34e3:\"TEXTURE16\",34001:\"TEXTURE17\",34002:\"TEXTURE18\",34003:\"TEXTURE19\",34004:\"TEXTURE20\",34005:\"TEXTURE21\",34006:\"TEXTURE22\",34007:\"TEXTURE23\",34008:\"TEXTURE24\",34009:\"TEXTURE25\",34010:\"TEXTURE26\",34011:\"TEXTURE27\",34012:\"TEXTURE28\",34013:\"TEXTURE29\",34014:\"TEXTURE30\",34015:\"TEXTURE31\",34016:\"ACTIVE_TEXTURE\",34024:\"MAX_RENDERBUFFER_SIZE\",34041:\"DEPTH_STENCIL\",34055:\"INCR_WRAP\",34056:\"DECR_WRAP\",34067:\"TEXTURE_CUBE_MAP\",34068:\"TEXTURE_BINDING_CUBE_MAP\",34069:\"TEXTURE_CUBE_MAP_POSITIVE_X\",34070:\"TEXTURE_CUBE_MAP_NEGATIVE_X\",34071:\"TEXTURE_CUBE_MAP_POSITIVE_Y\",34072:\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",34073:\"TEXTURE_CUBE_MAP_POSITIVE_Z\",34074:\"TEXTURE_CUBE_MAP_NEGATIVE_Z\",34076:\"MAX_CUBE_MAP_TEXTURE_SIZE\",34338:\"VERTEX_ATTRIB_ARRAY_ENABLED\",34339:\"VERTEX_ATTRIB_ARRAY_SIZE\",34340:\"VERTEX_ATTRIB_ARRAY_STRIDE\",34341:\"VERTEX_ATTRIB_ARRAY_TYPE\",34342:\"CURRENT_VERTEX_ATTRIB\",34373:\"VERTEX_ATTRIB_ARRAY_POINTER\",34466:\"NUM_COMPRESSED_TEXTURE_FORMATS\",34467:\"COMPRESSED_TEXTURE_FORMATS\",34660:\"BUFFER_SIZE\",34661:\"BUFFER_USAGE\",34816:\"STENCIL_BACK_FUNC\",34817:\"STENCIL_BACK_FAIL\",34818:\"STENCIL_BACK_PASS_DEPTH_FAIL\",34819:\"STENCIL_BACK_PASS_DEPTH_PASS\",34877:\"BLEND_EQUATION_ALPHA\",34921:\"MAX_VERTEX_ATTRIBS\",34922:\"VERTEX_ATTRIB_ARRAY_NORMALIZED\",34930:\"MAX_TEXTURE_IMAGE_UNITS\",34962:\"ARRAY_BUFFER\",34963:\"ELEMENT_ARRAY_BUFFER\",34964:\"ARRAY_BUFFER_BINDING\",34965:\"ELEMENT_ARRAY_BUFFER_BINDING\",34975:\"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\",35040:\"STREAM_DRAW\",35044:\"STATIC_DRAW\",35048:\"DYNAMIC_DRAW\",35632:\"FRAGMENT_SHADER\",35633:\"VERTEX_SHADER\",35660:\"MAX_VERTEX_TEXTURE_IMAGE_UNITS\",35661:\"MAX_COMBINED_TEXTURE_IMAGE_UNITS\",35663:\"SHADER_TYPE\",35664:\"FLOAT_VEC2\",35665:\"FLOAT_VEC3\",35666:\"FLOAT_VEC4\",35667:\"INT_VEC2\",35668:\"INT_VEC3\",35669:\"INT_VEC4\",35670:\"BOOL\",35671:\"BOOL_VEC2\",35672:\"BOOL_VEC3\",35673:\"BOOL_VEC4\",35674:\"FLOAT_MAT2\",35675:\"FLOAT_MAT3\",35676:\"FLOAT_MAT4\",35678:\"SAMPLER_2D\",35680:\"SAMPLER_CUBE\",35712:\"DELETE_STATUS\",35713:\"COMPILE_STATUS\",35714:\"LINK_STATUS\",35715:\"VALIDATE_STATUS\",35716:\"INFO_LOG_LENGTH\",35717:\"ATTACHED_SHADERS\",35718:\"ACTIVE_UNIFORMS\",35719:\"ACTIVE_UNIFORM_MAX_LENGTH\",35720:\"SHADER_SOURCE_LENGTH\",35721:\"ACTIVE_ATTRIBUTES\",35722:\"ACTIVE_ATTRIBUTE_MAX_LENGTH\",35724:\"SHADING_LANGUAGE_VERSION\",35725:\"CURRENT_PROGRAM\",36003:\"STENCIL_BACK_REF\",36004:\"STENCIL_BACK_VALUE_MASK\",36005:\"STENCIL_BACK_WRITEMASK\",36006:\"FRAMEBUFFER_BINDING\",36007:\"RENDERBUFFER_BINDING\",36048:\"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\",36049:\"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\",36050:\"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\",36051:\"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\",36053:\"FRAMEBUFFER_COMPLETE\",36054:\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\",36055:\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\",36057:\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\",36061:\"FRAMEBUFFER_UNSUPPORTED\",36064:\"COLOR_ATTACHMENT0\",36096:\"DEPTH_ATTACHMENT\",36128:\"STENCIL_ATTACHMENT\",36160:\"FRAMEBUFFER\",36161:\"RENDERBUFFER\",36162:\"RENDERBUFFER_WIDTH\",36163:\"RENDERBUFFER_HEIGHT\",36164:\"RENDERBUFFER_INTERNAL_FORMAT\",36168:\"STENCIL_INDEX8\",36176:\"RENDERBUFFER_RED_SIZE\",36177:\"RENDERBUFFER_GREEN_SIZE\",36178:\"RENDERBUFFER_BLUE_SIZE\",36179:\"RENDERBUFFER_ALPHA_SIZE\",36180:\"RENDERBUFFER_DEPTH_SIZE\",36181:\"RENDERBUFFER_STENCIL_SIZE\",36194:\"RGB565\",36336:\"LOW_FLOAT\",36337:\"MEDIUM_FLOAT\",36338:\"HIGH_FLOAT\",36339:\"LOW_INT\",36340:\"MEDIUM_INT\",36341:\"HIGH_INT\",36346:\"SHADER_COMPILER\",36347:\"MAX_VERTEX_UNIFORM_VECTORS\",36348:\"MAX_VARYING_VECTORS\",36349:\"MAX_FRAGMENT_UNIFORM_VECTORS\",37440:\"UNPACK_FLIP_Y_WEBGL\",37441:\"UNPACK_PREMULTIPLY_ALPHA_WEBGL\",37442:\"CONTEXT_LOST_WEBGL\",37443:\"UNPACK_COLORSPACE_CONVERSION_WEBGL\",37444:\"BROWSER_DEFAULT_WEBGL\"}},{}],265:[function(t,e,r){var n=t(\"./1.0/numbers\");e.exports=function(t){return n[t]}},{\"./1.0/numbers\":264}],266:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e),o=i(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}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders/index\"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho||!1?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=u[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}l.update=function(t){\"lineWidth\"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),\"capSize\"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,\"opacity\"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));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 i=[],a=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;t:for(var l=0;l<a;++l){for(var u=r[l],h=0;h<3;++h)if(isNaN(u[h])||!isFinite(u[h]))continue t;var p=n[l],d=e[s];if(Array.isArray(d[0])&&(d=e[l]),3===d.length?d=[d[0],d[1],d[2],1]:4===d.length&&(d=[d[0],d[1],d[2],d[3]],!this.hasAlpha&&d[3]<1&&(this.hasAlpha=!0)),!isNaN(p[0][s])&&!isNaN(p[1][s])){var g;if(p[0][s]<0)(g=u.slice())[s]+=p[0][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,g),o+=2+f(i,g,d,s);if(p[1][s]>0)(g=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,g),o+=2+f(i,g,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{\"./shaders/index\":268,\"gl-buffer\":259,\"gl-vao\":358}],267:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],268:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision highp float;\\n#define GLSLIFY 1\\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}\"]),o=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float opacity;\\nvarying vec3 fragPosition;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if (\\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\\n fragColor.a * opacity == 0.\\n ) discard;\\n\\n gl_FragColor = opacity * fragColor;\\n}\"]);e.exports=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"offset\",type:\"vec3\"}])}},{\"gl-shader\":335,glslify:267}],269:[function(t,e,r){\"use strict\";var n=t(\"gl-texture2d\");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension(\"WEBGL_draw_buffers\");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(a=n;a<r;++a)i[a]=t.NONE;l[n]=i}}(t,c);Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]);if(\"number\"!=typeof e)throw new Error(\"gl-fbo: Missing shape parameter\");var u=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>u||r<0||r>u)throw new Error(\"gl-fbo: Parameters are too large for FBO\");var f=1;if(\"color\"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error(\"gl-fbo: Must specify a nonnegative number of colors\");if(f>1){if(!c)throw new Error(\"gl-fbo: Multiple draw buffer extension not supported\");if(f>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error(\"gl-fbo: Context does not support \"+f+\" draw buffers\")}}var h=t.UNSIGNED_BYTE,p=t.getExtension(\"OES_texture_float\");if(n.float&&f>0){if(!p)throw new Error(\"gl-fbo: Context does not support floating point textures\");h=t.FLOAT}else n.preferFloat&&f>0&&p&&(h=t.FLOAT);var g=!0;\"depth\"in n&&(g=!!n.depth);var m=!1;\"stencil\"in n&&(m=!!n.stencil);return new d(t,e,r,h,f,g,m,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error(\"gl-fbo: Framebuffer unsupported\");case a:throw new Error(\"gl-fbo: Framebuffer incomplete attachment\");case o:throw new Error(\"gl-fbo: Framebuffer incomplete dimensions\");case s:throw new Error(\"gl-fbo: Framebuffer incomplete missing attachment\");default:throw new Error(\"gl-fbo: Framebuffer failed for unspecified reason\")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(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 d(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 d=0;d<i;++d)this.color[d]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var g=this,m=[0|e,0|r];Object.defineProperties(m,{0:{get:function(){return g._shape[0]},set:function(t){return g.width=t}},1:{get:function(){return g._shape[1]},set:function(t){return g.height=t}}}),this._shapeVector=m,function(t){var e=c(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),i=t._shape[0],a=t._shape[1],o=t.color.length,s=t._ext,d=t._useStencil,g=t._useDepth,m=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var v=0;v<o;++v)t.color[v]=h(r,i,a,m,r.RGBA,r.COLOR_ATTACHMENT0+v);0===o?(t._color_rb=p(r,i,a,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension(\"WEBGL_depth_texture\");y?d?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==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(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),u(r,e),f(x)}u(r,e)}(this)}var g=d.prototype;function m(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 n=t.gl,i=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>i||r<0||r>i)throw new Error(\"gl-fbo: Can't resize FBO, invalid dimensions\");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),u(n,a),f(s)),u(n,a)}}Object.defineProperties(g,{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 m(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return m(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,m(this,this._shape[0],t),t},enumerable:!1}}),g.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])}},g.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\":353}],270:[function(t,e,r){var n=t(\"sprintf-js\").sprintf,i=t(\"gl-constants/lookup\"),a=t(\"glsl-shader-name\"),o=t(\"add-line-numbers\");e.exports=function(t,e,r){\"use strict\";var s=a(e)||\"of unknown name (see npm glsl-shader-name)\",l=\"unknown type\";void 0!==r&&(l=r===i.FRAGMENT_SHADER?\"fragment\":\"vertex\");for(var c=n(\"Error compiling %s shader %s:\\n\",l,s),u=n(\"%s%s\",c,t),f=t.split(\"\\n\"),h={},p=0;p<f.length;p++){var d=f[p];if(\"\"!==d&&\"\\0\"!==d){var g=parseInt(d.split(\":\")[2]);if(isNaN(g))throw new Error(n(\"Could not parse error: %s\",d));h[g]=d}}var m=o(e).split(\"\\n\");for(p=0;p<m.length;p++)if(h[p+3]||h[p+2]||h[p+1]){var v=m[p];if(c+=v+\"\\n\",h[p+1]){var y=h[p+1];y=y.substr(y.split(\":\",3).join(\":\").length+1).trim(),c+=n(\"^^^ %s\\n\\n\",y)}}return{long:c.trim(),short:u.trim()}}},{\"add-line-numbers\":66,\"gl-constants/lookup\":265,\"glsl-shader-name\":431,\"sprintf-js\":567}],271:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=t.gl,n=o(r,l.vertex,l.fragment),i=o(r,l.pickVertex,l.pickFragment),a=s(r),u=s(r),f=s(r),h=s(r),p=new c(t,n,i,a,u,f,h);return p.update(e),t.addObject(p),p};var n=t(\"binary-search-bounds\"),i=t(\"iota-array\"),a=t(\"typedarray-pool\"),o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"./lib/shaders\");function c(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}var u,f=c.prototype,h=[0,0,1,0,0,1,1,0,1,1,0,1];f.draw=(u=[1,0,0,0,1,0,0,0,1],function(){var t=this.plot,e=this.shader,r=this.bounds,n=this.numVertices;if(!(n<=0)){var i=t.gl,a=t.dataBox,o=r[2]-r[0],s=r[3]-r[1],l=a[2]-a[0],c=a[3]-a[1];u[0]=2*o/l,u[4]=2*s/c,u[6]=2*(r[0]-a[0])/l-1,u[7]=2*(r[1]-a[1])/c-1,e.bind();var f=e.uniforms;f.viewTransform=u,f.shape=this.shape;var h=e.attributes;this.positionBuffer.bind(),h.position.pointer(),this.weightBuffer.bind(),h.weight.pointer(i.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),h.color.pointer(i.UNSIGNED_BYTE,!0),i.drawArrays(i.TRIANGLES,0,n)}}),f.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.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,c=a[2]-a[0],u=a[3]-a[1],f=l[2]-l[0],h=l[3]-l[1];t[0]=2*c/f,t[4]=2*u/h,t[6]=2*(a[0]-l[0])/f-1,t[7]=2*(a[1]-l[1])/h-1;for(var p=0;p<4;++p)e[p]=r>>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var g=i.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r<n||r>=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var c,u,f,p,d=t.colorLevels||[0],g=t.colorValues||[0,0,0,1],m=d.length,v=this.bounds;l?(c=v[0]=r[0],u=v[1]=o[0],f=v[2]=r[r.length-1],p=v[3]=o[o.length-1]):(c=v[0]=r[0]+(r[1]-r[0])/2,u=v[1]=o[0]+(o[1]-o[0])/2,f=v[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=v[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-c),x=1/(p-u),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(h.length>>>1);this.numVertices=w;for(var T=a.mallocUint8(4*w),k=a.mallocFloat32(2*w),M=a.mallocUint8(2*w),A=a.mallocUint32(w),S=0,E=l?b-1:b,C=l?_-1:_,L=0;L<C;++L){var I,P;l?(I=x*(o[L]-u),P=x*(o[L+1]-u)):(I=L<_-1?x*(o[L]-(o[L+1]-o[L])/2-u):x*(o[L]-(o[L]-o[L-1])/2-u),P=L<_-1?x*(o[L]+(o[L+1]-o[L])/2-u):x*(o[L]+(o[L]-o[L-1])/2-u));for(var z=0;z<E;++z){var O,D;l?(O=y*(r[z]-c),D=y*(r[z+1]-c)):(O=z<b-1?y*(r[z]-(r[z+1]-r[z])/2-c):y*(r[z]-(r[z]-r[z-1])/2-c),D=z<b-1?y*(r[z]+(r[z+1]-r[z])/2-c):y*(r[z]+(r[z]-r[z-1])/2-c));for(var R=0;R<h.length;R+=2){var F,B,N,j,U=h[R],V=h[R+1],q=s[l?(L+V)*b+(z+U):L*b+z],H=n.le(d,q);if(H<0)F=g[0],B=g[1],N=g[2],j=g[3];else if(H===m-1)F=g[4*m-4],B=g[4*m-3],N=g[4*m-2],j=g[4*m-1];else{var G=(q-d[H])/(d[H+1]-d[H]),Y=1-G,W=4*H,X=4*(H+1);F=Y*g[W]+G*g[X],B=Y*g[W+1]+G*g[X+1],N=Y*g[W+2]+G*g[X+2],j=Y*g[W+3]+G*g[X+3]}T[4*S]=255*F,T[4*S+1]=255*B,T[4*S+2]=255*N,T[4*S+3]=255*j,k[2*S]=.5*O+.5*D,k[2*S+1]=.5*I+.5*P,M[2*S]=U,M[2*S+1]=V,A[S]=L*b+z,S+=1}}}this.positionBuffer.update(k),this.weightBuffer.update(M),this.colorBuffer.update(T),this.idBuffer.update(A),a.free(k),a.free(T),a.free(M),a.free(A)},f.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{\"./lib/shaders\":272,\"binary-search-bounds\":96,\"gl-buffer\":259,\"gl-shader\":335,\"iota-array\":463,\"typedarray-pool\":595}],272:[function(t,e,r){\"use strict\";var n=t(\"glslify\");e.exports={fragment:n([\"precision lowp float;\\n#define GLSLIFY 1\\nvarying vec4 fragColor;\\nvoid main() {\\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\\n}\\n\"]),vertex:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 color;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n fragColor = color;\\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\"]),pickFragment:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nuniform vec2 shape;\\nuniform vec4 pickOffset;\\n\\nvoid main() {\\n vec2 d = step(.5, vWeight);\\n vec4 id = fragId + pickOffset;\\n id.x += d.x + d.y*shape.x;\\n\\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 gl_FragColor = id/255.;\\n}\\n\"]),pickVertex:n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nvoid main() {\\n vWeight = weight;\\n\\n fragId = pickId;\\n\\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\"])}},{glslify:273}],273:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],274:[function(t,e,r){var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision highp float;\\n#define GLSLIFY 1\\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\\nvec4 project(vec3 p) {\\n return projection * view * model * vec4(p, 1.0);\\n}\\n\\nvoid main() {\\n vec4 startPoint = project(position);\\n vec4 endPoint = project(nextPosition);\\n\\n vec2 A = startPoint.xy / startPoint.w;\\n vec2 B = endPoint.xy / endPoint.w;\\n\\n float clipAngle = atan(\\n (B.y - A.y) * screenShape.y,\\n (B.x - A.x) * screenShape.x\\n );\\n\\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\\n sin(clipAngle),\\n -cos(clipAngle)\\n ) / screenShape;\\n\\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\\n\\n worldPosition = position;\\n pixelArcLength = arcLength;\\n fragColor = color;\\n}\\n\"]),o=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\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 (\\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\\n fragColor.a * opacity == 0.\\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\"]),s=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\n#define FLOAT_MAX 1.70141184e38\\n#define FLOAT_MIN 1.17549435e-38\\n\\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\\nvec4 packFloat(float v) {\\n 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 vec4 c = vec4(0,0,0,0);\\n\\n //Compute exponent and mantissa\\n float e = floor(log2(av));\\n 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 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\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform float pickId;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\\n\\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\\n}\"]),l=[{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 i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{\"gl-shader\":335,glslify:276}],275:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(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 o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var g=new v(e,r,o,s,l,d);return g.update(t),g};var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"gl-texture2d\"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t(\"binary-search-bounds\"),c=t(\"ndarray\"),u=t(\"./lib/shaders\"),f=u.createShader,h=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function g(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function m(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(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.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:g(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),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:g(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;\"dashScale\"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,\"opacity\"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var p=t.color||t.colors||[0,0,0,1],g=t.lineWidth||1,m=!1;t:for(e=1;e<h.length;++e){var v,y,x,b=h[e-1],_=h[e];for(a.push(s),o.push(b.slice()),r=0;r<3;++r){if(isNaN(b[r])||isNaN(_[r])||!isFinite(b[r])||!isFinite(_[r])){if(!n&&i.length>0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,m=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(v=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):v=y=p,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),x=Array.isArray(g)?g.length>e-1?g[e-1]:g.length>0?g[g.length-1]:[0,0,0,1]:g;var T=s;if(s+=d(b,_),m){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3]);u+=2,m=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=u,this.points=o,this.arcLength=a,\"dashes\"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[e];var M=c(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)M.set(e,0,r,0);1&l.le(k,k[k.length-1]*e/255)?M.set(e,0,0,0):M.set(e,0,0,255)}this.texture.setPixels(M)}},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=function(t,e,r,n){return o[0]=n,o[1]=r,o[2]=e,o[3]=t,s[0]}(t.value[0],t.value[1],t.value[2],0),r=l.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new m(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)],a=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),c=1-a,u=[0,0,0],f=0;f<3;++f)u[f]=c*n[f]+a*i[f];var h=Math.min(a<.5?r:r+1,this.points.length-1);return new m(e,u,h,this.points[h])}},{\"./lib/shaders\":274,\"binary-search-bounds\":96,\"gl-buffer\":259,\"gl-texture2d\":353,\"gl-vao\":358,ndarray:495}],276:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],277:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(h*v-p*m)-f*(l*v-c*m)+g*(l*p-c*h),t[1]=-(n*(h*v-p*m)-f*(i*v-a*m)+g*(i*p-a*h)),t[2]=n*(l*v-c*m)-s*(i*v-a*m)+g*(i*c-a*l),t[3]=-(n*(l*p-c*h)-s*(i*p-a*h)+f*(i*c-a*l)),t[4]=-(o*(h*v-p*m)-u*(l*v-c*m)+d*(l*p-c*h)),t[5]=r*(h*v-p*m)-u*(i*v-a*m)+d*(i*p-a*h),t[6]=-(r*(l*v-c*m)-o*(i*v-a*m)+d*(i*c-a*l)),t[7]=r*(l*p-c*h)-o*(i*p-a*h)+u*(i*c-a*l),t[8]=o*(f*v-p*g)-u*(s*v-c*g)+d*(s*p-c*f),t[9]=-(r*(f*v-p*g)-u*(n*v-a*g)+d*(n*p-a*f)),t[10]=r*(s*v-c*g)-o*(n*v-a*g)+d*(n*c-a*s),t[11]=-(r*(s*p-c*f)-o*(n*p-a*f)+u*(n*c-a*s)),t[12]=-(o*(f*m-h*g)-u*(s*m-l*g)+d*(s*h-l*f)),t[13]=r*(f*m-h*g)-u*(n*m-i*g)+d*(n*h-i*f),t[14]=-(r*(s*m-l*g)-o*(n*m-i*g)+d*(n*l-i*s)),t[15]=r*(s*h-l*f)-o*(n*h-i*f)+u*(n*l-i*s),t}},{}],278:[function(t,e,r){e.exports=function(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}},{}],279:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],280:[function(t,e,r){e.exports=function(){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}},{}],281:[function(t,e,r){e.exports=function(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],c=t[8],u=t[9],f=t[10],h=t[11],p=t[12],d=t[13],g=t[14],m=t[15];return(e*o-r*a)*(f*m-h*g)-(e*s-n*a)*(u*m-h*d)+(e*l-i*a)*(u*g-f*d)+(r*s-n*o)*(c*m-h*p)-(r*l-i*o)*(c*g-f*p)+(n*l-i*s)*(c*d-u*p)}},{}],282:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,p=i*s,d=i*l,g=a*o,m=a*s,v=a*l;return t[0]=1-f-d,t[1]=u+v,t[2]=h-m,t[3]=0,t[4]=u-v,t[5]=1-c-d,t[6]=p+g,t[7]=0,t[8]=h+m,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],283:[function(t,e,r){e.exports=function(t,e,r){var n,i,a,o=r[0],s=r[1],l=r[2],c=Math.sqrt(o*o+s*s+l*l);if(Math.abs(c)<1e-6)return null;return o*=c=1/c,s*=c,l*=c,n=Math.sin(e),i=Math.cos(e),a=1-i,t[0]=o*o*a+i,t[1]=s*o*a+l*n,t[2]=l*o*a-s*n,t[3]=0,t[4]=o*s*a-l*n,t[5]=s*s*a+i,t[6]=l*s*a+o*n,t[7]=0,t[8]=o*l*a+s*n,t[9]=s*l*a-o*n,t[10]=l*l*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],284:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,c=a+a,u=n*s,f=n*l,h=n*c,p=i*l,d=i*c,g=a*c,m=o*s,v=o*l,y=o*c;return t[0]=1-(p+g),t[1]=f+y,t[2]=h-v,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=d+m,t[7]=0,t[8]=h+v,t[9]=d-m,t[10]=1-(u+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],285:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],286:[function(t,e,r){e.exports=function(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}},{}],287:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],288:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],289:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],290:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t}},{}],291:[function(t,e,r){e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],292:[function(t,e,r){e.exports={create:t(\"./create\"),clone:t(\"./clone\"),copy:t(\"./copy\"),identity:t(\"./identity\"),transpose:t(\"./transpose\"),invert:t(\"./invert\"),adjoint:t(\"./adjoint\"),determinant:t(\"./determinant\"),multiply:t(\"./multiply\"),translate:t(\"./translate\"),scale:t(\"./scale\"),rotate:t(\"./rotate\"),rotateX:t(\"./rotateX\"),rotateY:t(\"./rotateY\"),rotateZ:t(\"./rotateZ\"),fromRotation:t(\"./fromRotation\"),fromRotationTranslation:t(\"./fromRotationTranslation\"),fromScaling:t(\"./fromScaling\"),fromTranslation:t(\"./fromTranslation\"),fromXRotation:t(\"./fromXRotation\"),fromYRotation:t(\"./fromYRotation\"),fromZRotation:t(\"./fromZRotation\"),fromQuat:t(\"./fromQuat\"),frustum:t(\"./frustum\"),perspective:t(\"./perspective\"),perspectiveFromFieldOfView:t(\"./perspectiveFromFieldOfView\"),ortho:t(\"./ortho\"),lookAt:t(\"./lookAt\"),str:t(\"./str\")}},{\"./adjoint\":277,\"./clone\":278,\"./copy\":279,\"./create\":280,\"./determinant\":281,\"./fromQuat\":282,\"./fromRotation\":283,\"./fromRotationTranslation\":284,\"./fromScaling\":285,\"./fromTranslation\":286,\"./fromXRotation\":287,\"./fromYRotation\":288,\"./fromZRotation\":289,\"./frustum\":290,\"./identity\":291,\"./invert\":293,\"./lookAt\":294,\"./multiply\":295,\"./ortho\":296,\"./perspective\":297,\"./perspectiveFromFieldOfView\":298,\"./rotate\":299,\"./rotateX\":300,\"./rotateY\":301,\"./rotateZ\":302,\"./scale\":303,\"./str\":304,\"./translate\":305,\"./transpose\":306}],293:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],y=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,T=i*c-a*l,k=u*g-f*d,M=u*m-h*d,A=u*v-p*d,S=f*m-h*g,E=f*v-p*g,C=h*v-p*m,L=y*C-x*E+b*S+_*A-w*M+T*k;if(!L)return null;return L=1/L,t[0]=(s*C-l*E+c*S)*L,t[1]=(i*E-n*C-a*S)*L,t[2]=(g*T-m*w+v*_)*L,t[3]=(h*w-f*T-p*_)*L,t[4]=(l*A-o*C-c*M)*L,t[5]=(r*C-i*A+a*M)*L,t[6]=(m*b-d*T-v*x)*L,t[7]=(u*T-h*b+p*x)*L,t[8]=(o*E-s*A+c*k)*L,t[9]=(n*A-r*E-a*k)*L,t[10]=(d*w-g*b+v*y)*L,t[11]=(f*b-u*w-p*y)*L,t[12]=(s*M-o*S-l*k)*L,t[13]=(r*S-n*M+i*k)*L,t[14]=(g*x-d*_-m*y)*L,t[15]=(u*_-f*x+h*y)*L,t}},{}],294:[function(t,e,r){var n=t(\"./identity\");e.exports=function(t,e,r,i){var a,o,s,l,c,u,f,h,p,d,g=e[0],m=e[1],v=e[2],y=i[0],x=i[1],b=i[2],_=r[0],w=r[1],T=r[2];if(Math.abs(g-_)<1e-6&&Math.abs(m-w)<1e-6&&Math.abs(v-T)<1e-6)return n(t);f=g-_,h=m-w,p=v-T,d=1/Math.sqrt(f*f+h*h+p*p),a=x*(p*=d)-b*(h*=d),o=b*(f*=d)-y*p,s=y*h-x*f,(d=Math.sqrt(a*a+o*o+s*s))?(a*=d=1/d,o*=d,s*=d):(a=0,o=0,s=0);l=h*s-p*o,c=p*a-f*s,u=f*o-h*a,(d=Math.sqrt(l*l+c*c+u*u))?(l*=d=1/d,c*=d,u*=d):(l=0,c=0,u=0);return t[0]=a,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=s,t[9]=u,t[10]=p,t[11]=0,t[12]=-(a*g+o*m+s*v),t[13]=-(l*g+c*m+u*v),t[14]=-(f*g+h*m+p*v),t[15]=1,t}},{\"./identity\":291}],295:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],p=e[10],d=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*f+w*g,t[1]=x*i+b*l+_*h+w*m,t[2]=x*a+b*c+_*p+w*v,t[3]=x*o+b*u+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*f+w*g,t[5]=x*i+b*l+_*h+w*m,t[6]=x*a+b*c+_*p+w*v,t[7]=x*o+b*u+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*f+w*g,t[9]=x*i+b*l+_*h+w*m,t[10]=x*a+b*c+_*p+w*v,t[11]=x*o+b*u+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*f+w*g,t[13]=x*i+b*l+_*h+w*m,t[14]=x*a+b*c+_*p+w*v,t[15]=x*o+b*u+_*d+w*y,t}},{}],296:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t}},{}],297:[function(t,e,r){e.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}},{}],298:[function(t,e,r){e.exports=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}},{}],299:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c,u,f,h,p,d,g,m,v,y,x,b,_,w,T,k,M,A,S,E=n[0],C=n[1],L=n[2],I=Math.sqrt(E*E+C*C+L*L);if(Math.abs(I)<1e-6)return null;E*=I=1/I,C*=I,L*=I,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],c=e[2],u=e[3],f=e[4],h=e[5],p=e[6],d=e[7],g=e[8],m=e[9],v=e[10],y=e[11],x=E*E*o+a,b=C*E*o+L*i,_=L*E*o-C*i,w=E*C*o-L*i,T=C*C*o+a,k=L*C*o+E*i,M=E*L*o+C*i,A=C*L*o-E*i,S=L*L*o+a,t[0]=s*x+f*b+g*_,t[1]=l*x+h*b+m*_,t[2]=c*x+p*b+v*_,t[3]=u*x+d*b+y*_,t[4]=s*w+f*T+g*k,t[5]=l*w+h*T+m*k,t[6]=c*w+p*T+v*k,t[7]=u*w+d*T+y*k,t[8]=s*M+f*A+g*S,t[9]=l*M+h*A+m*S,t[10]=c*M+p*A+v*S,t[11]=u*M+d*A+y*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],300:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],h=e[11];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]);return t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+f*n,t[7]=l*i+h*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=f*i-s*n,t[11]=h*i-l*n,t}},{}],301:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[8],u=e[9],f=e[10],h=e[11];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]);return t[0]=a*i-c*n,t[1]=o*i-u*n,t[2]=s*i-f*n,t[3]=l*i-h*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+f*i,t[11]=l*n+h*i,t}},{}],302:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],f=e[6],h=e[7];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]);return t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+f*n,t[3]=l*i+h*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=f*i-s*n,t[7]=h*i-l*n,t}},{}],303:[function(t,e,r){e.exports=function(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}},{}],304:[function(t,e,r){e.exports=function(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}},{}],305:[function(t,e,r){e.exports=function(t,e,r){var n,i,a,o,s,l,c,u,f,h,p,d,g=r[0],m=r[1],v=r[2];e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=n*g+s*m+f*v+e[12],t[13]=i*g+l*m+h*v+e[13],t[14]=a*g+c*m+p*v+e[14],t[15]=o*g+u*m+d*v+e[15]);return t}},{}],306:[function(t,e,r){e.exports=function(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}},{}],307:[function(t,e,r){\"use strict\";var n=t(\"barycentric\"),i=t(\"polytope-closest-point/lib/closest_point_2d.js\");function a(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function o(t,e,r,n,i){for(var o=a(n,a(r,a(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*i[0]*(1+o[0]),.5*i[1]*(1-o[1])]}function s(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}e.exports=function(t,e,r,a,l,c){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),f=0;f<t.length;++f)u[f]=o(t[f],r,a,l,c);var h=0,p=1/0;for(f=0;f<u.length;++f){for(var d=0,g=0;g<2;++g)d+=Math.pow(u[f][g]-e[g],2);d<p&&(p=d,h=f)}var m=function(t,e){if(2===t.length){for(var r=0,a=0,o=0;o<2;++o)r+=Math.pow(e[o]-t[0][o],2),a+=Math.pow(e[o]-t[1][o],2);return r=Math.sqrt(r),a=Math.sqrt(a),r+a<1e-6?[1,0]:[a/(r+a),r/(a+r)]}if(3===t.length){var s=[0,0];return i(t[0],t[1],t[2],e,s),n(t,s)}return[]}(u,e),v=0;for(f=0;f<3;++f){if(m[f]<-.001||m[f]>1.0001)return null;v+=m[f]}if(Math.abs(v-1)>.001)return null;return[h,s(t,m),m]}},{barycentric:78,\"polytope-closest-point/lib/closest_point_2d.js\":525}],308:[function(t,e,r){var n=t(\"glslify\"),i=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, normal;\\nattribute vec4 color;\\nattribute vec2 uv;\\n\\nuniform mat4 model\\n , view\\n , projection\\n , inverseModel;\\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\\nvec4 project(vec3 p) {\\n return projection * view * model * vec4(p, 1.0);\\n}\\n\\nvoid main() {\\n gl_Position = project(position);\\n\\n //Lighting geometry parameters\\n vec4 cameraCoordinate = view * vec4(position , 1.0);\\n cameraCoordinate.xyz /= cameraCoordinate.w;\\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\\n\\n f_color = color;\\n f_data = position;\\n f_uv = uv;\\n}\\n\"]),a=n([\"#extension GL_OES_standard_derivatives : enable\\n\\nprecision highp float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution(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\\nfloat cookTorranceSpecular(\\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float roughness\\n , fresnel\\n , kambient\\n , kdiffuse\\n , kspecular;\\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 (f_color.a == 0.0 ||\\n outOfRange(clipBounds[0], clipBounds[1], f_data)\\n ) discard;\\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\\n\\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\\n}\\n\"]),o=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 uv;\\n\\nuniform mat4 model, view, projection;\\n\\nvarying vec4 f_color;\\nvarying vec3 f_data;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n f_color = color;\\n f_data = position;\\n f_uv = uv;\\n}\"]),s=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\\n\\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\\n}\"]),l=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\\n\\n gl_Position = vec4(0.0, 0.0 ,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}\"]),c=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform sampler2D texture;\\nuniform float opacity;\\n\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\\n if(dot(pointR, pointR) > 0.25) {\\n discard;\\n }\\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\\n}\"]),u=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n f_id = id;\\n f_position = position;\\n}\"]),f=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\\n\\n gl_FragColor = vec4(pickId, f_id.xyz);\\n}\"]),h=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\\n\\n gl_Position = vec4(0.0, 0.0, 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}\"]),p=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n}\"]),d=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform vec3 contourColor;\\n\\nvoid main() {\\n gl_FragColor = vec4(contourColor, 1.0);\\n}\\n\"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"},{name:\"pointSize\",type:\"float\"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:\"position\",type:\"vec3\"},{name:\"id\",type:\"vec4\"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:\"position\",type:\"vec3\"},{name:\"pointSize\",type:\"float\"},{name:\"id\",type:\"vec4\"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:\"position\",type:\"vec3\"}]}},{glslify:310}],309:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=t(\"gl-texture2d\"),s=t(\"normals\"),l=t(\"gl-mat4/multiply\"),c=t(\"gl-mat4/invert\"),u=t(\"ndarray\"),f=t(\"colormap\"),h=t(\"simplicial-complex-contour\"),p=t(\"typedarray-pool\"),d=t(\"./lib/shaders\"),g=t(\"./lib/closest-point\"),m=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m,v,y,x,b,_,T,k,M,A,S){this.gl=t,this.pixelRatio=1,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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=m,this.edgeUVs=v,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=k,this.pointIds=b,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function M(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function A(t){var e=n(t,m.vertex,m.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function S(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function E(t){var e=n(t,y.vertex,y.fragment);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=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function L(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function I(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var c=r[l],u=0;u<2;++u){var f=c[0];2===c.length&&(f=c[u]);for(var d=n[f][0],g=n[f][1],m=i[f],v=1-m,y=this.positions[d],x=this.positions[g],b=0;b<3;++b)o[s++]=m*y[b]+v*x[b]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),p.free(o)}else this.contourCount=0},k.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),\"lightPosition\"in t&&(this.lightPosition=t.lightPosition),this.hasAlpha=!1,\"opacity\"in t&&(this.opacity=t.opacity,this.opacity<1&&(this.hasAlpha=!0)),\"opacityscale\"in t&&(this.opacityscale=t.opacityscale,this.hasAlpha=!0),\"ambient\"in t&&(this.ambientLight=t.ambient),\"diffuse\"in t&&(this.diffuseLight=t.diffuse),\"specular\"in t&&(this.specularLight=t.specular),\"roughness\"in t&&(this.roughness=t.roughness),\"fresnel\"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=o(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(function(t,e){for(var r=f({colormap:t,nshades:256,format:\"rgba\"}),n=new Uint8Array(1024),i=0;i<256;++i){for(var a=r[i],o=0;o<3;++o)n[4*i+o]=a[o];n[4*i+3]=e?255*M(i/255,e):255*a[3]}return u(n,[256,256,4],[4,0,1])}(t.colormap,this.opacityscale)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var i=[],a=[],l=[],c=[],h=[],p=[],d=[],g=[],m=[],v=[],y=[],x=[],b=[],_=[];this.cells=r,this.positions=n;var w=t.vertexNormals,T=t.cellNormals,k=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,A=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=s.faceNormals(r,n,A)),T||w||(w=s.vertexNormals(r,n,k));var S=t.vertexColors,E=t.cellColors,C=t.meshColor||[1,1,1,1],L=t.vertexUVs,I=t.vertexIntensity,P=t.cellUVs,z=t.cellIntensity,O=1/0,D=-1/0;if(!L&&!P)if(I)if(t.vertexIntensityBounds)O=+t.vertexIntensityBounds[0],D=+t.vertexIntensityBounds[1];else for(var R=0;R<I.length;++R){var F=I[R];O=Math.min(O,F),D=Math.max(D,F)}else if(z)if(t.cellIntensityBounds)O=+t.cellIntensityBounds[0],D=+t.cellIntensityBounds[1];else for(R=0;R<z.length;++R){F=z[R];O=Math.min(O,F),D=Math.max(D,F)}else for(R=0;R<n.length;++R){F=n[R][2];O=Math.min(O,F),D=Math.max(D,F)}this.intensity=I||(z||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n)),this.pickVertex=!(z||E);var B=t.pointSizes,N=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(R=0;R<n.length;++R)for(var j=n[R],U=0;U<3;++U)!isNaN(j[U])&&isFinite(j[U])&&(this.bounds[0][U]=Math.min(this.bounds[0][U],j[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],j[U]));var V=0,q=0,H=0;t:for(R=0;R<r.length;++R){var G=r[R];switch(G.length){case 1:for(j=n[W=G[0]],U=0;U<3;++U)if(isNaN(j[U])||!isFinite(j[U]))continue t;v.push(j[0],j[1],j[2]),X=S?S[W]:E?E[R]:C,this.opacityscale&&I?a.push(X[0],X[1],X[2],this.opacity*M((I[W]-O)/(D-O),this.opacityscale)):3===X.length?y.push(X[0],X[1],X[2],this.opacity):(y.push(X[0],X[1],X[2],X[3]*this.opacity),X[3]<1&&(this.hasAlpha=!0)),Z=L?L[W]:I?[(I[W]-O)/(D-O),0]:P?P[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],x.push(Z[0],Z[1]),B?b.push(B[W]):b.push(N),_.push(R),H+=1;break;case 2:for(U=0;U<2;++U){j=n[W=G[U]];for(var Y=0;Y<3;++Y)if(isNaN(j[Y])||!isFinite(j[Y]))continue t}for(U=0;U<2;++U){j=n[W=G[U]];p.push(j[0],j[1],j[2]),X=S?S[W]:E?E[R]:C,this.opacityscale&&I?a.push(X[0],X[1],X[2],this.opacity*M((I[W]-O)/(D-O),this.opacityscale)):3===X.length?d.push(X[0],X[1],X[2],this.opacity):(d.push(X[0],X[1],X[2],X[3]*this.opacity),X[3]<1&&(this.hasAlpha=!0)),Z=L?L[W]:I?[(I[W]-O)/(D-O),0]:P?P[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],g.push(Z[0],Z[1]),m.push(R)}q+=1;break;case 3:for(U=0;U<3;++U)for(j=n[W=G[U]],Y=0;Y<3;++Y)if(isNaN(j[Y])||!isFinite(j[Y]))continue t;for(U=0;U<3;++U){var W,X,Z,J;j=n[W=G[2-U]];i.push(j[0],j[1],j[2]),(X=S?S[W]:E?E[R]:C)?this.opacityscale&&I?a.push(X[0],X[1],X[2],this.opacity*M((I[W]-O)/(D-O),this.opacityscale)):3===X.length?a.push(X[0],X[1],X[2],this.opacity):(a.push(X[0],X[1],X[2],X[3]*this.opacity),X[3]<1&&(this.hasAlpha=!0)):a.push(.5,.5,.5,1),Z=L?L[W]:I?[(I[W]-O)/(D-O),0]:P?P[R]:z?[(z[R]-O)/(D-O),0]:[(j[2]-O)/(D-O),0],c.push(Z[0],Z[1]),J=w?w[W]:T[R],l.push(J[0],J[1],J[2]),h.push(R)}V+=1}}this.pointCount=H,this.edgeCount=q,this.triangleCount=V,this.pointPositions.update(v),this.pointColors.update(y),this.pointUVs.update(x),this.pointSizes.update(b),this.pointIds.update(new Uint32Array(_)),this.edgePositions.update(p),this.edgeColors.update(d),this.edgeUVs.update(g),this.edgeIds.update(new Uint32Array(m)),this.trianglePositions.update(i),this.triangleColors.update(a),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(h))}},k.drawTransparent=k.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,inverseModel:w.slice(),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],contourColor:this.contourColor,texture:0};s.inverseModel=c(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u=new Array(16);l(u,s.view,s.model),l(u,s.projection,u),c(u,u);for(o=0;o<3;++o)s.eyePosition[o]=u[12+o]/u[15];var f,h=u[15];for(o=0;o<3;++o)h+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],d=0;d<3;++d)p+=u[4*d+o]*this.lightPosition[d];s.lightPosition[o]=p/h}this.triangleCount>0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.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=t.coord[0],s=t.coord[1];if(!this.pickVertex){var l=this.positions[r[0]],c=this.positions[r[1]],u=this.positions[r[2]],f=[(l[0]+c[0]+u[0])/3,(l[1]+c[1]+u[1])/3,(l[2]+c[2]+u[2])/3];return{_cellCenter:!0,position:[o,s],index:e,cell:r,cellId:e,intensity:this.intensity[e],dataCoordinate:f}}var h=g(i,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!h)return null;var p=h[2],d=0;for(a=0;a<r.length;++a)d+=p[a]*this.intensity[r[a]];return{position:h[1],index:r[h[0]],cell:r,cellId:e,intensity:d,dataCoordinate:this.positions[r[h[0]]]}},k.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=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=t.getExtension(\"OES_standard_derivatives\")||t.getExtension(\"MOZ_OES_standard_derivatives\")||t.getExtension(\"WEBKIT_OES_standard_derivatives\");if(!r)throw new Error(\"derivatives not supported\");var n=A(t),s=S(t),l=E(t),c=C(t),f=L(t),h=I(t),p=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));p.generateMipmap(),p.minFilter=t.LINEAR_MIPMAP_LINEAR,p.magFilter=t.LINEAR;var d=i(t),g=i(t),m=i(t),v=i(t),y=i(t),x=a(t,[{buffer:d,type:t.FLOAT,size:3},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:t.FLOAT,size:4},{buffer:m,type:t.FLOAT,size:2},{buffer:v,type:t.FLOAT,size:3}]),b=i(t),_=i(t),w=i(t),k=i(t),M=a(t,[{buffer:b,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),P=i(t),z=i(t),O=i(t),D=i(t),R=i(t),F=a(t,[{buffer:P,type:t.FLOAT,size:3},{buffer:R,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:t.FLOAT,size:4},{buffer:O,type:t.FLOAT,size:2},{buffer:D,type:t.FLOAT,size:1}]),B=i(t),N=a(t,[{buffer:B,type:t.FLOAT,size:3}]),j=new T(t,p,n,s,l,c,f,h,d,y,g,m,v,x,b,k,_,w,M,P,R,z,O,D,F,B,N);return j.update(e),j}},{\"./lib/closest-point\":307,\"./lib/shaders\":308,colormap:131,\"gl-buffer\":259,\"gl-mat4/invert\":293,\"gl-mat4/multiply\":295,\"gl-shader\":335,\"gl-texture2d\":353,\"gl-vao\":358,ndarray:495,normals:498,\"simplicial-complex-contour\":556,\"typedarray-pool\":595}],310:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],311:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e,[0,0,0,1,1,0,1,1]),s=i(e,a.boxVert,a.lineFrag);return new o(t,r,s)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"./shaders\");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawBox=(s=[0,0],l=[0,0],function(t,e,r,n,i){var a=this.plot,o=this.shader,c=a.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,o.uniforms.lo=s,o.uniforms.hi=l,o.uniforms.color=i,c.drawArrays(c.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":314,\"gl-buffer\":259,\"gl-shader\":335}],312:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e),a=i(e,o.gridVert,o.gridFrag),l=i(e,o.tickVert,o.gridFrag);return new s(t,r,a,l)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"binary-search-bounds\"),o=t(\"./shaders\");function s(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function l(t,e){return t-e}var c,u,f,h,p,d=s.prototype;d.draw=(c=[0,0],u=[0,0],f=[0,0],function(){for(var t=this.plot,e=this.vbo,r=this.shader,n=this.ticks,i=t.gl,a=t._tickBounds,o=t.dataBox,s=t.viewBox,l=t.gridLineWidth,h=t.gridLineColor,p=t.gridLineEnable,d=t.pixelRatio,g=0;g<2;++g){var m=a[g],v=a[g+2]-m,y=.5*(o[g+2]+o[g]),x=o[g+2]-o[g];u[g]=2*v/x,c[g]=2*(m-y)/x}r.bind(),e.bind(),r.attributes.dataCoord.pointer(),r.uniforms.dataShift=c,r.uniforms.dataScale=u;var b=0;for(g=0;g<2;++g){f[0]=f[1]=0,f[g]=1,r.uniforms.dataAxis=f,r.uniforms.lineWidth=l[g]/(s[g+2]-s[g])*d,r.uniforms.color=h[g];var _=6*n[g].length;p[g]&&_&&i.drawArrays(i.TRIANGLES,b,_),b+=_}}),d.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],i=[0,0],o=[0,0];return function(){for(var s=this.plot,c=this.vbo,u=this.tickShader,f=this.ticks,h=s.gl,p=s._tickBounds,d=s.dataBox,g=s.viewBox,m=s.pixelRatio,v=s.screenBox,y=v[2]-v[0],x=v[3]-v[1],b=g[2]-g[0],_=g[3]-g[1],w=0;w<2;++w){var T=p[w],k=p[w+2]-T,M=.5*(d[w+2]+d[w]),A=d[w+2]-d[w];e[w]=2*k/A,t[w]=2*(T-M)/A}e[0]*=b/y,t[0]*=b/y,e[1]*=_/x,t[1]*=_/x,u.bind(),c.bind(),u.attributes.dataCoord.pointer();var S=u.uniforms;S.dataShift=t,S.dataScale=e;var E=s.tickMarkLength,C=s.tickMarkWidth,L=s.tickMarkColor,I=6*f[0].length,P=Math.min(a.ge(f[0],(d[0]-p[0])/(p[2]-p[0]),l),f[0].length),z=Math.min(a.gt(f[0],(d[2]-p[0])/(p[2]-p[0]),l),f[0].length),O=0+6*P,D=6*Math.max(0,z-P),R=Math.min(a.ge(f[1],(d[1]-p[1])/(p[3]-p[1]),l),f[1].length),F=Math.min(a.gt(f[1],(d[3]-p[1])/(p[3]-p[1]),l),f[1].length),B=I+6*R,N=6*Math.max(0,F-R);i[0]=2*(g[0]-E[1])/y-1,i[1]=(g[3]+g[1])/x-1,o[0]=E[1]*m/y,o[1]=C[1]*m/x,N&&(S.color=L[1],S.tickScale=o,S.dataAxis=n,S.screenOffset=i,h.drawArrays(h.TRIANGLES,B,N)),i[0]=(g[2]+g[0])/y-1,i[1]=2*(g[1]-E[0])/x-1,o[0]=C[0]*m/y,o[1]=E[0]*m/x,D&&(S.color=L[0],S.tickScale=o,S.dataAxis=r,S.screenOffset=i,h.drawArrays(h.TRIANGLES,O,D)),i[0]=2*(g[2]+E[3])/y-1,i[1]=(g[3]+g[1])/x-1,o[0]=E[3]*m/y,o[1]=C[3]*m/x,N&&(S.color=L[3],S.tickScale=o,S.dataAxis=n,S.screenOffset=i,h.drawArrays(h.TRIANGLES,B,N)),i[0]=(g[2]+g[0])/y-1,i[1]=2*(g[3]+E[2])/x-1,o[0]=C[2]*m/y,o[1]=E[2]*m/x,D&&(S.color=L[2],S.tickScale=o,S.dataAxis=r,S.screenOffset=i,h.drawArrays(h.TRIANGLES,O,D))}}(),d.update=(h=[1,1,-1,-1,1,-1],p=[1,-1,1,1,-1,-1],function(t){for(var e=t.ticks,r=t.bounds,n=new Float32Array(18*(e[0].length+e[1].length)),i=(this.plot.zeroLineEnable,0),a=[[],[]],o=0;o<2;++o)for(var s=a[o],l=e[o],c=r[o],u=r[o+2],f=0;f<l.length;++f){var d=(l[f].x-c)/(u-c);s.push(d);for(var g=0;g<6;++g)n[i++]=d,n[i++]=h[g],n[i++]=p[g]}this.ticks=a,this.vbo.update(n)}),d.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{\"./shaders\":314,\"binary-search-bounds\":96,\"gl-buffer\":259,\"gl-shader\":335}],313:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e,[-1,-1,-1,1,1,-1,1,1]),s=i(e,a.lineVert,a.lineFrag);return new o(t,r,s)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"./shaders\");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,c=o.prototype;c.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},c.drawLine=(s=[0,0],l=[0,0],function(t,e,r,n,i,a){var o=this.plot,c=this.shader,u=o.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,c.uniforms.start=s,c.uniforms.end=l,c.uniforms.width=i*o.pixelRatio,c.uniforms.color=a,u.drawArrays(u.TRIANGLE_STRIP,0,4)}),c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":314,\"gl-buffer\":259,\"gl-shader\":335}],314:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=n([\"precision lowp float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = vec4(color.xyz * color.w, color.w);\\n}\\n\"]);e.exports={lineVert:n([\"precision mediump float;\\n#define GLSLIFY 1\\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:i,textVert:n([\"#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:i,gridVert:n([\"precision mediump float;\\n#define GLSLIFY 1\\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:i,boxVert:n([\"precision mediump float;\\n#define GLSLIFY 1\\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:n([\"precision mediump float;\\n#define GLSLIFY 1\\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\"])}},{glslify:316}],315:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e),a=i(e,s.textVert,s.textFrag);return new l(t,r,a)};var n=t(\"gl-buffer\"),i=t(\"gl-shader\"),a=t(\"text-cache\"),o=t(\"binary-search-bounds\"),s=t(\"./shaders\");function l(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var c,u,f,h,p,d,g=l.prototype;g.drawTicks=(c=[0,0],u=[0,0],f=[0,0],function(t){var e=this.plot,r=this.shader,n=this.tickX[t],i=this.tickOffset[t],a=e.gl,s=e.viewBox,l=e.dataBox,h=e.screenBox,p=e.pixelRatio,d=e.tickEnable,g=e.tickPad,m=e.tickColor,v=e.tickAngle,y=e.labelEnable,x=e.labelPad,b=e.labelColor,_=e.labelAngle,w=this.labelOffset[t],T=this.labelCount[t],k=o.lt(n,l[t]),M=o.le(n,l[t+2]);c[0]=c[1]=0,c[t]=1,u[t]=(s[2+t]+s[t])/(h[2+t]-h[t])-1;var A=2/h[2+(1^t)]-h[1^t];u[1^t]=A*s[1^t]-1,d[t]&&(u[1^t]-=A*p*g[t],k<M&&i[M]>i[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t],r.uniforms.angle=v[t],a.drawArrays(a.TRIANGLES,i[k],i[M]-i[k]))),y[t]&&T&&(u[1^t]-=A*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,T)),u[1^t]=A*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=A*p*g[t+2],k<M&&i[M]>i[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t+2],r.uniforms.angle=v[t+2],a.drawArrays(a.TRIANGLES,i[k],i[M]-i[k]))),y[t+2]&&T&&(u[1^t]+=A*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,T))}),g.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),g.bind=(h=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=a[o],g=a[o+2]-f,m=i[o],v=i[o+2]-m;p[o]=2*l/u*g/v,h[o]=2*(s-c)/u*g/v}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=h,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e<h.length;++e){var p=h[e],d=p.x,g=p.text,m=p.font||\"sans-serif\";i=p.fontSize||12;for(var v=1/(c[o+2]-c[o]),y=c[o],x=g.split(\"\\n\"),b=0;b<x.length;b++)for(n=a(m,x[b]).data,r=0;r<n.length;r+=2)s.push(n[r]*i,-n[r+1]*i-b*i*1.2,(d-y)*v);u.push(Math.floor(s.length/3)),f.push(d)}this.tickOffset[o]=u,this.tickX[o]=f}for(o=0;o<2;++o){for(this.labelOffset[o]=Math.floor(s.length/3),n=a(t.labelFont[o],t.labels[o],{textAlign:\"center\"}).data,i=t.labelSize[o],e=0;e<n.length;e+=2)s.push(n[e]*i,-n[e+1]*i,0);this.labelCount[o]=Math.floor(s.length/3)-this.labelOffset[o]}for(this.titleOffset=Math.floor(s.length/3),n=a(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)s.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(s.length/3)-this.titleOffset,this.vbo.update(s)},g.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":314,\"binary-search-bounds\":96,\"gl-buffer\":259,\"gl-shader\":335,\"text-cache\":575}],316:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],317:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=n(e,[e.drawingBufferWidth,e.drawingBufferHeight]),c=new l(e,r);return c.grid=i(c),c.text=a(c),c.line=o(c),c.box=s(c),c.update(t),c};var n=t(\"gl-select-static\"),i=t(\"./lib/grid\"),a=t(\"./lib/text\"),o=t(\"./lib/line\"),s=t(\"./lib/box\");function l(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.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}var c=l.prototype;function u(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function f(t,e){return t.x-e.x}c.setDirty=function(){this.dirty=this.pickDirty=!0},c.setOverlayDirty=function(){this.dirty=!0},c.nextDepthValue=function(){return this._depthCounter++/65536},c.draw=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){if(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),this.borderColor){t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var c=this.borderColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[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 u=this.backgroundColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var f=this.zeroLineEnable,h=this.zeroLineColor,p=this.zeroLineWidth;if(f[0]||f[1]){o.bind();for(var d=0;d<2;++d)if(f[d]&&n[d]<=0&&n[d+2]>=0){var g=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(g,e[1],g,e[3],p[d],h[d]):o.drawLine(e[0],g,e[2],g,p[d],h[d])}}for(d=0;d<l.length;++d)l[d].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 m=this.borderLineEnable,v=this.borderLineWidth,y=this.borderLineColor;for(m[1]&&o.drawLine(r[0],r[1]-.5*v[1]*i,r[0],r[3]+.5*v[3]*i,v[1],y[1]),m[0]&&o.drawLine(r[0]-.5*v[0]*i,r[1],r[2]+.5*v[2]*i,r[1],v[0],y[0]),m[3]&&o.drawLine(r[2],r[1]-.5*v[1]*i,r[2],r[3]+.5*v[3]*i,v[3],y[3]),m[2]&&o.drawLine(r[0]-.5*v[0]*i,r[3],r[2]+.5*v[2]*i,r[3],v[2],y[2]),s.bind(),d=0;d<2;++d)s.drawTicks(d);this.titleEnable&&s.drawTitle();var x=this.overlays;for(d=0;d<x.length;++d)x[d].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}},c.drawPick=function(){if(!this.static){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()}},c.pick=function(t,e){if(!this.static){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),c=this.objects,u=0;u<c.length;++u){var f=c[u].pick(a,o,l);if(f)return f}return null}},c.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()},c.setDataBox=function(t){var e=this.dataBox;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},c.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()},c.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,i=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/i,10,10/i]),this.borderColor=!1!==t.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=u(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=u(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=u(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=u(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=u(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=u(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var a=t.ticks||[[],[]],o=this._tickBounds;o[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var s=0;s<2;++s){var l=a[s].slice(0);0!==l.length&&(l.sort(f),o[s]=Math.min(o[s],l[0].x),o[s+2]=Math.max(o[s+2],l[l.length-1].x))}this.grid.update({bounds:o,ticks:a}),this.text.update({bounds:o,ticks:a,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.static=!!t.static,this.setDirty()},c.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(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.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}},c.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},c.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\":311,\"./lib/grid\":312,\"./lib/line\":313,\"./lib/text\":315,\"gl-select-static\":334}],318:[function(t,e,r){\"use strict\";e.exports=function(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 c=i({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||\"orbit\",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,h=t.clientWidth,p=t.clientHeight,d={keyBindingMode:\"rotate\",enableWheel:!0,view:c,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:c.modes,_ortho:e._ortho||e.projection&&\"orthographic\"===e.projection.type||!1,tick:function(){var e=n(),r=this.delay,i=e-2*r;c.idle(e-r),c.recalcMatrix(i),c.flush(e-(100+2*r));for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=t.clientWidth===h&&t.clientHeight===p;return h=t.clientWidth,p=t.clientHeight,a?!l:(f=Math.exp(c.computedRadius[0]),!0)},lookAt:function(t,e,r){c.lookAt(c.lastT(),t,e,r)},rotate:function(t,e,r){c.rotate(c.lastT(),t,e,r)},pan:function(t,e,r){c.pan(c.lastT(),t,e,r)},translate:function(t,e,r){c.translate(c.lastT(),t,e,r)}};return Object.defineProperties(d,{matrix:{get:function(){return c.computedMatrix},set:function(t){return c.setMatrix(c.lastT(),t),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(t){var e=c.computedUp.slice(),r=c.computedEye.slice(),i=c.computedCenter.slice();if(c.setMode(t),\"turntable\"===t){var a=n();c._active.lookAt(a,r,i,e),c._active.lookAt(a+500,r,i,[0,0,1]),c._active.flush(a)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(t){return c.lookAt(c.lastT(),null,t),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(t){return c.lookAt(c.lastT(),t),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(t){return c.lookAt(c.lastT(),null,null,t),c.computedUp},enumerable:!0},distance:{get:function(){return f},set:function(t){return c.setDistance(c.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(t){return c.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener(\"contextmenu\",(function(t){return t.preventDefault(),!1})),d._lastX=-1,d._lastY=-1,d._lastMods={shift:!1,control:!1,alt:!1,meta:!1},d.enableMouseListeners=function(){function e(e,r,i,a){var o=d.keyBindingMode;if(!1!==o){var s=\"rotate\"===o,l=\"pan\"===o,u=\"zoom\"===o,h=!!a.control,p=!!a.alt,g=!!a.shift,m=!!(1&e),v=!!(2&e),y=!!(4&e),x=1/t.clientHeight,b=x*(r-d._lastX),_=x*(i-d._lastY),w=d.flipX?1:-1,T=d.flipY?1:-1,k=Math.PI*d.rotateSpeed,M=n();if(-1!==d._lastX&&-1!==d._lastY&&((s&&m&&!h&&!p&&!g||m&&!h&&!p&&g)&&c.rotate(M,w*k*b,-T*k*_,0),(l&&m&&!h&&!p&&!g||v||m&&h&&!p&&!g)&&c.pan(M,-d.translateSpeed*b*f,d.translateSpeed*_*f,0),u&&m&&!h&&!p&&!g||y||m&&!h&&p&&!g)){var A=-d.zoomSpeed*_/window.innerHeight*(M-c.lastT())*100;c.pan(M,0,0,f*(Math.exp(A)-1))}return d._lastX=r,d._lastY=i,d._lastMods=a,!0}}d.mouseListener=a(t,e),t.addEventListener(\"touchstart\",(function(r){var n=s(r.changedTouches[0],t);e(0,n[0],n[1],d._lastMods),e(1,n[0],n[1],d._lastMods)}),!!l&&{passive:!0}),t.addEventListener(\"touchmove\",(function(r){var n=s(r.changedTouches[0],t);e(1,n[0],n[1],d._lastMods),r.preventDefault()}),!!l&&{passive:!1}),t.addEventListener(\"touchend\",(function(t){e(0,d._lastX,d._lastY,d._lastMods)}),!!l&&{passive:!0}),d.wheelListener=o(t,(function(t,e){if(!1!==d.keyBindingMode&&d.enableWheel){var r=d.flipX?1:-1,i=d.flipY?1:-1,a=n();if(Math.abs(t)>Math.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=t(\"right-now\"),i=t(\"3d-view\"),a=t(\"mouse-change\"),o=t(\"mouse-wheel\"),s=t(\"mouse-event-offset\"),l=t(\"has-passive-events\")},{\"3d-view\":54,\"has-passive-events\":441,\"mouse-change\":483,\"mouse-event-offset\":484,\"mouse-wheel\":486,\"right-now\":542}],319:[function(t,e,r){var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\nattribute vec2 position;\\nvarying vec2 uv;\\nvoid main() {\\n uv = position;\\n gl_Position = vec4(position, 0, 1);\\n}\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\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 i(t,a,o,null,[{name:\"position\",type:\"vec2\"}])}},{\"gl-shader\":335,glslify:320}],320:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],321:[function(t,e,r){\"use strict\";var n=t(\"./camera.js\"),i=t(\"gl-axes3d\"),a=t(\"gl-axes3d/properties\"),o=t(\"gl-spikes3d\"),s=t(\"gl-select-static\"),l=t(\"gl-fbo\"),c=t(\"a-big-triangle\"),u=t(\"mouse-change\"),f=t(\"gl-mat4/perspective\"),h=t(\"gl-mat4/ortho\"),p=t(\"./lib/shader\"),d=t(\"is-mobile\")({tablet:!0,featureDetect:!0});function g(){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 m(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return\"boolean\"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement(\"canvas\"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext(\"webgl\",e))||(r=t.getContext(\"experimental-webgl\",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d}));if(!r)throw new Error(\"webgl not supported\");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new g,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&\"orthographic\"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||\"turntable\",_ortho:w},k=t.axes||{},M=i(r,k);M.enable=!k.disable;var A=t.spikes||{},S=o(r,A),E=[],C=[],L=[],I=[],P=!0,z=!0,O=new Array(16),D=new Array(16),R={view:null,projection:O,model:D,_ortho:!1},F=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,T),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:M,axesPixels:null,spikes:S,bounds:y,objects:E,shape:F,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:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function U(){if(!N._stopped&&N.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||\"absolute\",o.left=\"0px\",o.top=\"0px\",o.width=r+\"px\",o.height=n+\"px\",P=!0}}}N.autoResize&&U();function V(){for(var t=E.length,e=I.length,n=0;n<e;++n)L[n]=0;t:for(n=0;n<t;++n){var i=E[n],a=i.pickSlots;if(a){for(var o=0;o<e;++o)if(L[o]+a<255){C[n]=o,i.setPickBase(L[o]+1),L[o]+=a;continue t}var l=s(r,F);C[n]=e,I.push(l),L.push(a),i.setPickBase(1),e+=1}else C[n]=-1}for(;e>0&&0===L[e-1];)L.pop(),I.pop().dispose()}function q(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}window.addEventListener(\"resize\",U),N.update=function(t){N._stopped||(t=t||{},P=!0,z=!0)},N.add=function(t){N._stopped||(t.axes=M,E.push(t),C.push(-1),P=!0,z=!0,V())},N.remove=function(t){if(!N._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),P=!0,z=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener(\"resize\",U),e.removeEventListener(\"webglcontextlost\",q),N.mouseListener.enabled=!1,!N.contextLost)){M.dispose(),S.dispose();for(var t=0;t<E.length;++t)E[t].dispose();b.dispose();for(t=0;t<I.length;++t)I[t].dispose();_.dispose(),r=null,M=null,S=null,E=[]}},N._mouseRotating=!1,N._prevButtons=0,N.enableMouseListeners=function(){N.mouseListener=u(e,(function(t,e,r){if(!N._stopped){var n=I.length,i=E.length,a=x.object;x.distance=1/0,x.mouse[0]=e,x.mouse[1]=r,x.object=null,x.screen=null,x.dataCoordinate=x.dataPosition=null;var o=!1;if(t&&N._prevButtons)N._mouseRotating=!0;else{N._mouseRotating&&(z=!0),N._mouseRotating=!1;for(var s=0;s<n;++s){var l=I[s].query(e,j[1]-r-1,N.pickRadius);if(l){if(l.distance>x.distance)continue;for(var c=0;c<i;++c){var u=E[c];if(C[c]===s){var f=u.pick(l);f&&(x.buttons=t,x.screen=l.coord,x.distance=l.distance,x.object=u,x.index=f.distance,x.dataPosition=f.position,x.dataCoordinate=f.dataCoordinate,x.data=f,o=!0)}}}}}a&&a!==x.object&&(a.highlight&&a.highlight(null),P=!0),x.object&&(x.object.highlight&&x.object.highlight(x.data),P=!0),(o=o||x.object!==a)&&N.onselect&&N.onselect(x),1&t&&!(1&N._prevButtons)&&N.onclick&&N.onclick(x),N._prevButtons=t}}))},e.addEventListener(\"webglcontextlost\",q);var H=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],G=[H[0].slice(),H[1].slice()];function Y(){if(!q()){U();var t=N.camera.tick();R.view=N.camera.matrix,P=P||t,z=z||t,M.pixelRatio=N.pixelRatio,S.pixelRatio=N.pixelRatio;var e=E.length,n=H[0],i=H[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<e;++o){(L=E[o]).pixelRatio=N.pixelRatio,L.axes=N.axes,P=P||!!L.dirty,z=z||!!L.dirty;var s=L.bounds;if(s)for(var l=s[0],u=s[1],p=0;p<3;++p)n[p]=Math.min(n[p],l[p]),i[p]=Math.max(i[p],u[p])}var d=N.bounds;if(N.autoBounds)for(p=0;p<3;++p){if(i[p]<n[p])n[p]=-1,i[p]=1;else{n[p]===i[p]&&(n[p]-=1,i[p]+=1);var g=.05*(i[p]-n[p]);n[p]=n[p]-g,i[p]=i[p]+g}d[0][p]=n[p],d[1][p]=i[p]}var v=!1;for(p=0;p<3;++p)v=v||G[0][p]!==d[0][p]||G[1][p]!==d[1][p],G[0][p]=d[0][p],G[1][p]=d[1][p];if(z=z||v,P=P||v){if(v){var y=[0,0,0];for(o=0;o<3;++o)y[o]=m((d[1][o]-d[0][o])/10);M.autoTicks?M.update({bounds:d,tickSpacing:y}):M.update({bounds:d})}var T=r.drawingBufferWidth,k=r.drawingBufferHeight;F[0]=T,F[1]=k,j[0]=0|Math.max(T/N.pixelRatio,1),j[1]=0|Math.max(k/N.pixelRatio,1),function(t,e){var r=t.bounds,n=t.cameraParams,i=n.projection,a=n.model,o=t.gl.drawingBufferWidth,s=t.gl.drawingBufferHeight,l=t.zNear,c=t.zFar,u=t.fovy,p=o/s;e?(h(i,-p,p,-1,1,l,c),n._ortho=!0):(f(i,u,p,l,c),n._ortho=!1);for(var d=0;d<16;++d)a[d]=0;a[15]=1;var g=0;for(d=0;d<3;++d)g=Math.max(g,r[1][d]-r[0][d]);for(d=0;d<3;++d)t.autoScale?a[5*d]=t.aspect[d]/(r[1][d]-r[0][d]):a[5*d]=1/g,t.autoCenter&&(a[12+d]=.5*-a[5*d]*(r[0][d]+r[1][d]))}(N,w);for(o=0;o<e;++o){(L=E[o]).axesBounds=d,N.clipToBounds&&(L.clipBounds=d)}x.object&&(N.snapToData?S.position=x.dataCoordinate:S.position=x.dataPosition,S.bounds=d),z&&(z=!1,function(){if(!q()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL);for(var t=E.length,e=I.length,n=0;n<e;++n){var i=I[n];i.shape=j,i.begin();for(var a=0;a<t;++a)if(C[a]===n){var o=E[a];o.drawPick&&(o.pixelRatio=1,o.drawPick(R))}i.end()}}}()),N.axesPixels=a(N.axes,R,T,k),N.onrender&&N.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,T,k),N.clearRGBA(),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var A=!1;M.enable&&(A=A||M.isTransparent(),M.draw(R)),S.axes=M,x.object&&S.draw(R),r.disable(r.CULL_FACE);for(o=0;o<e;++o){(L=E[o]).axes=M,L.pixelRatio=N.pixelRatio,L.isOpaque&&L.isOpaque()&&L.draw(R),L.isTransparent&&L.isTransparent()&&(A=!0)}if(A){b.shape=F,b.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),M.enable&&M.isTransparent()&&M.drawTransparent(R);for(o=0;o<e;++o){(L=E[o]).isOpaque&&L.isOpaque()&&L.draw(R)}r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),M.isTransparent()&&M.drawTransparent(R);for(o=0;o<e;++o){var L;(L=E[o]).isTransparent&&L.isTransparent()&&L.drawTransparent(R)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),_.bind(),b.color[0].bind(0),_.uniforms.accumBuffer=0,c(r),r.disable(r.BLEND)}P=!1;for(o=0;o<e;++o)E[o].dirty=!1}}}return N.enableMouseListeners(),function t(){if(N._stopped||N.contextLost)return;Y(),requestAnimationFrame(t)}(),N.redraw=function(){N._stopped||(P=!0,Y())},N},createCamera:n}},{\"./camera.js\":318,\"./lib/shader\":319,\"a-big-triangle\":64,\"gl-axes3d\":250,\"gl-axes3d/properties\":258,\"gl-fbo\":269,\"gl-mat4/ortho\":296,\"gl-mat4/perspective\":297,\"gl-select-static\":334,\"gl-spikes3d\":345,\"is-mobile\":467,\"mouse-change\":483}],322:[function(t,e,r){var n=t(\"glslify\");r.pointVertex=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform float pointCloud;\\n\\nhighp float rand(vec2 co) {\\n highp float a = 12.9898;\\n highp float b = 78.233;\\n highp float c = 43758.5453;\\n highp float d = dot(co.xy, vec2(a, b));\\n highp float e = mod(d, 3.14);\\n return fract(sin(e) * c);\\n}\\n\\nvoid main() {\\n vec3 hgPosition = matrix * vec3(position, 1);\\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\\n // if we don't jitter the point size a bit, overall point cloud\\n // saturation 'jumps' on zooming, which is disturbing and confusing\\n gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\\n if(pointCloud != 0.0) { // pointCloud is truthy\\n // get the same square surface as circle would be\\n gl_PointSize *= 0.886;\\n }\\n}\"]),r.pointFragment=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color, borderColor;\\nuniform float centerFraction;\\nuniform float pointCloud;\\n\\nvoid main() {\\n float radius;\\n vec4 baseColor;\\n if(pointCloud != 0.0) { // pointCloud is truthy\\n if(centerFraction == 1.0) {\\n gl_FragColor = color;\\n } else {\\n gl_FragColor = mix(borderColor, color, centerFraction);\\n }\\n } else {\\n radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n baseColor = mix(borderColor, color, step(radius, centerFraction));\\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\\n }\\n}\\n\"]),r.pickVertex=n([\"precision mediump float;\\n#define GLSLIFY 1\\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=n([\"precision mediump float;\\n#define GLSLIFY 1\\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\"])},{glslify:323}],323:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],324:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=t(\"gl-buffer\"),a=t(\"typedarray-pool\"),o=t(\"./lib/shader\");function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,c,u);return f.update(e),t.addObject(f),f};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r(\"sizeMin\",.5),this.sizeMax=r(\"sizeMax\",20),this.color=r(\"color\",[1,0,0,1]).slice(),this.areaRatio=r(\"areaRatio\",1),this.borderColor=r(\"borderColor\",[0,0,0,1]).slice(),this.blend=r(\"blend\",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e<n;e++)c[e]=e;this.points=s,this.offsetBuffer.update(l),this.pickBuffer.update(c),i||a.free(l),o||a.free(c),this.pointCount=n,this.pickOffset=0},u.unifiedDraw=(l=[1,0,0,0,1,0,0,0,1],c=[0,0,0,0],function(t){var e=void 0!==t,r=e?this.pickShader:this.shader,n=this.plot.gl,i=this.plot.dataBox;if(0===this.pointCount)return t;var a=i[2]-i[0],o=i[3]-i[1],s=function(t,e){var r,n=0,i=t.length>>>1;for(r=0;r<i;r++){var a=t[2*r],o=t[2*r+1];a>=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||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\":322,\"gl-buffer\":259,\"gl-shader\":335,\"typedarray-pool\":595}],325:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],p=r[0],d=r[1],g=r[2],m=r[3];(a=c*p+u*d+f*g+h*m)<0&&(a=-a,p=-p,d=-d,g=-g,m=-m);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);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*f+l*g,t[3]=s*h+l*m,t}},{}],326:[function(t,e,r){\"use strict\";e.exports=function(t){return t||0===t?t.toString():\"\"}},{}],327:[function(t,e,r){\"use strict\";var n=t(\"vectorize-text\");e.exports=function(t,e,r){var a=i[e];a||(a=i[e]={});if(t in a)return a[t];var o={textAlign:\"center\",textBaseline:\"middle\",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,c,u=n(t,o);if(r&&1!==r){for(l=0;l<s.positions.length;++l)for(c=0;c<s.positions[l].length;++c)s.positions[l][c]/=r;for(l=0;l<u.positions.length;++l)for(c=0;c<u.positions[l].length;++c)u.positions[l][c]/=r}var f=[[1/0,1/0],[-1/0,-1/0]],h=u.positions.length;for(l=0;l<h;++l){var p=u.positions[l];for(c=0;c<2;++c)f[0][c]=Math.min(f[0][c],p[c]),f[1][c]=Math.max(f[1][c],p[c])}return a[t]=[s,u,f]};var i={}},{\"vectorize-text\":600}],328:[function(t,e,r){var n=t(\"gl-shader\"),i=t(\"glslify\"),a=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\\n\\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=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\\n\\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=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\\n\\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=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float opacity;\\n\\nvarying vec4 interpColor;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if (\\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\\n interpColor.a * opacity == 0.\\n ) discard;\\n gl_FragColor = interpColor * opacity;\\n}\\n\"]),c=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float pickGroup;\\n\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\\n\\n gl_FragColor = vec4(pickGroup, pickId.bgr);\\n}\"]),u=[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"glyph\",type:\"vec2\"},{name:\"id\",type:\"vec4\"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},g={vertex:o,fragment:c,attributes:u},m={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return v(t,f)},r.createOrtho=function(t){return v(t,h)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,d)},r.createPickOrtho=function(t){return v(t,g)},r.createPickProject=function(t){return v(t,m)}},{\"gl-shader\":335,glslify:329}],329:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],330:[function(t,e,r){\"use strict\";var n=t(\"is-string-blank\"),i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=t(\"typedarray-pool\"),s=t(\"gl-mat4/multiply\"),l=t(\"./lib/shaders\"),c=t(\"./lib/glyphs\"),u=t(\"./lib/get-simple-string\"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(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 p(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function g(t){return!0===t||t>1?1:t}function m(t,e,r,n,i,a,o,s,l,c,u,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new d(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}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),g=a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new m(e,r,n,o,f,h,p,d,g,s,c,u);return v.update(t),v};var v=m.prototype;v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},v.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=f.slice(),k=[0,0,0],M=[[0,0,0],[0,0,0]];function A(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function C(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||f,u=r.view||f,h=r.projection||f,d=e.axesBounds,g=function(t){for(var e=M,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=g,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var v=T,C=0;C<16;++C)v[C]=0;for(C=0;C<4;++C)v[5*C]=1;v[5*m]=0,i[m]<0?v[12+m]=d[0][m]:v[12+m]=d[1][m],s(v,c,v),l.model=v;var L=(m+1)%3,I=(m+2)%3,P=A(x),z=A(b);P[L]=1,z[I]=1;var O=p(0,0,0,S(_,P)),D=p(0,0,0,S(w,z));if(Math.abs(O[1])>Math.abs(D[1])){var R=O;O=D,D=R,R=P,P=z,z=R;var F=L;L=I,I=F}O[0]<0&&(P[L]=-1),D[1]>0&&(z[I]=-1);var B=0,N=0;for(C=0;C<4;++C)B+=Math.pow(c[4*L+C],2),N+=Math.pow(c[4*I+C],2);P[L]/=Math.sqrt(B),z[I]/=Math.sqrt(N),l.axes[0]=P,l.axes[1]=z,l.fragClipBounds[0]=E(k,g[0],m,-1e8),l.fragClipBounds[1]=E(k,g[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var L=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function I(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&C(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=L,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function P(t,e,r,i){var a;a=Array.isArray(t)?e<t.length?t[e]:void 0:t,a=u(a);var o=!0;n(a)&&(a=\"\\u25bc\",o=!1);var s=c(a,r,i);return{mesh:s[0],lines:s[1],bounds:s[2],visible:o}}v.draw=function(t){I(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!1,!1)},v.drawTransparent=function(t){I(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!0,!1)},v.drawPick=function(t){I(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,1,!0,!0)},v.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},v.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]},v.update=function(t){if(\"perspective\"in(t=t||{})&&(this.useOrtho=!t.perspective),\"orthographic\"in t&&(this.useOrtho=!!t.orthographic),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"project\"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if(\"projectScale\"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,\"projectOpacity\"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=g(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,\"opacity\"in t&&(this.opacity=g(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||\"normal\",c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else{i=[],a=[];for(n=0;n<c.length;++n)i[n]=c[n][0],a[n]=c[n][1]}var u=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],h=t.glyph,p=t.color,d=t.size,m=t.angle,v=t.lineColor,y=-1,x=0,b=0,_=0;if(s.length){_=s.length;t:for(n=0;n<_;++n){for(var w=s[n],T=0;T<3;++T)if(isNaN(w[T])||!isFinite(w[T]))continue t;var k=(N=P(h,n,l,this.pixelRatio)).mesh,M=N.lines,A=N.bounds;x+=3*k.cells.length,b+=2*M.edges.length}}var S=x+b,E=o.mallocFloat(3*S),C=o.mallocFloat(4*S),L=o.mallocFloat(2*S),I=o.mallocUint32(S);if(S>0){var z=0,O=x,D=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),B=Array.isArray(v)&&Array.isArray(v[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;f[T]=Math.max(f[T],w[T]),u[T]=Math.min(u[T],w[T])}k=(N=P(h,n,l,this.pixelRatio)).mesh,M=N.lines,A=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(p)){if(3===(U=F?n<p.length?p[n]:[0,0,0,0]:p).length){for(T=0;T<3;++T)D[T]=U[T];D[3]=1}else if(4===U.length){for(T=0;T<4;++T)D[T]=U[T];!this.hasAlpha&&U[3]<1&&(this.hasAlpha=!0)}}else D[0]=D[1]=D[2]=0,D[3]=1;else D=[1,1,1,0];if(j)if(Array.isArray(v)){var U;if(3===(U=B?n<v.length?v[n]:[0,0,0,0]:v).length){for(T=0;T<3;++T)R[T]=U[T];R[T]=1}else if(4===U.length){for(T=0;T<4;++T)R[T]=U[T];!this.hasAlpha&&U[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;else R=[1,1,1,0];var V=.5;j?Array.isArray(d)?V=n<d.length?+d[n]:12:d?V=+d:this.useOrtho&&(V=12):V=0;var q=0;Array.isArray(m)?q=n<m.length?+m[n]:0:m&&(q=+m);var H=Math.cos(q),G=Math.sin(q);for(w=s[n],T=0;T<3;++T)f[T]=Math.max(f[T],w[T]),u[T]=Math.min(u[T],w[T]);var Y=i,W=a;Y=0;Array.isArray(i)?Y=n<i.length?i[n]:0:i&&(Y=i);W=0;Array.isArray(a)?W=n<a.length?a[n]:0:a&&(W=a);var X=[Y*=Y>0?1-A[0][0]:Y<0?1+A[1][0]:1,W*=W>0?1-A[0][1]:W<0?1+A[1][1]:1],Z=k.cells||[],J=k.positions||[];for(T=0;T<Z.length;++T)for(var K=Z[T],Q=0;Q<3;++Q){for(var $=0;$<3;++$)E[3*z+$]=w[$];for($=0;$<4;++$)C[4*z+$]=D[$];I[z]=y;var tt=J[K[Q]];L[2*z]=V*(H*tt[0]-G*tt[1]+X[0]),L[2*z+1]=V*(G*tt[0]+H*tt[1]+X[1]),z+=1}for(Z=M.edges,J=M.positions,T=0;T<Z.length;++T)for(K=Z[T],Q=0;Q<2;++Q){for($=0;$<3;++$)E[3*O+$]=w[$];for($=0;$<4;++$)C[4*O+$]=R[$];I[O]=y;tt=J[K[Q]];L[2*O]=V*(H*tt[0]-G*tt[1]+X[0]),L[2*O+1]=V*(G*tt[0]+H*tt[1]+X[1]),O+=1}}}this.bounds=[u,f],this.points=s,this.pointCount=s.length,this.vertexCount=x,this.lineVertexCount=b,this.pointBuffer.update(E),this.colorBuffer.update(C),this.glyphBuffer.update(L),this.idBuffer.update(I),o.free(E),o.free(C),o.free(L),o.free(I)},v.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/get-simple-string\":326,\"./lib/glyphs\":327,\"./lib/shaders\":328,\"gl-buffer\":259,\"gl-mat4/multiply\":295,\"gl-vao\":358,\"is-string-blank\":470,\"typedarray-pool\":595}],331:[function(t,e,r){\"use strict\";var n=t(\"glslify\");r.boxVertex=n([\"precision mediump float;\\n#define GLSLIFY 1\\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=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = color;\\n}\\n\"])},{glslify:332}],332:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],333:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\"),i=t(\"gl-buffer\"),a=t(\"./lib/shaders\");function o(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}e.exports=function(t,e){var r=t.gl,s=i(r,[0,0,0,1,1,0,1,1]),l=n(r,a.boxVertex,a.boxFragment),c=new o(t,s,l);return c.update(e),t.addOverlay(c),c};var s=o.prototype;s.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,c=t.viewBox,u=t.pixelRatio,f=(e[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],h=(e[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],p=(e[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],d=(e[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(f=Math.max(f,c[0]),h=Math.max(h,c[1]),p=Math.min(p,c[2]),d=Math.min(d,c[3]),!(p<f||d<h)){o.bind();var g=s[2]-s[0],m=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,g,h,i),o.drawBox(0,h,f,d,i),o.drawBox(0,d,g,m,i),o.drawBox(p,h,g,d,i)),this.innerFill&&o.drawBox(f,h,p,d,n),r>0){var v=r*u;o.drawBox(f-v,h-v,p+v,h+v,a),o.drawBox(f-v,d-v,p+v,d+v,a),o.drawBox(f-v,h-v,f+v,d+v,a),o.drawBox(p-v,h-v,p+v,d+v,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{\"./lib/shaders\":331,\"gl-buffer\":259,\"gl-shader\":335}],334:[function(t,e,r){\"use strict\";e.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=t(\"gl-fbo\"),i=t(\"typedarray-pool\"),a=t(\"ndarray\"),o=t(\"bit-twiddle\").nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(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)}}var c=l.prototype;Object.defineProperty(c,\"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){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;a<r*e*4;++a)n[a]=255}return t}}}),c.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))},c.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,\"number\"!=typeof r&&(r=1);var i=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),l=0|Math.min(Math.max(e-r,0),n[1]),c=0|Math.min(Math.max(e+r,0),n[1]);if(o<=i||c<=l)return null;var u=[o-i,c-l],f=a(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(i+n[0]*l)),h=function(t,e,r){for(var n=1e8,i=-1,a=-1,o=t.shape[0],s=t.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++){var u=t.get(l,c,0),f=t.get(l,c,1),h=t.get(l,c,2),p=t.get(l,c,3);if(u<255||f<255||h<255||p<255){var d=e-l,g=r-c,m=d*d+g*g;m<n&&(n=m,i=l,a=c)}}return[i,a,n]}(f.hi(u[0],u[1],1),r,r),p=h[0],d=h[1];return p<0||Math.pow(this.radius,2)<h[2]?null:new s(p+i|0,d+l|0,f.get(p,d,0),[f.get(p,d,1),f.get(p,d,2),f.get(p,d,3)],Math.sqrt(h[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{\"bit-twiddle\":97,\"gl-fbo\":269,ndarray:495,\"typedarray-pool\":595}],335:[function(t,e,r){\"use strict\";var n=t(\"./lib/create-uniforms\"),i=t(\"./lib/create-attributes\"),a=t(\"./lib/reflect\"),o=t(\"./lib/shader-cache\"),s=t(\"./lib/runtime-reflect\"),l=t(\"./lib/GLError\");function c(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var u=c.prototype;function f(t,e){return t.name<e.name?-1:1}u.bind=function(){var t;this.program||this._relink();var e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},u.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,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},u.update=function(t,e,r,c){if(!e||1===arguments.length){var u=t;t=u.vertex,e=u.fragment,r=u.uniforms,c=u.attributes}var h=this,p=h.gl,d=h._vref;h._vref=o.shader(p,p.VERTEX_SHADER,t),d&&d.dispose(),h.vertShader=h._vref.shader;var g=this._fref;if(h._fref=o.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),h.fragShader=h._fref.shader,!r||!c){var m=p.createProgram();if(p.attachShader(m,h.fragShader),p.attachShader(m,h.vertShader),p.linkProgram(m),!p.getProgramParameter(m,p.LINK_STATUS)){var v=p.getProgramInfoLog(m);throw new l(v,\"Error linking program:\"+v)}r=r||s.uniforms(p,m),c=c||s.attributes(p,m),p.deleteProgram(m)}(c=c.slice()).sort(f);var y,x=[],b=[],_=[];for(y=0;y<c.length;++y){var w=c[y];if(w.type.indexOf(\"mat\")>=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),M=0;M<T;++M)k[M]=_.length,b.push(w.name+\"[\"+M+\"]\"),\"number\"==typeof w.location?_.push(w.location+M):Array.isArray(w.location)&&w.location.length===T&&\"number\"==typeof w.location[M]?_.push(0|w.location[M]):_.push(-1);x.push({name:w.name,type:w.type,locations:k})}else x.push({name:w.name,type:w.type,locations:[_.length]}),b.push(w.name),\"number\"==typeof w.location?_.push(0|w.location):_.push(-1)}var A=0;for(y=0;y<_.length;++y)if(_[y]<0){for(;_.indexOf(A)>=0;)A+=1;_[y]=A}var S=new Array(r.length);function E(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t<r.length;++t)S[t]=p.getUniformLocation(h.program,r[t].name)}E(),h._relink=E,h.types={uniforms:a(r),attributes:a(c)},h.attributes=i(p,h,x,_),Object.defineProperty(h,\"uniforms\",n(p,h,r,S))},e.exports=function(t,e,r,n,i){var a=new c(t);return a.update(e,r,n,i),a}},{\"./lib/GLError\":336,\"./lib/create-attributes\":337,\"./lib/create-uniforms\":338,\"./lib/reflect\":339,\"./lib/runtime-reflect\":340,\"./lib/shader-cache\":341}],336:[function(t,e,r){function n(t,e,r){this.shortMessage=e||\"\",this.longMessage=r||\"\",this.rawError=t||\"\",this.message=\"gl-shader: \"+(e||t||\"\")+(r?\"\\n\"+r:\"\"),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name=\"GLError\",n.prototype.constructor=n,e.exports=n},{}],337:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,i){for(var a={},l=0,c=r.length;l<c;++l){var u=r[l],f=u.name,h=u.type,p=u.locations;switch(h){case\"bool\":case\"int\":case\"float\":o(t,e,p[0],i,1,a,f);break;default:if(h.indexOf(\"vec\")>=0){if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n(\"\",\"Invalid data type for attribute \"+f+\": \"+h);o(t,e,p[0],i,d,a,f)}else{if(!(h.indexOf(\"mat\")>=0))throw new n(\"\",\"Unknown data type for attribute \"+f+\": \"+h);var d;if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n(\"\",\"Invalid data type for attribute \"+f+\": \"+h);s(t,e,p,i,d,a,f)}}}return a};var n=t(\"./GLError\");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=[\"gl\",\"v\"],c=[],u=0;u<a;++u)l.push(\"x\"+u),c.push(\"x\"+u);l.push(\"if(x0.length===void 0){return gl.vertexAttrib\"+a+\"f(v,\"+c.join()+\")}else{return gl.vertexAttrib\"+a+\"fv(v,x0)}\");var f=Function.apply(null,l),h=new i(t,e,r,n,a,f);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(n[r]),f(t,n[r],e),e},get:function(){return h},enumerable:!0})}function s(t,e,r,n,i,a,s){for(var l=new Array(i),c=new Array(i),u=0;u<i;++u)o(t,e,r[u],n,i,l,u),c[u]=l[u];Object.defineProperty(l,\"location\",{set:function(t){if(Array.isArray(t))for(var e=0;e<i;++e)c[e].location=t[e];else for(e=0;e<i;++e)c[e].location=t+e;return t},get:function(){for(var t=new Array(i),e=0;e<i;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,a,o,s){e=e||t.FLOAT,a=!!a,o=o||i*i,s=s||0;for(var l=0;l<i;++l){var c=n[r[l]];t.vertexAttribPointer(c,i,e,a,o,s+l*i),t.enableVertexAttribArray(c)}};var f=new Array(i),h=t[\"vertexAttrib\"+i+\"fv\"];Object.defineProperty(a,s,{set:function(e){for(var a=0;a<i;++a){var o=n[r[a]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))h.call(t,o,e[a]);else{for(var s=0;s<i;++s)f[s]=e[i*a+s];h.call(t,o,f)}}return e},get:function(){return l},enumerable:!0})}a.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,\"location\",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{\"./GLError\":336}],338:[function(t,e,r){\"use strict\";var n=t(\"./reflect\"),i=t(\"./GLError\");function a(t){return new Function(\"y\",\"return function(){return y}\")(t)}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}e.exports=function(t,e,r,s){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(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf(\"mat\")&&4===r.length){var a;if((a=r.charCodeAt(r.length-1)-48)<2||a>4)throw new i(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+r);return\"gl.uniformMatrix\"+a+\"fv(locations[\"+e+\"],false,obj\"+t+\")\"}throw new i(\"\",\"Unknown uniform data type for \"+name+\": \"+r)}if((a=r.charCodeAt(r.length-1)-48)<2||a>4)throw new i(\"\",\"Invalid data type\");switch(r.charAt(0)){case\"b\":case\"i\":return\"gl.uniform\"+a+\"iv(locations[\"+e+\"],obj\"+t+\")\";case\"v\":return\"gl.uniform\"+a+\"fv(locations[\"+e+\"],obj\"+t+\")\";default:throw new i(\"\",\"Unrecognized data type for vector \"+name+\": \"+r)}}}function c(e){for(var n=[\"return function updateProperty(obj){\"],i=function t(e,r){if(\"object\"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+\"\"===i?o+=\"[\"+i+\"]\":o+=\".\"+i,\"object\"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}(\"\",e),a=0;a<i.length;++a){var o=i[a],c=o[0],u=o[1];s[u]&&n.push(l(c,u,r[u].type))}return n.push(\"return obj}\"),new Function(\"gl\",\"locations\",n.join(\"\\n\"))(t,s)}function u(n,l,u){if(\"object\"==typeof u){var h=f(u);Object.defineProperty(n,l,{get:a(h),set:c(u),enumerable:!0,configurable:!1})}else s[u]?Object.defineProperty(n,l,{get:(p=u,new Function(\"gl\",\"wrapper\",\"locations\",\"return function(){return gl.getUniform(wrapper.program,locations[\"+p+\"])}\")(t,e,s)),set:c(u),enumerable:!0,configurable:!1}):n[l]=function(t){switch(t){case\"bool\":return!1;case\"int\":case\"sampler2D\":case\"samplerCube\":case\"float\":return 0;default:var e=t.indexOf(\"vec\");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i(\"\",\"Invalid data type\");return\"b\"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf(\"mat\")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+t);return o(r*r,0)}throw new i(\"\",\"Unknown uniform data type for \"+name+\": \"+t)}}(r[u].type);var p}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)u(e,r,t[r])}else for(var n in e={},t)u(e,n,t[n]);return e}var h=n(r,!0);return{get:a(f(h)),set:c(h),enumerable:!0,configurable:!0}}},{\"./GLError\":336,\"./reflect\":339}],339:[function(t,e,r){\"use strict\";e.exports=function(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name.split(\".\"),a=r,o=0;o<i.length;++o){var s=i[o].split(\"[\");if(s.length>1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l<s.length;++l){var c=parseInt(s[l]);l<s.length-1||o<i.length-1?(c in a||(l<s.length-1?a[c]=[]:a[c]={}),a=a[c]):a[c]=e?n:t[n].type}}else o<i.length-1?(s[0]in a||(a[s[0]]={}),a=a[s[0]]):a[s[0]]=e?n:t[n].type}return r}},{}],340:[function(t,e,r){\"use strict\";r.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],i=0;i<r;++i){var o=t.getActiveUniform(e,i);if(o){var s=a(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace(\"[0]\",\"[\"+l+\"]\"),type:s});else n.push({name:o.name,type:s})}}return n},r.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],i=0;i<r;++i){var o=t.getActiveAttrib(e,i);o&&n.push({name:o.name,type:a(t,o.type)})}return n};var n={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\"},i=null;function a(t,e){if(!i){var r=Object.keys(n);i={};for(var a=0;a<r.length;++a){var o=r[a];i[t[o]]=n[o]}}return i[e]}},{}],341:[function(t,e,r){\"use strict\";r.shader=function(t,e,r){return u(t).getShaderReference(e,r)},r.program=function(t,e,r,n,i){return u(t).getProgram(e,r,n,i)};var n=t(\"./GLError\"),i=t(\"gl-format-compiler-error\"),a=new(\"undefined\"==typeof WeakMap?t(\"weakmap-shim\"):WeakMap),o=0;function s(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 l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++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 c=l.prototype;function u(t){var e=a.get(t);return e||(e=new l(t),a.set(t,e)),e}c.getShaderReference=function(t,e){var r=this.gl,a=this.shaders[t===r.FRAGMENT_SHADER|0],l=a[e];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(a);try{var s=i(o,r,e)}catch(t){throw console.warn(\"Failed to format compiler error: \"+t),new n(o,\"Error compiling shader:\\n\"+o)}throw new n(o,s.short,s.long)}return a}(r,t,e);l=a[e]=new s(o++,e,t,c,[],1,this)}return l},c.getProgram=function(t,e,r,i){var a=[t.id,e.id,r.join(\":\"),i.join(\":\")].join(\"@\"),o=this.programs[a];return o&&this.gl.isProgram(o)||(this.programs[a]=o=function(t,e,r,i,a){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<i.length;++s)t.bindAttribLocation(o,a[s],i[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,\"Error linking program: \"+l)}return o}(this.gl,t.shader,e.shader,r,i),t.programs.push(a),e.programs.push(a)),o}},{\"./GLError\":336,\"gl-format-compiler-error\":270,\"weakmap-shim\":605}],342:[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]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map((function(t){return t.slice()})),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,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]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],343:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],344:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, color;\\nattribute float weight;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 coordinates[3];\\nuniform vec4 colors[3];\\nuniform vec2 screenShape;\\nuniform float lineWidth;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n vec3 vertexPosition = mix(coordinates[0],\\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\\n\\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\\n vec2 delta = weight * clipOffset * screenShape;\\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\\n\\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\\n}\\n\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n gl_FragColor = fragColor;\\n}\"]);e.exports=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec3\"},{name:\"weight\",type:\"float\"}])}},{\"gl-shader\":335,glslify:343}],345:[function(t,e,r){\"use strict\";var n=t(\"gl-buffer\"),i=t(\"gl-vao\"),a=t(\"./shaders/index\");e.exports=function(t,e){var r=[];function o(t,e,n,i,a,o){var s=[t,e,n,0,0,0,1];s[i+3]=1,s[i]=a,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[i]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[i]=a,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(t,r),c=i(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}]),u=a(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new s(t,l,c,u);return f.update(e),f};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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}var l=s.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||o,s=t.view||o,l=t.projection||o;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,p=u,d=0;d<3;++d)i&&i[d]<0?(h[d]=this.bounds[0][d],p[d]=this.bounds[1][d]):(h[d]=this.bounds[1][d],p[d]=this.bounds[0][d]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,p],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(d=0;d<3;++d)n.uniforms.lineWidth=this.lineWidth[d]*this.pixelRatio,this.enabled[d]&&(r.draw(e.TRIANGLES,6,6*d),this.drawSides[d]&&r.draw(e.TRIANGLES,12,18+12*d));r.unbind()},l.update=function(t){t&&(\"bounds\"in t&&(this.bounds=t.bounds),\"position\"in t&&(this.position=t.position),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"colors\"in t&&(this.colors=t.colors),\"enabled\"in t&&(this.enabled=t.enabled),\"drawSides\"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders/index\":344,\"gl-buffer\":259,\"gl-vao\":358}],346:[function(t,e,r){var n=t(\"glslify\"),i=n([\"precision highp float;\\n\\nprecision highp float;\\n#define GLSLIFY 1\\n\\nvec3 getOrthogonalVector(vec3 v) {\\n // Return up-vector for only-z vector.\\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\\n // Assign z = 0, x = -b, y = a:\\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\\n return normalize(vec3(-v.y, v.x, 0.0));\\n } else {\\n return normalize(vec3(0.0, v.z, -v.y));\\n }\\n}\\n\\n// Calculate the tube vertex and normal at the given index.\\n//\\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\\n//\\n// Each tube segment is made up of a ring of vertices.\\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\\n// The indexes of tube segments run from 0 to 8.\\n//\\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\\n float segmentCount = 8.0;\\n\\n float angle = 2.0 * 3.14159 * (index / segmentCount);\\n\\n vec3 u = getOrthogonalVector(d);\\n vec3 v = normalize(cross(u, d));\\n\\n vec3 x = u * cos(angle) * length(d);\\n vec3 y = v * sin(angle) * length(d);\\n vec3 v3 = x + y;\\n\\n normal = normalize(v3);\\n\\n return v3;\\n}\\n\\nattribute vec4 vector;\\nattribute vec4 color, position;\\nattribute vec2 uv;\\n\\nuniform float vectorScale, tubeScale;\\nuniform mat4 model, view, projection, inverseModel;\\nuniform vec3 eyePosition, lightPosition;\\n\\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n // Scale the vector magnitude to stay constant with\\n // model & view changes.\\n vec3 normal;\\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\\n\\n //Lighting geometry parameters\\n vec4 cameraCoordinate = view * tubePosition;\\n cameraCoordinate.xyz /= cameraCoordinate.w;\\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\\n\\n // vec4 m_position = model * vec4(tubePosition, 1.0);\\n vec4 t_position = view * tubePosition;\\n gl_Position = projection * t_position;\\n\\n f_color = color;\\n f_data = tubePosition.xyz;\\n f_position = position.xyz;\\n f_uv = uv;\\n}\\n\"]),a=n([\"#extension GL_OES_standard_derivatives : enable\\n\\nprecision highp float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution(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\\nfloat cookTorranceSpecular(\\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(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\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\\nuniform sampler2D texture;\\n\\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\\n\"]),o=n([\"precision highp float;\\n\\nprecision highp float;\\n#define GLSLIFY 1\\n\\nvec3 getOrthogonalVector(vec3 v) {\\n // Return up-vector for only-z vector.\\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\\n // Assign z = 0, x = -b, y = a:\\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\\n return normalize(vec3(-v.y, v.x, 0.0));\\n } else {\\n return normalize(vec3(0.0, v.z, -v.y));\\n }\\n}\\n\\n// Calculate the tube vertex and normal at the given index.\\n//\\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\\n//\\n// Each tube segment is made up of a ring of vertices.\\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\\n// The indexes of tube segments run from 0 to 8.\\n//\\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\\n float segmentCount = 8.0;\\n\\n float angle = 2.0 * 3.14159 * (index / segmentCount);\\n\\n vec3 u = getOrthogonalVector(d);\\n vec3 v = normalize(cross(u, d));\\n\\n vec3 x = u * cos(angle) * length(d);\\n vec3 y = v * sin(angle) * length(d);\\n vec3 v3 = x + y;\\n\\n normal = normalize(v3);\\n\\n return v3;\\n}\\n\\nattribute vec4 vector;\\nattribute vec4 position;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform float tubeScale;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n vec3 normal;\\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\\n\\n gl_Position = projection * view * tubePosition;\\n f_id = id;\\n f_position = position.xyz;\\n}\\n\"]),s=n([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\\n\\n gl_FragColor = vec4(pickId, f_id.xyz);\\n}\"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:\"position\",type:\"vec4\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"},{name:\"vector\",type:\"vec4\"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:\"position\",type:\"vec4\"},{name:\"id\",type:\"vec4\"},{name:\"vector\",type:\"vec4\"}]}},{glslify:347}],347:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],348:[function(t,e,r){\"use strict\";var n=t(\"gl-vec3\"),i=t(\"gl-vec4\"),a=[\"xyz\",\"xzy\",\"yxz\",\"yzx\",\"zxy\",\"zyx\"],o=function(t,e,r,a){for(var o=0,s=0;s<t.length;s++)for(var l=t[s].velocities,c=0;c<l.length;c++)o=Math.max(o,n.length(l[c]));var u=t.map((function(t){return function(t,e,r,a){for(var o=t.points,s=t.velocities,l=t.divergences,c=[],u=[],f=[],h=[],p=[],d=[],g=0,m=0,v=i.create(),y=i.create(),x=0;x<o.length;x++){var b=o[x],_=s[x],w=l[x];0===e&&(w=.05*r),m=n.length(_)/a,v=i.create(),n.copy(v,_),v[3]=w;for(var T=0;T<8;T++)p[T]=[b[0],b[1],b[2],T];if(h.length>0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(h[T],p[T],p[k],p[k],h[k],h[T]),f.push(y,v,v,v,y,y),d.push(g,m,m,m,g,g);var M=c.length;u.push([M-6,M-5,M-4],[M-3,M-2,M-1])}var A=h;h=p,p=A;var S=y;y=v,v=S;var E=g;g=m,m=E}return{positions:c,cells:u,vectors:f,vertexIntensity:d}}(t,r,a,o)})),f=[],h=[],p=[],d=[];for(s=0;s<u.length;s++){var g=u[s],m=f.length;f=f.concat(g.positions),p=p.concat(g.vectors),d=d.concat(g.vertexIntensity);for(c=0;c<g.cells.length;c++){var v=g.cells[c],y=[];h.push(y);for(var x=0;x<v.length;x++)y.push(v[x]+m)}}return{positions:f,cells:h,vectors:p,vertexIntensity:d,colormap:e}},s=function(t,e){var r,n=t.length;for(r=0;r<n;r++){var i=t[r];if(i===e)return r;if(i>e)return r-1}return r},l=function(t,e,r){return t<e?e:t>r?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;n<r;n++){var i=Math.abs(t[n]-t[n-1]);i<e&&(e=i)}return e};e.exports=function(t,e){var r=t.startingPositions,i=t.maxLength||1e3,u=t.tubeSize||1,f=t.absoluteTubeSize,h=t.gridFill||\"+x+y+z\",p={};-1!==h.indexOf(\"-x\")&&(p.reversedX=!0),-1!==h.indexOf(\"-y\")&&(p.reversedY=!0),-1!==h.indexOf(\"-z\")&&(p.reversedZ=!0),p.filled=a.indexOf(h.replace(/-/g,\"\").replace(/\\+/g,\"\"));var d=t.getVelocity||function(e){return function(t,e,r){var i=e.vectors,a=e.meshgrid,o=t[0],c=t[1],u=t[2],f=a[0].length,h=a[1].length,p=a[2].length,d=s(a[0],o),g=s(a[1],c),m=s(a[2],u),v=d+1,y=g+1,x=m+1;if(d=l(d,0,f-1),v=l(v,0,f-1),g=l(g,0,h-1),y=l(y,0,h-1),m=l(m,0,p-1),x=l(x,0,p-1),d<0||g<0||m<0||v>f-1||y>h-1||x>p-1)return n.create();var b,_,w,T,k,M,A=a[0][d],S=a[0][v],E=a[1][g],C=a[1][y],L=a[2][m],I=(o-A)/(S-A),P=(c-E)/(C-E),z=(u-L)/(a[2][x]-L);switch(isFinite(I)||(I=.5),isFinite(P)||(P=.5),isFinite(z)||(z=.5),r.reversedX&&(d=f-1-d,v=f-1-v),r.reversedY&&(g=h-1-g,y=h-1-y),r.reversedZ&&(m=p-1-m,x=p-1-x),r.filled){case 5:k=m,M=x,w=g*p,T=y*p,b=d*p*h,_=v*p*h;break;case 4:k=m,M=x,b=d*p,_=v*p,w=g*p*f,T=y*p*f;break;case 3:w=g,T=y,k=m*h,M=x*h,b=d*h*p,_=v*h*p;break;case 2:w=g,T=y,b=d*h,_=v*h,k=m*h*f,M=x*h*f;break;case 1:b=d,_=v,k=m*f,M=x*f,w=g*f*p,T=y*f*p;break;default:b=d,_=v,w=g*f,T=y*f,k=m*f*h,M=x*f*h}var O=i[b+w+k],D=i[b+w+M],R=i[b+T+k],F=i[b+T+M],B=i[_+w+k],N=i[_+w+M],j=i[_+T+k],U=i[_+T+M],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,O,B,I),n.lerp(q,D,N,I),n.lerp(H,R,j,I),n.lerp(G,F,U,I);var Y=n.create(),W=n.create();n.lerp(Y,V,H,P),n.lerp(W,q,G,P);var X=n.create();return n.lerp(X,Y,W,z),X}(e,t,p)},g=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},m=[],v=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(e<v||e>b||r<y||r>_||n<x||n>w)},k=10*n.distance(e[0],e[1])/i,M=k*k,A=1,S=0,E=r.length;E>1&&(A=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;l<s;l++){var u=t[l],f=u[0],h=u[1],p=u[2];i[f]||(e.push(f),i[f]=!0),a[h]||(r.push(h),a[h]=!0),o[p]||(n.push(p),o[p]=!0)}var d=c(e),g=c(r),m=c(n),v=Math.min(d,g,m);return isFinite(v)?v:1}(r));for(var C=0;C<E;C++){var L=n.create();n.copy(L,r[C]);var I=[L],P=[],z=d(L),O=L;P.push(z);var D=[],R=g(L,z),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F),m.push({points:I,velocities:P,divergences:D});for(var B=0;B<100*i&&I.length<i&&T(L);){B++;var N=n.clone(z),j=n.squaredLength(N);if(0===j)break;if(j>M&&n.scale(N,N,k/Math.sqrt(j)),n.add(N,N,L),z=d(N),n.squaredDistance(O,N)-M>-1e-4*M){I.push(N),O=N,P.push(z);R=g(N,z),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F)}L=N}}var U=o(m,t.colormap,S,A);return f?U.tubeScale=f:(0===S&&(S=1),U.tubeScale=.5*u*A/S),U};var u=t(\"./lib/shaders\"),f=t(\"gl-cone3d\").createMesh;e.exports.createTubeMesh=function(t,e){return f(t,e,{shaders:u,traceType:\"streamtube\"})}},{\"./lib/shaders\":346,\"gl-cone3d\":260,\"gl-vec3\":377,\"gl-vec4\":413}],349:[function(t,e,r){var n=t(\"gl-shader\"),i=t(\"glslify\"),a=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute vec3 f;\\nattribute vec3 normal;\\n\\nuniform vec3 objectOffset;\\nuniform mat4 model, view, projection, inverseModel;\\nuniform vec3 lightPosition, eyePosition;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n vec3 localCoordinate = vec3(uv.zw, f.x);\\n worldCoordinate = objectOffset + localCoordinate;\\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\\n vec4 clipPosition = projection * view * worldPosition;\\n gl_Position = clipPosition;\\n kill = f.y;\\n value = f.z;\\n planeCoordinate = uv.xy;\\n\\n vColor = texture2D(colormap, vec2(value, value));\\n\\n //Lighting geometry parameters\\n vec4 cameraCoordinate = view * worldPosition;\\n cameraCoordinate.xyz /= cameraCoordinate.w;\\n lightDirection = lightPosition - cameraCoordinate.xyz;\\n eyeDirection = eyePosition - cameraCoordinate.xyz;\\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\\n}\\n\"]),o=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution(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\\nfloat beckmannSpecular(\\n vec3 lightDirection,\\n vec3 viewDirection,\\n vec3 surfaceNormal,\\n float roughness) {\\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\\n}\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\n\\nuniform vec3 lowerBound, upperBound;\\nuniform float contourTint;\\nuniform vec4 contourColor;\\nuniform sampler2D colormap;\\nuniform vec3 clipBounds[2];\\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\\nuniform float vertexColor;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n if (\\n kill > 0.0 ||\\n vColor.a == 0.0 ||\\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\\n ) discard;\\n\\n vec3 N = normalize(surfaceNormal);\\n vec3 V = normalize(eyeDirection);\\n vec3 L = normalize(lightDirection);\\n\\n if(gl_FrontFacing) {\\n N = -N;\\n }\\n\\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n //decide how to interpolate color \\u2014 in vertex or in fragment\\n vec4 surfaceColor =\\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\\n step(.5, vertexColor) * vColor;\\n\\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\\n\\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\\n}\\n\"]),s=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute float f;\\n\\nuniform vec3 objectOffset;\\nuniform mat3 permutation;\\nuniform mat4 model, view, projection;\\nuniform float height, zOffset;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\\n worldCoordinate = objectOffset + dataCoordinate;\\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\\n\\n vec4 clipPosition = projection * view * worldPosition;\\n clipPosition.z += zOffset;\\n\\n gl_Position = clipPosition;\\n value = f + objectOffset.z;\\n kill = -1.0;\\n planeCoordinate = uv.zw;\\n\\n vColor = texture2D(colormap, vec2(value, value));\\n\\n //Don't do lighting for contours\\n surfaceNormal = vec3(1,0,0);\\n eyeDirection = vec3(0,1,0);\\n lightDirection = vec3(0,0,1);\\n}\\n\"]),l=i([\"precision highp float;\\n#define GLSLIFY 1\\n\\nbool outOfRange(float a, float b, float p) {\\n return ((p > max(a, b)) || \\n (p < min(a, b)));\\n}\\n\\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y));\\n}\\n\\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\\n return (outOfRange(a.x, b.x, p.x) ||\\n outOfRange(a.y, b.y, p.y) ||\\n outOfRange(a.z, b.z, p.z));\\n}\\n\\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\\n return outOfRange(a.xyz, b.xyz, p.xyz);\\n}\\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\\n\\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\\n}\\n\"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{\"gl-shader\":335,glslify:350}],350:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],351:[function(t,e,r){\"use strict\";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),g=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var m=new A(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,g,s,l,f,h,p,d,[0,0,0]),v={levels:[[],[],[]]};for(var w in t)v[w]=t[w];return v.colormap=v.colormap||\"jet\",m.update(v),m};var n=t(\"bit-twiddle\"),i=t(\"gl-buffer\"),a=t(\"gl-vao\"),o=t(\"gl-texture2d\"),s=t(\"typedarray-pool\"),l=t(\"colormap\"),c=t(\"ndarray-ops\"),u=t(\"ndarray-pack\"),f=t(\"ndarray\"),h=t(\"surface-nets\"),p=t(\"gl-mat4/multiply\"),d=t(\"gl-mat4/invert\"),g=t(\"binary-search-bounds\"),m=t(\"ndarray-gradient\"),v=t(\"./lib/shaders\"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[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 M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function A(t,e,r,n,i,a,o,l,c,u,h,p,d,g,m){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=m,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=h,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=g,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.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.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var S=A.prototype;S.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:256,format:\"rgba\"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var E=[0,0,0],C={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function L(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||E,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=C.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var c=C.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return C.showSurface=o,C.showContour=s,C}var I={model:w,view:w,projection:w,inverseModel:w.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},P=w.slice(),z=[1,0,0,0,1,0,0,0,1];function O(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=I;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=z,n.vertexColor=this.vertexColor;var s=P;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=L(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o<this.contourLevels[i].length;++o)o===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):0!==o&&o-1!==this.highlightLevel[i]||(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),this._contourCounts[i][o]&&(f.uniforms.height=this.contourLevels[i][o],h.draw(r.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(f.uniforms.model=u.projections[i],f.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){f.uniforms.permutation=k[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var g=0;g<this.contourLevels[o].length;++g)g===this.highlightLevel[o]?(f.uniforms.contourColor=this.highlightColor[o],f.uniforms.contourTint=this.highlightTint[o]):0!==g&&g-1!==this.highlightLevel[o]||(f.uniforms.contourColor=this.contourColor[o],f.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][g]&&(f.uniforms.height=this.contourLevels[o][g],h.draw(r.LINES,this._contourCounts[o][g],this._contourOffsets[o][g]))}for(h.unbind(),(h=this._dynamicVAO).bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=k[i],r.lineWidth(this.dynamicWidth[i]*this.pixelRatio),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],h.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(f.uniforms.model=u.projections[o],f.uniforms.clipBounds=u.clipBounds[o],h.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));h.unbind()}}S.draw=function(t){return O.call(this,t,!1)},S.drawTransparent=function(t){return O.call(this,t,!0)};var D={model:w,view:w,projection:w,inverseModel:w,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function R(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function F(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 B(t){if(Array.isArray(t)){if(Array.isArray(t))return[F(t[0]),F(t[1]),F(t[2])];var e=F(t);return[e.slice(),e.slice(),e.slice()]}}S.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=D;r.model=t.model||w,r.view=t.view||w,r.projection=t.projection||w,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=z;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var o=L(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]*this.pixelRatio),s.uniforms.permutation=k[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(s.uniforms.height=this.contourLevels[a][n],l.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){s.uniforms.permutation=k[a],e.lineWidth(this.contourWidth[a]*this.pixelRatio);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(s.uniforms.height=this.contourLevels[a][c],l.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}l.unbind()}},S.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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var p=i+u,d=s+h,m=f*(h?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*m;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=g.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]<this.contourLevels[x].length-1){var b=this.contourLevels[x][y[x]],_=this.contourLevels[x][y[x]+1];Math.abs(b-c[x])>Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.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))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,\"contourWidth\"in t&&(this.contourWidth=R(t.contourWidth,Number)),\"showContour\"in t&&(this.showContour=R(t.showContour,Boolean)),\"showSurface\"in t&&(this.showSurface=!!t.showSurface),\"contourTint\"in t&&(this.contourTint=R(t.contourTint,Boolean)),\"contourColor\"in t&&(this.contourColor=B(t.contourColor)),\"contourProject\"in t&&(this.contourProject=R(t.contourProject,(function(t){return R(t,Boolean)}))),\"surfaceProject\"in t&&(this.surfaceProject=t.surfaceProject),\"dynamicColor\"in t&&(this.dynamicColor=B(t.dynamicColor)),\"dynamicTint\"in t&&(this.dynamicTint=R(t.dynamicTint,Number)),\"dynamicWidth\"in t&&(this.dynamicWidth=R(t.dynamicWidth,Number)),\"opacity\"in t&&(this.opacity=t.opacity),\"opacityscale\"in t&&(this.opacityscale=t.opacityscale),\"colorBounds\"in t&&(this.colorBounds=t.colorBounds),\"vertexColor\"in t&&(this.vertexColor=t.vertexColor?1:0),\"colormap\"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),\"field\"in t||\"coords\"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error(\"gl-surface: invalid coordinates for x/y\");for(o=0;o<2;++o){var c=l[o];for(v=0;v<2;++v)if(c.shape[v]!==a[v])throw new Error(\"gl-surface: coords have incorrect shape\");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error(\"gl-surface: invalid ticks\");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error(\"gl-surface: invalid tick length\");var d=f(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],g,0)}this._field[0].set(0,0,0);for(var v=0;v<a[0];++v)this._field[0].set(v+1,0,v);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),v=0;v<a[1];++v)this._field[1].set(0,v+1,v);this._field[1].set(0,a[1]+1,a[1]-1)}var y=this._field,x=f(s.mallocFloat(3*y[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)m(x.pick(o),y[o],\"mirror\");var b=f(s.mallocFloat(3*y[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(v=0;v<a[1]+2;++v){var _=x.get(0,o,v,0),w=x.get(0,o,v,1),k=x.get(1,o,v,0),M=x.get(1,o,v,1),A=x.get(2,o,v,0),S=x.get(2,o,v,1),E=k*S-M*A,C=A*w-S*_,L=_*M-w*k,I=Math.sqrt(E*E+C*C+L*L);I<1e-8?(I=Math.max(Math.abs(E),Math.abs(C),Math.abs(L)))<1e-8?(L=1,C=E=0,I=1):I=1/I:I=1/Math.sqrt(I),b.set(o,v,0,E*I),b.set(o,v,1,C*I),b.set(o,v,2,L*I)}s.free(x.data);var P=[1/0,1/0,1/0],z=[-1/0,-1/0,-1/0],O=1/0,D=-1/0,F=(a[0]-1)*(a[1]-1)*6,N=s.mallocFloat(n.nextPow2(10*F)),j=0,U=0;for(o=0;o<a[0]-1;++o)t:for(v=0;v<a[1]-1;++v){for(var V=0;V<2;++V)for(var q=0;q<2;++q)for(var H=0;H<3;++H){var G=this._field[H].get(1+o+V,1+v+q);if(isNaN(G)||!isFinite(G))continue t}for(H=0;H<6;++H){var Y=o+T[H][0],W=v+T[H][1],X=this._field[0].get(Y+1,W+1),Z=this._field[1].get(Y+1,W+1);G=this._field[2].get(Y+1,W+1),E=b.get(Y+1,W+1,0),C=b.get(Y+1,W+1,1),L=b.get(Y+1,W+1,2),t.intensity&&(J=t.intensity.get(Y,W));var J=t.intensity?t.intensity.get(Y,W):G+this.objectOffset[2];N[j++]=Y,N[j++]=W,N[j++]=X,N[j++]=Z,N[j++]=G,N[j++]=0,N[j++]=J,N[j++]=E,N[j++]=C,N[j++]=L,P[0]=Math.min(P[0],X+this.objectOffset[0]),P[1]=Math.min(P[1],Z+this.objectOffset[1]),P[2]=Math.min(P[2],G+this.objectOffset[2]),O=Math.min(O,J),z[0]=Math.max(z[0],X+this.objectOffset[0]),z[1]=Math.max(z[1],Z+this.objectOffset[1]),z[2]=Math.max(z[2],G+this.objectOffset[2]),D=Math.max(D,J),U+=1}}for(t.intensityBounds&&(O=+t.intensityBounds[0],D=+t.intensityBounds[1]),o=6;o<j;o+=10)N[o]=(N[o]-O)/(D-O);this._vertexCount=U,this._coordinateBuffer.update(N.subarray(0,j)),s.freeFloat(N),s.free(b.data),this.bounds=[P,z],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===O&&this.intensityBounds[1]===D||(r=!0),this.intensityBounds=[O,D]}if(\"levels\"in t){var K=t.levels;for(K=Array.isArray(K[0])?K.slice():[[],[],K],o=0;o<3;++o)K[o]=K[o].slice(),K[o].sort((function(t,e){return t-e}));for(o=0;o<3;++o)for(v=0;v<K[o].length;++v)K[o][v]-=this.objectOffset[o];t:for(o=0;o<3;++o){if(K[o].length!==this.contourLevels[o].length){r=!0;break}for(v=0;v<K[o].length;++v)if(K[o][v]!==this.contourLevels[o][v]){r=!0;break t}}this.contourLevels=K}if(r){y=this._field,a=this.shape;for(var Q=[],$=0;$<3;++$){var tt=this.contourLevels[$],et=[],rt=[],nt=[0,0,0];for(o=0;o<tt.length;++o){var it=h(this._field[$],tt[o]);et.push(Q.length/5|0),U=0;t:for(v=0;v<it.cells.length;++v){var at=it.cells[v];for(H=0;H<2;++H){var ot=it.positions[at[H]],st=ot[0],lt=0|Math.floor(st),ct=st-lt,ut=ot[1],ft=0|Math.floor(ut),ht=ut-ft,pt=!1;e:for(var dt=0;dt<3;++dt){nt[dt]=0;var gt=($+dt+1)%3;for(V=0;V<2;++V){var mt=V?ct:1-ct;for(Y=0|Math.min(Math.max(lt+V,0),a[0]),q=0;q<2;++q){var vt=q?ht:1-ht;if(W=0|Math.min(Math.max(ft+q,0),a[1]),G=dt<2?this._field[gt].get(Y,W):(this.intensity.get(Y,W)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(G)||isNaN(G)){pt=!0;break e}var yt=mt*vt;nt[dt]+=yt*G}}}if(pt){if(H>0){for(var xt=0;xt<5;++xt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var bt=s.mallocFloat(Q.length);for(o=0;o<Q.length;++o)bt[o]=Q[o];this._contourBuffer.update(bt),s.freeFloat(bt)}},S.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;t<3;++t)s.freeFloat(this._field[t].data)},S.highlight=function(t){var e,r;if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;for(r=this.snapToData?t.dataCoordinate:t.position,e=0;e<3;++e)r[e]-=this.objectOffset[e];if(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=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],f=this._field[l],p=this._field[c],d=h(u,r[o]),g=d.cells,m=d.positions;for(this._dynamicOffsets[o]=n,e=0;e<g.length;++e)for(var v=g[e],y=0;y<2;++y){var x=m[v[y]],b=+x[0],_=0|b,w=0|Math.min(_+1,i[0]),T=b-_,k=1-T,M=+x[1],A=0|M,S=0|Math.min(A+1,i[1]),E=M-A,C=1-E,L=k*C,I=k*E,P=T*C,z=T*E,O=L*f.get(_,A)+I*f.get(_,S)+P*f.get(w,A)+z*f.get(w,S),D=L*p.get(_,A)+I*p.get(_,S)+P*p.get(w,A)+z*p.get(w,S);if(isNaN(O)||isNaN(D)){y&&(n-=1);break}a[2*n+0]=O,a[2*n+1]=D,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)),s.freeFloat(a)}}},{\"./lib/shaders\":349,\"binary-search-bounds\":96,\"bit-twiddle\":97,colormap:131,\"gl-buffer\":259,\"gl-mat4/invert\":293,\"gl-mat4/multiply\":295,\"gl-texture2d\":353,\"gl-vao\":358,ndarray:495,\"ndarray-gradient\":488,\"ndarray-ops\":490,\"ndarray-pack\":491,\"surface-nets\":570,\"typedarray-pool\":595}],352:[function(t,e,r){\"use strict\";var n=t(\"css-font\"),i=t(\"pick-by-alias\"),a=t(\"regl\"),o=t(\"gl-util/context\"),s=t(\"es6-weak-map\"),l=t(\"color-normalize\"),c=t(\"font-atlas\"),u=t(\"typedarray-pool\"),f=t(\"parse-rect\"),h=t(\"is-plain-obj\"),p=t(\"parse-unit\"),d=t(\"to-px\"),g=t(\"detect-kerning\"),m=t(\"object-assign\"),v=t(\"font-measure\"),y=t(\"flatten-vertex-data\"),x=t(\"bit-twiddle\").nextPow2,b=new s,_=!1;if(document.body){var w=document.body.appendChild(document.createElement(\"div\"));w.style.font=\"italic small-caps bold condensed 16px/2 cursive\",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w)}var T=function(t){!function(t){return\"function\"==typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=o(t):(t={regl:t},this.gl=t.regl._gl),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:\"uint8\",usage:\"stream\"}),this.sizeBuffer=this.regl.buffer({type:\"float\",usage:\"stream\"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(h(t)?t:{})};T.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:\"src alpha\",dstRGB:\"one minus src alpha\",srcAlpha:\"one minus dst alpha\",dstAlpha:\"one\"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop(\"count\"),offset:t.prop(\"offset\"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this(\"sizeBuffer\")},width:{offset:0,stride:8,buffer:t.this(\"sizeBuffer\")},char:t.this(\"charBuffer\"),position:t.this(\"position\")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop(\"color\"),opacity:t.prop(\"opacity\"),viewport:t.this(\"viewportArray\"),scale:t.this(\"scale\"),align:t.prop(\"align\"),baseline:t.prop(\"baseline\"),translate:t.this(\"translate\"),positionOffset:t.prop(\"positionOffset\")},primitive:\"points\",viewport:t.this(\"viewport\"),vert:\"\\n\\t\\t\\tprecision highp float;\\n\\t\\t\\tattribute float width, charOffset, char;\\n\\t\\t\\tattribute vec2 position;\\n\\t\\t\\tuniform float fontSize, charStep, em, align, baseline;\\n\\t\\t\\tuniform vec4 viewport;\\n\\t\\t\\tuniform vec4 color;\\n\\t\\t\\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\\n\\t\\t\\tvarying vec2 charCoord, charId;\\n\\t\\t\\tvarying float charWidth;\\n\\t\\t\\tvarying vec4 fontColor;\\n\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\"+(T.normalViewport?\"\":\"vec2 positionOffset = vec2(positionOffset.x,- positionOffset.y);\")+\"\\n\\n\\t\\t\\t\\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\\n\\t\\t\\t\\t\\t+ positionOffset))\\n\\t\\t\\t\\t\\t/ (viewport.zw * scale.xy);\\n\\n\\t\\t\\t\\tvec2 position = (position + translate) * scale;\\n\\t\\t\\t\\tposition += offset * scale;\\n\\n\\t\\t\\t\\t\"+(T.normalViewport?\"position.y = 1. - position.y;\":\"\")+\"\\n\\n\\t\\t\\t\\tcharCoord = position * viewport.zw + viewport.xy;\\n\\n\\t\\t\\t\\tgl_Position = vec4(position * 2. - 1., 0, 1);\\n\\n\\t\\t\\t\\tgl_PointSize = charStep;\\n\\n\\t\\t\\t\\tcharId.x = mod(char, atlasDim.x);\\n\\t\\t\\t\\tcharId.y = floor(char / atlasDim.x);\\n\\n\\t\\t\\t\\tcharWidth = width * em;\\n\\n\\t\\t\\t\\tfontColor = color / 255.;\\n\\t\\t\\t}\",frag:\"\\n\\t\\t\\tprecision highp float;\\n\\t\\t\\tuniform sampler2D atlas;\\n\\t\\t\\tuniform float fontSize, charStep, opacity;\\n\\t\\t\\tuniform vec2 atlasSize;\\n\\t\\t\\tuniform vec4 viewport;\\n\\t\\t\\tvarying vec4 fontColor;\\n\\t\\t\\tvarying vec2 charCoord, charId;\\n\\t\\t\\tvarying float charWidth;\\n\\n\\t\\t\\tfloat lightness(vec4 color) {\\n\\t\\t\\t\\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\\n\\t\\t\\t}\\n\\n\\t\\t\\tvoid main () {\\n\\t\\t\\t\\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\\n\\t\\t\\t\\tfloat halfCharStep = floor(charStep * .5 + .5);\\n\\n\\t\\t\\t\\t// invert y and shift by 1px (FF expecially needs that)\\n\\t\\t\\t\\tuv.y = charStep - uv.y;\\n\\n\\t\\t\\t\\t// ignore points outside of character bounding box\\n\\t\\t\\t\\tfloat halfCharWidth = ceil(charWidth * .5);\\n\\t\\t\\t\\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\\n\\t\\t\\t\\t\\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\\n\\n\\t\\t\\t\\tuv += charId * charStep;\\n\\t\\t\\t\\tuv = uv / atlasSize;\\n\\n\\t\\t\\t\\tvec4 color = fontColor;\\n\\t\\t\\t\\tvec4 mask = texture2D(atlas, uv);\\n\\n\\t\\t\\t\\tfloat maskY = lightness(mask);\\n\\t\\t\\t\\t// float colorY = lightness(color);\\n\\t\\t\\t\\tcolor.a *= maskY;\\n\\t\\t\\t\\tcolor.a *= opacity;\\n\\n\\t\\t\\t\\t// color.a += .1;\\n\\n\\t\\t\\t\\t// antialiasing, see yiq color space y-channel formula\\n\\t\\t\\t\\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\\n\\n\\t\\t\\t\\tgl_FragColor = color;\\n\\t\\t\\t}\"});return{regl:t,draw:e,atlas:{}}},T.prototype.update=function(t){var e=this;if(\"string\"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:\"position positions coord coords coordinates\",font:\"font fontFace fontface typeface cssFont css-font family fontFamily\",fontSize:\"fontSize fontsize size font-size\",text:\"text texts chars characters value values symbols\",align:\"align alignment textAlign textbaseline\",baseline:\"baseline textBaseline textbaseline\",direction:\"dir direction textDirection\",color:\"color colour fill fill-color fillColor textColor textcolor\",kerning:\"kerning kern\",range:\"range dataBox\",viewport:\"vp viewport viewBox viewbox viewPort\",opacity:\"opacity alpha transparency visible visibility opaque\",offset:\"offset positionOffset padding shift indent indentation\"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),T.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&(\"number\"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=T.baseFontSize+\"px sans-serif\");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if(\"string\"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(T.baseFontSize+\"px \"+t)}else t=n.parse(n.stringify(t));var i=n.stringify({size:T.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=p(t.size),l=Math.round(s[0]*d(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&i==e.font[r].baseString||(a=!0,e.font[r]=T.fonts[i],e.font[r]))){var c=t.family.join(\", \"),u=[t.style];t.style!=t.variant&&u.push(t.variant),t.variant!=t.weight&&u.push(t.weight),_&&t.weight!=t.stretch&&u.push(t.stretch),e.font[r]={baseString:i,family:c,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:v(c,{origin:\"top\",fontSize:T.baseFontSize,fontStyle:u.join(\" \")})},T.fonts[i]=e.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),\"string\"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),h=0;h<s.length;h++)s[h]=t.text;t.text=s}if(null!=t.text||a){if(this.textOffsets=[0],Array.isArray(t.text)){this.count=t.text[0].length,this.counts=[this.count];for(var b=1;b<t.text.length;b++)this.textOffsets[b]=this.textOffsets[b-1]+t.text[b-1].length,this.count+=t.text[b].length,this.counts.push(t.text[b].length);this.text=t.text.join(\"\")}else this.text=t.text,this.count=this.text.length,this.counts=[this.count];r=[],this.font.forEach((function(t,n){T.atlasContext.font=t.baseString;for(var i=e.fontAtlas[n],a=0;a<e.text.length;a++){var o=e.text.charAt(a);if(null==i.ids[o]&&(i.ids[o]=i.chars.length,i.chars.push(o),r.push(o)),null==t.width[o]&&(t.width[o]=T.atlasContext.measureText(o).width/T.baseFontSize,e.kerning)){var s=[];for(var l in t.width)s.push(l+o,o+l);m(t.kerning,g(t.family,{pairs:s}))}}}))}if(t.position)if(t.position.length>2){for(var w=!t.position[0].length,k=u.mallocFloat(2*this.count),M=0,A=0;M<this.counts.length;M++){var S=this.counts[M];if(w)for(var E=0;E<S;E++)k[A++]=t.position[2*M],k[A++]=t.position[2*M+1];else for(var C=0;C<S;C++)k[A++]=t.position[M][0],k[A++]=t.position[M][1]}this.position.call?this.position({type:\"float\",data:k}):this.position=this.regl.buffer({type:\"float\",data:k}),u.freeFloat(k)}else this.position.destroy&&this.position.destroy(),this.position={constant:t.position};if(t.text||a){var L=u.mallocUint8(this.count),I=u.mallocFloat(2*this.count);this.textWidth=[];for(var P=0,z=0;P<this.counts.length;P++){for(var O=this.counts[P],D=this.font[P]||this.font[0],R=this.fontAtlas[P]||this.fontAtlas[0],F=0;F<O;F++){var B=this.text.charAt(z),N=this.text.charAt(z-1);if(L[z]=R.ids[B],I[2*z]=D.width[B],F){var j=I[2*z-2],U=I[2*z],V=I[2*z-1]+.5*j+.5*U;if(this.kerning){var q=D.kerning[N+B];q&&(V+=.001*q)}I[2*z+1]=V}else I[2*z+1]=.5*I[2*z];z++}this.textWidth.push(I.length?.5*I[2*z-2]+I[2*z-1]:0)}t.align||(t.align=this.align),this.charBuffer({data:L,type:\"uint8\",usage:\"stream\"}),this.sizeBuffer({data:I,type:\"float\",usage:\"stream\"}),u.freeUint8(L),u.freeFloat(I),r.length&&this.font.forEach((function(t,r){var n=e.fontAtlas[r],i=n.step,a=Math.floor(T.maxAtlasSize/i),o=Math.min(a,n.chars.length),s=Math.ceil(n.chars.length/o),l=x(o*i),u=x(s*i);n.width=l,n.height=u,n.rows=s,n.cols=o,n.em&&n.texture({data:c({canvas:T.atlasCanvas,font:n.fontString,chars:n.chars,shape:[l,u],step:[i,i]})})}))}if(t.align&&(this.align=t.align,this.alignOffset=this.textWidth.map((function(t,r){var n=Array.isArray(e.align)?e.align.length>1?e.align[r]:e.align[0]:e.align;if(\"number\"==typeof n)return n;switch(n){case\"right\":case\"end\":return-t;case\"center\":case\"centre\":case\"middle\":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+=\"number\"==typeof t?t-n.baseline:-n[t],T.normalViewport||(i*=-1),i}))),null!=t.color)if(t.color||(t.color=\"transparent\"),\"string\"!=typeof t.color&&isNaN(t.color)){var H;if(\"number\"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;H=u.mallocUint8(G);for(var Y=(t.color.subarray||t.color.slice).bind(t.color),W=0;W<G;W+=4)H.set(l(Y(W,W+4),\"uint8\"),W)}else{var X=t.color.length;H=u.mallocUint8(4*X);for(var Z=0;Z<X;Z++)H.set(l(t.color[Z]||0,\"uint8\"),4*Z)}this.color=H}else this.color=l(t.color,\"uint8\");if(t.position||t.text||t.color||t.baseline||t.align||t.font||t.offset||t.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},T.prototype.destroy=function(){},T.prototype.kerning=!0,T.prototype.position={constant:new Float32Array(2)},T.prototype.translate=null,T.prototype.scale=null,T.prototype.font=null,T.prototype.text=\"\",T.prototype.positionOffset=[0,0],T.prototype.opacity=1,T.prototype.color=new Uint8Array([0,0,0,255]),T.prototype.alignOffset=[0,0],T.normalViewport=!1,T.maxAtlasSize=1024,T.atlasCanvas=document.createElement(\"canvas\"),T.atlasContext=T.atlasCanvas.getContext(\"2d\",{alpha:!1}),T.baseFontSize=64,T.fonts={},e.exports=T},{\"bit-twiddle\":97,\"color-normalize\":125,\"css-font\":144,\"detect-kerning\":172,\"es6-weak-map\":233,\"flatten-vertex-data\":244,\"font-atlas\":245,\"font-measure\":246,\"gl-util/context\":354,\"is-plain-obj\":469,\"object-assign\":499,\"parse-rect\":504,\"parse-unit\":506,\"pick-by-alias\":511,regl:540,\"to-px\":578,\"typedarray-pool\":595}],353:[function(t,e,r){\"use strict\";var n=t(\"ndarray\"),i=t(\"ndarray-ops\"),a=t(\"typedarray-pool\");e.exports=function(t){if(arguments.length<=1)throw new Error(\"gl-texture2d: Missing arguments for texture2d constructor\");o||c(t);if(\"number\"==typeof arguments[1])return v(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return v(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(\"object\"==typeof arguments[1]){var e=arguments[1],r=u(e)?e:e.raw;if(r)return y(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return x(t,e)}throw new Error(\"gl-texture2d: Invalid arguments for texture2d constructor\")};var o=null,s=null,l=null;function c(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function u(t){return\"undefined\"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||\"undefined\"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||\"undefined\"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||\"undefined\"!=typeof ImageData&&t instanceof ImageData}var f=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error(\"gl-texture2d: Invalid texture size\");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function p(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}var d=p.prototype;function g(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 m(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 v(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error(\"gl-texture2d: Invalid texture shape\");if(i===t.FLOAT&&!t.getExtension(\"OES_texture_float\"))throw new Error(\"gl-texture2d: Floating point textures not supported on this platform\");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new p(t,o,e,r,n,i)}function y(t,e,r,n,i,a){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new p(t,o,r,n,i,a)}function x(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error(\"gl-texture2d: Invalid texture size\");var l=g(o,e.stride.slice()),c=0;\"float32\"===r?c=t.FLOAT:\"float64\"===r?(c=t.FLOAT,l=!1,r=\"float32\"):\"uint8\"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r=\"uint8\");var u,h,d=0;if(2===o.length)d=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===o[2])d=t.ALPHA;else if(2===o[2])d=t.LUMINANCE_ALPHA;else if(3===o[2])d=t.RGB;else{if(4!==o[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");d=t.RGBA}}c!==t.FLOAT||t.getExtension(\"OES_texture_float\")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)u=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];h=a.malloc(v,r);var x=n(h,o,y,0);\"float32\"!==r&&\"float64\"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):f(x,e),u=h.subarray(0,v)}var b=m(t);return t.texImage2D(t.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||a.free(h),new p(t,b,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown filter mode \"+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension(\"EXT_texture_filter_anisotropic\");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.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(),l.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error(\"gl-texture2d: Must specify wrap mode for rows and columns\");for(var e=0;e<2;++e)if(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),d.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},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.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)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error(\"gl-texture2d: Texture dimensions are out of bounds\");!function(t,e,r,o,s,l,c,u){var h=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw new Error(\"gl-texture2d: Invalid ndarray, must be 2d or 3d\");var d=0,m=0,v=g(p,u.stride.slice());\"float32\"===h?d=t.FLOAT:\"float64\"===h?(d=t.FLOAT,v=!1,h=\"float32\"):\"uint8\"===h?d=t.UNSIGNED_BYTE:(d=t.UNSIGNED_BYTE,v=!1,h=\"uint8\");if(2===p.length)m=t.LUMINANCE,p=[p[0],p[1],1],u=n(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==p.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===p[2])m=t.ALPHA;else if(2===p[2])m=t.LUMINANCE_ALPHA;else if(3===p[2])m=t.RGB;else{if(4!==p[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");m=t.RGBA}p[2]}m!==t.LUMINANCE&&m!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(m=s);if(m!==s)throw new Error(\"gl-texture2d: Incompatible texture format for setPixels\");var y=u.size,x=c.indexOf(o)<0;x&&c.push(o);if(d===l&&v)0===u.offset&&u.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data.subarray(u.offset,u.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data.subarray(u.offset,u.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);d===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,u):i.assign(_,u),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:495,\"ndarray-ops\":490,\"typedarray-pool\":595}],354:[function(t,e,r){(function(r){(function(){\"use strict\";var n=t(\"pick-by-alias\");function i(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function a(t){return\"function\"==typeof t.getContext&&\"width\"in t&&\"height\"in t}function o(){var t=document.createElement(\"canvas\");return t.style.position=\"absolute\",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?\"string\"==typeof t&&(t={container:t}):t={},a(t)?t={container:t}:t=\"string\"==typeof(e=t).nodeName&&\"function\"==typeof e.appendChild&&\"function\"==typeof e.getBoundingClientRect?{container:t}:function(t){return\"function\"==typeof t.drawArrays||\"function\"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:\"container target element el canvas holder parent parentNode wrapper use ref root node\",gl:\"gl context webgl glContext\",attrs:\"attributes attrs contextAttributes\",pixelRatio:\"pixelRatio pxRatio px ratio pxratio pixelratio\",width:\"w width\",height:\"h height\"},!0),t.pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if(\"string\"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error(\"Element \"+t.container+\" is not found\");t.container=s}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),i(t))}else if(!t.canvas){if(\"undefined\"==typeof document)throw Error(\"Not DOM environment. Use headless-gl.\");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),i(t)}if(!t.gl)try{t.gl=t.canvas.getContext(\"webgl\",t.attrs)}catch(e){try{t.gl=t.canvas.getContext(\"experimental-webgl\",t.attrs)}catch(e){t.gl=t.canvas.getContext(\"webgl-experimental\",t.attrs)}}return t.gl}}).call(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"pick-by-alias\":511}],355:[function(t,e,r){\"use strict\";e.exports=function(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,c=!!a.normalized,u=a.stride||0,f=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,c,u,f)}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(;i<n;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(i=0;i<n;++i)t.disableVertexAttribArray(i)}}},{}],356:[function(t,e,r){\"use strict\";var n=t(\"./do-bind.js\");function i(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},i.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.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=function(t){return new i(t)}},{\"./do-bind.js\":355}],357:[function(t,e,r){\"use strict\";var n=t(\"./do-bind.js\");function i(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 a(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}i.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)}},a.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},a.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},a.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},a.prototype.update=function(t,e,r){if(this.bind(),n(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var a=0;a<t.length;++a){var o=t[a];\"number\"==typeof o?this._attribs.push(new i(a,1,o)):Array.isArray(o)&&this._attribs.push(new i(a,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.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=function(t,e){return new a(t,e,e.createVertexArrayOES())}},{\"./do-bind.js\":355}],358:[function(t,e,r){\"use strict\";var n=t(\"./lib/vao-native.js\"),i=t(\"./lib/vao-emulated.js\");function a(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}e.exports=function(t,e,r,o){var s,l=t.createVertexArray?new a(t):t.getExtension(\"OES_vertex_array_object\");return(s=l?n(t,l):i(t)).update(e,r,o),s}},{\"./lib/vao-emulated.js\":356,\"./lib/vao-native.js\":357}],359:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}},{}],360:[function(t,e,r){e.exports=function(t,e){var r=n(t[0],t[1],t[2]),o=n(e[0],e[1],e[2]);i(r,r),i(o,o);var s=a(r,o);return s>1?0:Math.acos(s)};var n=t(\"./fromValues\"),i=t(\"./normalize\"),a=t(\"./dot\")},{\"./dot\":370,\"./fromValues\":376,\"./normalize\":387}],361:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],362:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],363:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],364:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],365:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],366:[function(t,e,r){e.exports=t(\"./distance\")},{\"./distance\":367}],367:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},{}],368:[function(t,e,r){e.exports=t(\"./divide\")},{\"./divide\":369}],369:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],370:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],371:[function(t,e,r){e.exports=1e-6},{}],372:[function(t,e,r){e.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t(\"./epsilon\")},{\"./epsilon\":371}],373:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],374:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],375:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s<l;s+=e)n[0]=t[s],n[1]=t[s+1],n[2]=t[s+2],a(n,n,o),t[s]=n[0],t[s+1]=n[1],t[s+2]=n[2];return t};var n=t(\"./create\")()},{\"./create\":364}],376:[function(t,e,r){e.exports=function(t,e,r){var n=new Float32Array(3);return n[0]=t,n[1]=e,n[2]=r,n}},{}],377:[function(t,e,r){e.exports={EPSILON:t(\"./epsilon\"),create:t(\"./create\"),clone:t(\"./clone\"),angle:t(\"./angle\"),fromValues:t(\"./fromValues\"),copy:t(\"./copy\"),set:t(\"./set\"),equals:t(\"./equals\"),exactEquals:t(\"./exactEquals\"),add:t(\"./add\"),subtract:t(\"./subtract\"),sub:t(\"./sub\"),multiply:t(\"./multiply\"),mul:t(\"./mul\"),divide:t(\"./divide\"),div:t(\"./div\"),min:t(\"./min\"),max:t(\"./max\"),floor:t(\"./floor\"),ceil:t(\"./ceil\"),round:t(\"./round\"),scale:t(\"./scale\"),scaleAndAdd:t(\"./scaleAndAdd\"),distance:t(\"./distance\"),dist:t(\"./dist\"),squaredDistance:t(\"./squaredDistance\"),sqrDist:t(\"./sqrDist\"),length:t(\"./length\"),len:t(\"./len\"),squaredLength:t(\"./squaredLength\"),sqrLen:t(\"./sqrLen\"),negate:t(\"./negate\"),inverse:t(\"./inverse\"),normalize:t(\"./normalize\"),dot:t(\"./dot\"),cross:t(\"./cross\"),lerp:t(\"./lerp\"),random:t(\"./random\"),transformMat4:t(\"./transformMat4\"),transformMat3:t(\"./transformMat3\"),transformQuat:t(\"./transformQuat\"),rotateX:t(\"./rotateX\"),rotateY:t(\"./rotateY\"),rotateZ:t(\"./rotateZ\"),forEach:t(\"./forEach\")}},{\"./add\":359,\"./angle\":360,\"./ceil\":361,\"./clone\":362,\"./copy\":363,\"./create\":364,\"./cross\":365,\"./dist\":366,\"./distance\":367,\"./div\":368,\"./divide\":369,\"./dot\":370,\"./epsilon\":371,\"./equals\":372,\"./exactEquals\":373,\"./floor\":374,\"./forEach\":375,\"./fromValues\":376,\"./inverse\":378,\"./len\":379,\"./length\":380,\"./lerp\":381,\"./max\":382,\"./min\":383,\"./mul\":384,\"./multiply\":385,\"./negate\":386,\"./normalize\":387,\"./random\":388,\"./rotateX\":389,\"./rotateY\":390,\"./rotateZ\":391,\"./round\":392,\"./scale\":393,\"./scaleAndAdd\":394,\"./set\":395,\"./sqrDist\":396,\"./sqrLen\":397,\"./squaredDistance\":398,\"./squaredLength\":399,\"./sub\":400,\"./subtract\":401,\"./transformMat3\":402,\"./transformMat4\":403,\"./transformQuat\":404}],378:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}},{}],379:[function(t,e,r){e.exports=t(\"./length\")},{\"./length\":380}],380:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}},{}],381:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}},{}],382:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}},{}],383:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}},{}],384:[function(t,e,r){e.exports=t(\"./multiply\")},{\"./multiply\":385}],385:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}},{}],386:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}},{}],387:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],388:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],389:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},{}],390:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},{}],391:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},{}],392:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],393:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],394:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},{}],395:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],396:[function(t,e,r){e.exports=t(\"./squaredDistance\")},{\"./squaredDistance\":398}],397:[function(t,e,r){e.exports=t(\"./squaredLength\")},{\"./squaredLength\":399}],398:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},{}],399:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],400:[function(t,e,r){e.exports=t(\"./subtract\")},{\"./subtract\":401}],401:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],402:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},{}],403:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},{}],404:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t}},{}],405:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},{}],406:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],407:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],408:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],409:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},{}],410:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},{}],411:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],412:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],413:[function(t,e,r){e.exports={create:t(\"./create\"),clone:t(\"./clone\"),fromValues:t(\"./fromValues\"),copy:t(\"./copy\"),set:t(\"./set\"),add:t(\"./add\"),subtract:t(\"./subtract\"),multiply:t(\"./multiply\"),divide:t(\"./divide\"),min:t(\"./min\"),max:t(\"./max\"),scale:t(\"./scale\"),scaleAndAdd:t(\"./scaleAndAdd\"),distance:t(\"./distance\"),squaredDistance:t(\"./squaredDistance\"),length:t(\"./length\"),squaredLength:t(\"./squaredLength\"),negate:t(\"./negate\"),inverse:t(\"./inverse\"),normalize:t(\"./normalize\"),dot:t(\"./dot\"),lerp:t(\"./lerp\"),random:t(\"./random\"),transformMat4:t(\"./transformMat4\"),transformQuat:t(\"./transformQuat\")}},{\"./add\":405,\"./clone\":406,\"./copy\":407,\"./create\":408,\"./distance\":409,\"./divide\":410,\"./dot\":411,\"./fromValues\":412,\"./inverse\":414,\"./length\":415,\"./lerp\":416,\"./max\":417,\"./min\":418,\"./multiply\":419,\"./negate\":420,\"./normalize\":421,\"./random\":422,\"./scale\":423,\"./scaleAndAdd\":424,\"./set\":425,\"./squaredDistance\":426,\"./squaredLength\":427,\"./subtract\":428,\"./transformMat4\":429,\"./transformQuat\":430}],414:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},{}],415:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},{}],416:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],417:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},{}],418:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},{}],419:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},{}],420:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],421:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],422:[function(t,e,r){var n=t(\"./normalize\"),i=t(\"./scale\");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{\"./normalize\":421,\"./scale\":423}],423:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},{}],424:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},{}],425:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],426:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},{}],427:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],428:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},{}],429:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],430:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t[3]=e[3],t}},{}],431:[function(t,e,r){var n=t(\"glsl-tokenizer\"),i=t(\"atob-lite\");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r<e.length;r++){var a=e[r];if(\"preprocessor\"===a.type){var o=a.data.match(/\\#define\\s+SHADER_NAME(_B64)?\\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?i(l):l).trim()}}}}},{\"atob-lite\":77,\"glsl-tokenizer\":438}],432:[function(t,e,r){e.exports=function(t){var e,r,c,u=0,f=0,h=999,p=[],d=[],g=1,m=0,v=0,y=!1,x=!1,b=\"\",_=a,w=n;\"300 es\"===(t=t||{}).version&&(_=s,w=o);var T={},k={};for(u=0;u<_.length;u++)T[_[u]]=!0;for(u=0;u<w.length;u++)k[w[u]]=!0;return function(t){return d=[],null!==t?function(t){u=0,t.toString&&(t=t.toString());var r;b+=t.replace(/\\r\\n/g,\"\\n\"),c=b.length;for(;e=b[u],u<c;){switch(r=u,h){case 0:u=C();break;case 1:case 2:u=E();break;case 3:u=L();break;case 4:u=z();break;case 11:u=P();break;case 5:u=O();break;case 9999:u=D();break;case 9:u=S();break;case 999:u=A()}if(r!==u)switch(b[r]){case\"\\n\":m=0,++g;break;default:++m}}return f+=u,b=b.slice(u),d}(t):function(t){p.length&&M(p.join(\"\"));return h=10,M(\"(eof)\"),d}()};function M(t){t.length&&d.push({type:l[h],data:t,position:v,line:g,column:m})}function A(){return p=p.length?[]:p,\"/\"===r&&\"*\"===e?(v=f+u-1,h=0,r=e,u+1):\"/\"===r&&\"/\"===e?(v=f+u-1,h=1,r=e,u+1):\"#\"===e?(h=2,v=f+u,u):/\\s/.test(e)?(h=9,v=f+u,u):(y=/\\d/.test(e),x=/[^\\w_]/.test(e),v=f+u,h=y?4:x?3:9999,u)}function S(){return/[^\\s]/g.test(e)?(M(p.join(\"\")),h=999,u):(p.push(e),r=e,u+1)}function E(){return\"\\r\"!==e&&\"\\n\"!==e||\"\\\\\"===r?(p.push(e),r=e,u+1):(M(p.join(\"\")),h=999,u)}function C(){return\"/\"===e&&\"*\"===r?(p.push(e),M(p.join(\"\")),h=999,u+1):(p.push(e),r=e,u+1)}function L(){if(\".\"===r&&/\\d/.test(e))return h=5,u;if(\"/\"===r&&\"*\"===e)return h=0,u;if(\"/\"===r&&\"/\"===e)return h=1,u;if(\".\"===e&&p.length){for(;I(p););return h=5,u}if(\";\"===e||\")\"===e||\"(\"===e){if(p.length)for(;I(p););return M(e),h=999,u+1}var t=2===p.length&&\"=\"!==e;if(/[\\w_\\d\\s]/.test(e)||t){for(;I(p););return h=999,u}return p.push(e),r=e,u+1}function I(t){for(var e,r,n=0;;){if(e=i.indexOf(t.slice(0,t.length+n).join(\"\")),r=i[e],-1===e){if(n--+t.length>0)continue;r=t.slice(0,1).join(\"\")}return M(r),v+=r.length,(p=p.slice(r.length)).length}}function P(){return/[^a-fA-F0-9]/.test(e)?(M(p.join(\"\")),h=999,u):(p.push(e),r=e,u+1)}function z(){return\".\"===e||/[eE]/.test(e)?(p.push(e),h=5,r=e,u+1):\"x\"===e&&1===p.length&&\"0\"===p[0]?(h=11,p.push(e),r=e,u+1):/[^\\d]/.test(e)?(M(p.join(\"\")),h=999,u):(p.push(e),r=e,u+1)}function O(){return\"f\"===e&&(p.push(e),r=e,u+=1),/[eE]/.test(e)?(p.push(e),r=e,u+1):(\"-\"!==e&&\"+\"!==e||!/[eE]/.test(r))&&/[^\\d]/.test(e)?(M(p.join(\"\")),h=999,u):(p.push(e),r=e,u+1)}function D(){if(/[^\\d\\w_]/.test(e)){var t=p.join(\"\");return h=k[t]?8:T[t]?7:6,M(p.join(\"\")),h=999,u}return p.push(e),r=e,u+1}};var n=t(\"./lib/literals\"),i=t(\"./lib/operators\"),a=t(\"./lib/builtins\"),o=t(\"./lib/literals-300es\"),s=t(\"./lib/builtins-300es\"),l=[\"block-comment\",\"line-comment\",\"preprocessor\",\"operator\",\"integer\",\"float\",\"ident\",\"builtin\",\"keyword\",\"whitespace\",\"eof\",\"integer\"]},{\"./lib/builtins\":434,\"./lib/builtins-300es\":433,\"./lib/literals\":436,\"./lib/literals-300es\":435,\"./lib/operators\":437}],433:[function(t,e,r){var n=t(\"./builtins\");n=n.slice().filter((function(t){return!/^(gl\\_|texture)/.test(t)})),e.exports=n.concat([\"gl_VertexID\",\"gl_InstanceID\",\"gl_Position\",\"gl_PointSize\",\"gl_FragCoord\",\"gl_FrontFacing\",\"gl_FragDepth\",\"gl_PointCoord\",\"gl_MaxVertexAttribs\",\"gl_MaxVertexUniformVectors\",\"gl_MaxVertexOutputVectors\",\"gl_MaxFragmentInputVectors\",\"gl_MaxVertexTextureImageUnits\",\"gl_MaxCombinedTextureImageUnits\",\"gl_MaxTextureImageUnits\",\"gl_MaxFragmentUniformVectors\",\"gl_MaxDrawBuffers\",\"gl_MinProgramTexelOffset\",\"gl_MaxProgramTexelOffset\",\"gl_DepthRangeParameters\",\"gl_DepthRange\",\"trunc\",\"round\",\"roundEven\",\"isnan\",\"isinf\",\"floatBitsToInt\",\"floatBitsToUint\",\"intBitsToFloat\",\"uintBitsToFloat\",\"packSnorm2x16\",\"unpackSnorm2x16\",\"packUnorm2x16\",\"unpackUnorm2x16\",\"packHalf2x16\",\"unpackHalf2x16\",\"outerProduct\",\"transpose\",\"determinant\",\"inverse\",\"texture\",\"textureSize\",\"textureProj\",\"textureLod\",\"textureOffset\",\"texelFetch\",\"texelFetchOffset\",\"textureProjOffset\",\"textureLodOffset\",\"textureProjLod\",\"textureProjLodOffset\",\"textureGrad\",\"textureGradOffset\",\"textureProjGrad\",\"textureProjGradOffset\"])},{\"./builtins\":434}],434:[function(t,e,r){e.exports=[\"abs\",\"acos\",\"all\",\"any\",\"asin\",\"atan\",\"ceil\",\"clamp\",\"cos\",\"cross\",\"dFdx\",\"dFdy\",\"degrees\",\"distance\",\"dot\",\"equal\",\"exp\",\"exp2\",\"faceforward\",\"floor\",\"fract\",\"gl_BackColor\",\"gl_BackLightModelProduct\",\"gl_BackLightProduct\",\"gl_BackMaterial\",\"gl_BackSecondaryColor\",\"gl_ClipPlane\",\"gl_ClipVertex\",\"gl_Color\",\"gl_DepthRange\",\"gl_DepthRangeParameters\",\"gl_EyePlaneQ\",\"gl_EyePlaneR\",\"gl_EyePlaneS\",\"gl_EyePlaneT\",\"gl_Fog\",\"gl_FogCoord\",\"gl_FogFragCoord\",\"gl_FogParameters\",\"gl_FragColor\",\"gl_FragCoord\",\"gl_FragData\",\"gl_FragDepth\",\"gl_FragDepthEXT\",\"gl_FrontColor\",\"gl_FrontFacing\",\"gl_FrontLightModelProduct\",\"gl_FrontLightProduct\",\"gl_FrontMaterial\",\"gl_FrontSecondaryColor\",\"gl_LightModel\",\"gl_LightModelParameters\",\"gl_LightModelProducts\",\"gl_LightProducts\",\"gl_LightSource\",\"gl_LightSourceParameters\",\"gl_MaterialParameters\",\"gl_MaxClipPlanes\",\"gl_MaxCombinedTextureImageUnits\",\"gl_MaxDrawBuffers\",\"gl_MaxFragmentUniformComponents\",\"gl_MaxLights\",\"gl_MaxTextureCoords\",\"gl_MaxTextureImageUnits\",\"gl_MaxTextureUnits\",\"gl_MaxVaryingFloats\",\"gl_MaxVertexAttribs\",\"gl_MaxVertexTextureImageUnits\",\"gl_MaxVertexUniformComponents\",\"gl_ModelViewMatrix\",\"gl_ModelViewMatrixInverse\",\"gl_ModelViewMatrixInverseTranspose\",\"gl_ModelViewMatrixTranspose\",\"gl_ModelViewProjectionMatrix\",\"gl_ModelViewProjectionMatrixInverse\",\"gl_ModelViewProjectionMatrixInverseTranspose\",\"gl_ModelViewProjectionMatrixTranspose\",\"gl_MultiTexCoord0\",\"gl_MultiTexCoord1\",\"gl_MultiTexCoord2\",\"gl_MultiTexCoord3\",\"gl_MultiTexCoord4\",\"gl_MultiTexCoord5\",\"gl_MultiTexCoord6\",\"gl_MultiTexCoord7\",\"gl_Normal\",\"gl_NormalMatrix\",\"gl_NormalScale\",\"gl_ObjectPlaneQ\",\"gl_ObjectPlaneR\",\"gl_ObjectPlaneS\",\"gl_ObjectPlaneT\",\"gl_Point\",\"gl_PointCoord\",\"gl_PointParameters\",\"gl_PointSize\",\"gl_Position\",\"gl_ProjectionMatrix\",\"gl_ProjectionMatrixInverse\",\"gl_ProjectionMatrixInverseTranspose\",\"gl_ProjectionMatrixTranspose\",\"gl_SecondaryColor\",\"gl_TexCoord\",\"gl_TextureEnvColor\",\"gl_TextureMatrix\",\"gl_TextureMatrixInverse\",\"gl_TextureMatrixInverseTranspose\",\"gl_TextureMatrixTranspose\",\"gl_Vertex\",\"greaterThan\",\"greaterThanEqual\",\"inversesqrt\",\"length\",\"lessThan\",\"lessThanEqual\",\"log\",\"log2\",\"matrixCompMult\",\"max\",\"min\",\"mix\",\"mod\",\"normalize\",\"not\",\"notEqual\",\"pow\",\"radians\",\"reflect\",\"refract\",\"sign\",\"sin\",\"smoothstep\",\"sqrt\",\"step\",\"tan\",\"texture2D\",\"texture2DLod\",\"texture2DProj\",\"texture2DProjLod\",\"textureCube\",\"textureCubeLod\",\"texture2DLodEXT\",\"texture2DProjLodEXT\",\"textureCubeLodEXT\",\"texture2DGradEXT\",\"texture2DProjGradEXT\",\"textureCubeGradEXT\"]},{}],435:[function(t,e,r){var n=t(\"./literals\");e.exports=n.slice().concat([\"layout\",\"centroid\",\"smooth\",\"case\",\"mat2x2\",\"mat2x3\",\"mat2x4\",\"mat3x2\",\"mat3x3\",\"mat3x4\",\"mat4x2\",\"mat4x3\",\"mat4x4\",\"uvec2\",\"uvec3\",\"uvec4\",\"samplerCubeShadow\",\"sampler2DArray\",\"sampler2DArrayShadow\",\"isampler2D\",\"isampler3D\",\"isamplerCube\",\"isampler2DArray\",\"usampler2D\",\"usampler3D\",\"usamplerCube\",\"usampler2DArray\",\"coherent\",\"restrict\",\"readonly\",\"writeonly\",\"resource\",\"atomic_uint\",\"noperspective\",\"patch\",\"sample\",\"subroutine\",\"common\",\"partition\",\"active\",\"filter\",\"image1D\",\"image2D\",\"image3D\",\"imageCube\",\"iimage1D\",\"iimage2D\",\"iimage3D\",\"iimageCube\",\"uimage1D\",\"uimage2D\",\"uimage3D\",\"uimageCube\",\"image1DArray\",\"image2DArray\",\"iimage1DArray\",\"iimage2DArray\",\"uimage1DArray\",\"uimage2DArray\",\"image1DShadow\",\"image2DShadow\",\"image1DArrayShadow\",\"image2DArrayShadow\",\"imageBuffer\",\"iimageBuffer\",\"uimageBuffer\",\"sampler1DArray\",\"sampler1DArrayShadow\",\"isampler1D\",\"isampler1DArray\",\"usampler1D\",\"usampler1DArray\",\"isampler2DRect\",\"usampler2DRect\",\"samplerBuffer\",\"isamplerBuffer\",\"usamplerBuffer\",\"sampler2DMS\",\"isampler2DMS\",\"usampler2DMS\",\"sampler2DMSArray\",\"isampler2DMSArray\",\"usampler2DMSArray\"])},{\"./literals\":436}],436:[function(t,e,r){e.exports=[\"precision\",\"highp\",\"mediump\",\"lowp\",\"attribute\",\"const\",\"uniform\",\"varying\",\"break\",\"continue\",\"do\",\"for\",\"while\",\"if\",\"else\",\"in\",\"out\",\"inout\",\"float\",\"int\",\"uint\",\"void\",\"bool\",\"true\",\"false\",\"discard\",\"return\",\"mat2\",\"mat3\",\"mat4\",\"vec2\",\"vec3\",\"vec4\",\"ivec2\",\"ivec3\",\"ivec4\",\"bvec2\",\"bvec3\",\"bvec4\",\"sampler1D\",\"sampler2D\",\"sampler3D\",\"samplerCube\",\"sampler1DShadow\",\"sampler2DShadow\",\"struct\",\"asm\",\"class\",\"union\",\"enum\",\"typedef\",\"template\",\"this\",\"packed\",\"goto\",\"switch\",\"default\",\"inline\",\"noinline\",\"volatile\",\"public\",\"static\",\"extern\",\"external\",\"interface\",\"long\",\"short\",\"double\",\"half\",\"fixed\",\"unsigned\",\"input\",\"output\",\"hvec2\",\"hvec3\",\"hvec4\",\"dvec2\",\"dvec3\",\"dvec4\",\"fvec2\",\"fvec3\",\"fvec4\",\"sampler2DRect\",\"sampler3DRect\",\"sampler2DRectShadow\",\"sizeof\",\"cast\",\"namespace\",\"using\"]},{}],437:[function(t,e,r){e.exports=[\"<<=\",\">>=\",\"++\",\"--\",\"<<\",\">>\",\"<=\",\">=\",\"==\",\"!=\",\"&&\",\"||\",\"+=\",\"-=\",\"*=\",\"/=\",\"%=\",\"&=\",\"^^\",\"^=\",\"|=\",\"(\",\")\",\"[\",\"]\",\".\",\"!\",\"~\",\"*\",\"/\",\"%\",\"+\",\"-\",\"<\",\">\",\"&\",\"^\",\"|\",\"?\",\":\",\"=\",\",\",\";\",\"{\",\"}\"]},{}],438:[function(t,e,r){var n=t(\"./index\");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{\"./index\":432}],439:[function(t,e,r){arguments[4][257][0].apply(r,arguments)},{dup:257}],440:[function(t,e,r){(function(r){(function(){\"use strict\";var n,i=t(\"is-browser\");n=\"function\"==typeof r.matchMedia?!r.matchMedia(\"(hover: none)\").matches:i,e.exports=n}).call(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"is-browser\":464}],441:[function(t,e,r){\"use strict\";var n=t(\"is-browser\");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},\"passive\",{get:function(){t=!0}});window.addEventListener(\"test\",null,e),window.removeEventListener(\"test\",null,e)}catch(e){t=!1}return t}()},{\"is-browser\":464}],442:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g}},{}],443:[function(t,e,r){\"use strict\";var n=t(\"./types\");e.exports=function(t,e){var r;for(r in n)if(n[r].detect(t,e))return r}},{\"./types\":446}],444:[function(t,e,r){(function(r){(function(){\"use strict\";var n=t(\"fs\"),i=t(\"path\"),a=t(\"./types\"),o=t(\"./detector\");function s(t,e){var r=o(t,e);if(r in a){var n=a[r].calculate(t,e);if(!1!==n)return n.type=r,n}throw new TypeError(\"unsupported file type: \"+r+\" (file: \"+e+\")\")}e.exports=function(t,e){if(r.isBuffer(t))return s(t);if(\"string\"!=typeof t)throw new TypeError(\"invalid invocation\");var a=i.resolve(t);if(\"function\"!=typeof e)return s(function(t){var e=n.openSync(t,\"r\"),i=n.fstatSync(e).size,a=Math.min(i,524288),o=r.alloc(a);return n.readSync(e,o,0,a,0),n.closeSync(e),o}(a),a);!function(t,e){n.open(t,\"r\",(function(i,a){if(i)return e(i);n.fstat(a,(function(i,o){if(i)return e(i);var s=o.size;if(s<=0)return e(new Error(\"File size is not greater than 0 \\u2014\\u2014 \"+t));var l=Math.min(s,524288),c=r.alloc(l);n.read(a,c,0,l,0,(function(t){if(t)return e(t);n.close(a,(function(t){e(t,c)}))}))}))}))}(a,(function(t,r){if(t)return e(t);var n;try{n=s(r,a)}catch(e){t=e}e(t,n)}))},e.exports.types=Object.keys(a)}).call(this)}).call(this,t(\"buffer\").Buffer)},{\"./detector\":443,\"./types\":446,buffer:111,fs:109,path:507}],445:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n){return r=r||0,t[\"readUInt\"+e+(n?\"BE\":\"LE\")].call(t,r)}},{}],446:[function(t,e,r){\"use strict\";var n={bmp:t(\"./types/bmp\"),cur:t(\"./types/cur\"),dds:t(\"./types/dds\"),gif:t(\"./types/gif\"),icns:t(\"./types/icns\"),ico:t(\"./types/ico\"),jpg:t(\"./types/jpg\"),png:t(\"./types/png\"),psd:t(\"./types/psd\"),svg:t(\"./types/svg\"),tiff:t(\"./types/tiff\"),webp:t(\"./types/webp\")};e.exports=n},{\"./types/bmp\":447,\"./types/cur\":448,\"./types/dds\":449,\"./types/gif\":450,\"./types/icns\":451,\"./types/ico\":452,\"./types/jpg\":453,\"./types/png\":454,\"./types/psd\":455,\"./types/svg\":456,\"./types/tiff\":457,\"./types/webp\":458}],447:[function(t,e,r){\"use strict\";e.exports={detect:function(t){return\"BM\"===t.toString(\"ascii\",0,2)},calculate:function(t){return{width:t.readUInt32LE(18),height:Math.abs(t.readInt32LE(22))}}}},{}],448:[function(t,e,r){\"use strict\";e.exports={detect:function(t){return 0===t.readUInt16LE(0)&&2===t.readUInt16LE(2)},calculate:t(\"./ico\").calculate}},{\"./ico\":452}],449:[function(t,e,r){\"use strict\";e.exports={detect:function(t){return 542327876===t.readUInt32LE(0)},calculate:function(t){return{height:t.readUInt32LE(12),width:t.readUInt32LE(16)}}}},{}],450:[function(t,e,r){\"use strict\";var n=/^GIF8[79]a/;e.exports={detect:function(t){var e=t.toString(\"ascii\",0,6);return n.test(e)},calculate:function(t){return{width:t.readUInt16LE(6),height:t.readUInt16LE(8)}}}},{}],451:[function(t,e,r){\"use strict\";var n={ICON:32,\"ICN#\":32,\"icm#\":16,icm4:16,icm8:16,\"ics#\":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function i(t,e){var r=e+4;return[t.toString(\"ascii\",e,r),t.readUInt32BE(r)]}function a(t){var e=n[t];return{width:e,height:e,type:t}}e.exports={detect:function(t){return\"icns\"===t.toString(\"ascii\",0,4)},calculate:function(t){var e,r,n,o=t.length,s=8,l=t.readUInt32BE(4);if(r=a((e=i(t,s))[0]),(s+=e[1])===l)return r;for(n={width:r.width,height:r.height,images:[r]};s<l&&s<o;)r=a((e=i(t,s))[0]),s+=e[1],n.images.push(r);return n}}},{}],452:[function(t,e,r){\"use strict\";function n(t,e){var r=t.readUInt8(e);return 0===r?256:r}function i(t,e){var r=6+16*e;return{width:n(t,r),height:n(t,r+1)}}e.exports={detect:function(t){return 0===t.readUInt16LE(0)&&1===t.readUInt16LE(2)},calculate:function(t){var e,r=t.readUInt16LE(4),n=i(t,0);if(1===r)return n;for(n.images=[{width:n.width,height:n.height}],e=1;e<r;e+=1)n.images.push(i(t,e));return n}}},{}],453:[function(t,e,r){\"use strict\";var n=t(\"../readUInt\");function i(t){return\"45786966\"===t.toString(\"hex\",2,6)}function a(t,e){return{height:t.readUInt16BE(e),width:t.readUInt16BE(e+2)}}function o(t,e){var r=t.slice(2,e),i=r.toString(\"hex\",6,8),a=\"4d4d\"===i;if(a||\"4949\"===i)return function(t,e){for(var r,i,a=n(t,16,14,e),o=0;o<a;o++){if(i=(r=16+12*o)+12,r>t.length)return;var s=t.slice(r,i);if(274===n(s,16,0,e)){if(3!==n(s,16,2,e))return;if(1!==n(s,32,4,e))return;return n(s,16,8,e)}}}(r,a)}function s(t,e){if(e>t.length)throw new TypeError(\"Corrupt JPG, exceeded buffer limits\");if(255!==t[e])throw new TypeError(\"Invalid JPG, marker table corrupted\")}e.exports={detect:function(t){return\"ffd8\"===t.toString(\"hex\",0,2)},calculate:function(t){var e,r,n;for(t=t.slice(4);t.length;){if(r=t.readUInt16BE(0),i(t)&&(e=o(t,r)),s(t,r),192===(n=t[r+1])||193===n||194===n){var l=a(t,r+5);return e?{width:l.width,height:l.height,orientation:e}:l}t=t.slice(r+2)}throw new TypeError(\"Invalid JPG, no size found\")}}},{\"../readUInt\":445}],454:[function(t,e,r){\"use strict\";e.exports={detect:function(t){if(\"PNG\\r\\n\\x1a\\n\"===t.toString(\"ascii\",1,8)){var e=t.toString(\"ascii\",12,16);if(\"CgBI\"===e&&(e=t.toString(\"ascii\",28,32)),\"IHDR\"!==e)throw new TypeError(\"invalid png\");return!0}},calculate:function(t){return\"CgBI\"===t.toString(\"ascii\",12,16)?{width:t.readUInt32BE(32),height:t.readUInt32BE(36)}:{width:t.readUInt32BE(16),height:t.readUInt32BE(20)}}}},{}],455:[function(t,e,r){\"use strict\";e.exports={detect:function(t){return\"8BPS\"===t.toString(\"ascii\",0,4)},calculate:function(t){return{width:t.readUInt32BE(18),height:t.readUInt32BE(14)}}}},{}],456:[function(t,e,r){\"use strict\";var n=/<svg\\s([^>\"']|\"[^\"]*\"|'[^']*')*>/;var i={root:n,width:/\\swidth=(['\"])([^%]+?)\\1/,height:/\\sheight=(['\"])([^%]+?)\\1/,viewbox:/\\sviewBox=(['\"])(.+?)\\1/},a={cm:96/2.54,mm:96/2.54/10,m:96/2.54*100,pt:96/72,pc:96/72/12,em:16,ex:8};function o(t){var e=/([0-9.]+)([a-z]*)/.exec(t);if(e)return Math.round(parseFloat(e[1])*(a[e[2]]||1))}function s(t){var e=t.split(\" \");return{width:o(e[2]),height:o(e[3])}}e.exports={detect:function(t){return n.test(t)},calculate:function(t){var e=t.toString(\"utf8\").match(i.root);if(e){var r=function(t){var e=t.match(i.width),r=t.match(i.height),n=t.match(i.viewbox);return{width:e&&o(e[2]),height:r&&o(r[2]),viewbox:n&&s(n[2])}}(e[0]);if(r.width&&r.height)return function(t){return{width:t.width,heigh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment