diff --git a/js/global_variables/meta_gene.js b/js/global_variables/meta_gene.js index fa267ae6..ebb64d41 100644 --- a/js/global_variables/meta_gene.js +++ b/js/global_variables/meta_gene.js @@ -15,12 +15,17 @@ export const set_meta_gene = async ( meta_gene_url = `${base_url}/meta_gene_${seg_version}.parquet`; } + console.log('meta_gene_url', meta_gene_url); + console.log('options.fetch', options.fetch); + const meta_gene_table = await get_arrow_table( meta_gene_url, options.fetch, aws ); + console.log('meta_gene_table', meta_gene_table); + const gene_names = meta_gene_table.getChild('__index_level_0__').toArray(); const gene_mean = meta_gene_table.getChild('mean').toArray(); const gene_std = meta_gene_table.getChild('std').toArray(); diff --git a/js/image_tile/get_image_dimensions.js b/js/image_tile/get_image_dimensions.js index ec531c4d..5ef4fe14 100644 --- a/js/image_tile/get_image_dimensions.js +++ b/js/image_tile/get_image_dimensions.js @@ -1,15 +1,38 @@ export const get_image_dimensions = async ( base_url, image_name, - options, - aws + options = {}, // Safe default + aws = null // Safe default ) => { const dzi_url = `${base_url}/pyramid_images/${image_name}.dzi`; + console.log('š dzi_url:', dzi_url); - const response = - aws !== null - ? await aws.fetch(dzi_url) - : await fetch(dzi_url, options.fetch); + let fetchFn; + let fetchOptions; + + // Handle AWS fetch case + if (aws && typeof aws.fetch === 'function') { + fetchFn = aws.fetch; + fetchOptions = undefined; // aws.fetch usually includes its own signing logic + } else { + // Use custom fetch if provided, else fall back to global fetch + fetchFn = typeof options.fetch === 'function' ? options.fetch : fetch; + fetchOptions = options.requestOptions ?? {}; // Allow passing requestOptions + } + + let response; + try { + response = await fetchFn(dzi_url, fetchOptions); + if (!response.ok) { + throw new Error(`HTTP ${response.status} - ${response.statusText}`); + } + } catch (error) { + console.error('ā Fetch failed:', { + url: dzi_url, + error: error.message, + }); + throw error; + } const xmlText = await response.text(); const dziXML = new DOMParser().parseFromString(xmlText, 'text/xml'); @@ -26,5 +49,6 @@ export const get_image_dimensions = async ( ), }; + console.log('š Parsed image dimensions:', dimensions); return dimensions; }; diff --git a/js/read_parquet/get_arrow_table.js b/js/read_parquet/get_arrow_table.js index 4899bd8a..9af4b98a 100644 --- a/js/read_parquet/get_arrow_table.js +++ b/js/read_parquet/get_arrow_table.js @@ -3,9 +3,14 @@ import { handleAsyncError } from '../temp_utils/errorHandler'; import { arrayBufferToArrowTable } from './arrayBufferToArrowTable'; export const get_arrow_table = async (url, fetch_options, aws) => { + console.log('start get_arrow_table func'); try { + console.log('start response'); + console.log('url', url); + const response = aws !== null ? await aws.fetch(url) : await fetch(url, fetch_options); + console.log('after response'); const arrayBuffer = await response.arrayBuffer(); const arrowTable = arrayBufferToArrowTable(arrayBuffer); diff --git a/notebooks/Single_Category_Matrix.ipynb b/notebooks/Single_Category_Matrix.ipynb new file mode 100644 index 00000000..6c02f972 --- /dev/null +++ b/notebooks/Single_Category_Matrix.ipynb @@ -0,0 +1,1120 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "72af410d-a468-47a3-8270-97720fdf60cd", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "env: ANYWIDGET_HMR=1\n" + ] + } + ], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2\n", + "%env ANYWIDGET_HMR=1" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "6f917896-9329-4ad7-8c27-924a7890e32a", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import celldega as dega" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "2aa7a572-5fa7-4c00-8cd4-855b66bd0411", + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Widget\n", + "Widget.close_all()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "1624a711-8758-4c86-9aee-3f39d42441ed", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(1000, 500)" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# generate random matrix\n", + "num_cols = 500\n", + "num_rows = 1000\n", + "\n", + "np.random.seed(seed=100)\n", + "mat = np.random.rand(num_rows, num_cols)\n", + "\n", + "# make row and col labels\n", + "rows = range(num_rows)\n", + "cols = range(num_cols)\n", + "rows = [str(i) for i in rows]\n", + "cols = [str(i) for i in cols]\n", + "\n", + "# make dataframe\n", + "df = pd.DataFrame(data=mat, columns=cols, index=rows)\n", + "df.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "b2fbedca-566b-4ce1-880a-d1044a4478f5", + "metadata": {}, + "outputs": [], + "source": [ + "meta_col = pd.DataFrame(index=df.columns.tolist())\n", + "top_cols = df.sum(axis=0).sort_values(ascending=False).index.tolist()[:5]\n", + "meta_col['type'] = 'low'\n", + "meta_col['experiment'] = 'a'\n", + "meta_col['test'] = 'something'\n", + "meta_col.loc[top_cols, 'type'] = 'high'\n", + "meta_col.loc['0', 'experiment'] = 'b'\n", + "meta_col.loc['1', 'experiment'] = 'b'\n", + "meta_col.loc['2', 'experiment'] = 'b'" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "1298800a-7a6b-4023-9c63-e5e3acfc8e06", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | type | \n", + "experiment | \n", + "test | \n", + "
|---|---|---|---|
| 0 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 1 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 2 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 3 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| 4 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| \n", + " | type | \n", + "experiment | \n", + "test | \n", + "
|---|---|---|---|
| 0 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 1 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 2 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 3 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| 4 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 495 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| 496 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| 497 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| 498 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| 499 | \n", + "high | \n", + "a | \n", + "something | \n", + "
500 rows Ć 3 columns
\n", + "| \n", + " | type | \n", + "
|---|---|
| 0 | \n", + "high | \n", + "
| 1 | \n", + "high | \n", + "
| 2 | \n", + "very-high | \n", + "
| 3 | \n", + "low | \n", + "
| 4 | \n", + "low | \n", + "
| ... | \n", + "... | \n", + "
| 995 | \n", + "low | \n", + "
| 996 | \n", + "low | \n", + "
| 997 | \n", + "low | \n", + "
| 998 | \n", + "low | \n", + "
| 999 | \n", + "low | \n", + "
1000 rows Ć 1 columns
\n", + "| \n", + " | 0 | \n", + "1 | \n", + "2 | \n", + "3 | \n", + "4 | \n", + "5 | \n", + "6 | \n", + "7 | \n", + "8 | \n", + "9 | \n", + "... | \n", + "490 | \n", + "491 | \n", + "492 | \n", + "493 | \n", + "494 | \n", + "495 | \n", + "496 | \n", + "497 | \n", + "498 | \n", + "499 | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "0.543405 | \n", + "0.278369 | \n", + "0.424518 | \n", + "0.844776 | \n", + "0.004719 | \n", + "0.121569 | \n", + "0.670749 | \n", + "0.825853 | \n", + "0.136707 | \n", + "0.575093 | \n", + "... | \n", + "0.757158 | \n", + "0.686172 | \n", + "0.856393 | \n", + "0.230878 | \n", + "0.519338 | \n", + "0.343333 | \n", + "0.658773 | \n", + "0.282790 | \n", + "0.502466 | \n", + "0.303278 | \n", + "
| 1 | \n", + "0.552529 | \n", + "0.161127 | \n", + "0.568549 | \n", + "0.485710 | \n", + "0.127520 | \n", + "0.543692 | \n", + "0.200491 | \n", + "0.670161 | \n", + "0.558112 | \n", + "0.232378 | \n", + "... | \n", + "0.616522 | \n", + "0.947579 | \n", + "0.906472 | \n", + "0.965094 | \n", + "0.337621 | \n", + "0.656403 | \n", + "0.291456 | \n", + "0.150869 | \n", + "0.036932 | \n", + "0.597964 | \n", + "
| 2 | \n", + "0.027732 | \n", + "0.382237 | \n", + "0.953251 | \n", + "0.222199 | \n", + "0.305126 | \n", + "0.819320 | \n", + "0.578470 | \n", + "0.027617 | \n", + "0.954388 | \n", + "0.312139 | \n", + "... | \n", + "0.279062 | \n", + "0.652883 | \n", + "0.382998 | \n", + "0.459917 | \n", + "0.117076 | \n", + "0.820498 | \n", + "0.026554 | \n", + "0.737706 | \n", + "0.858315 | \n", + "0.744456 | \n", + "
| 3 | \n", + "0.106510 | \n", + "0.410900 | \n", + "0.337036 | \n", + "0.099837 | \n", + "0.923092 | \n", + "0.830182 | \n", + "0.553784 | \n", + "0.979481 | \n", + "0.823215 | \n", + "0.477880 | \n", + "... | \n", + "0.630891 | \n", + "0.478955 | \n", + "0.140795 | \n", + "0.329110 | \n", + "0.775616 | \n", + "0.633031 | \n", + "0.105247 | \n", + "0.980898 | \n", + "0.364798 | \n", + "0.778565 | \n", + "
| 4 | \n", + "0.259444 | \n", + "0.023003 | \n", + "0.654407 | \n", + "0.969216 | \n", + "0.698952 | \n", + "0.032054 | \n", + "0.003295 | \n", + "0.122310 | \n", + "0.729892 | \n", + "0.743647 | \n", + "... | \n", + "0.514056 | \n", + "0.927185 | \n", + "0.958549 | \n", + "0.637225 | \n", + "0.810425 | \n", + "0.200090 | \n", + "0.919083 | \n", + "0.478302 | \n", + "0.635912 | \n", + "0.418574 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 995 | \n", + "0.452351 | \n", + "0.107272 | \n", + "0.402613 | \n", + "0.561070 | \n", + "0.211027 | \n", + "0.266975 | \n", + "0.936888 | \n", + "0.549172 | \n", + "0.705522 | \n", + "0.299131 | \n", + "... | \n", + "0.464319 | \n", + "0.776364 | \n", + "0.247712 | \n", + "0.485919 | \n", + "0.694655 | \n", + "0.400301 | \n", + "0.789691 | \n", + "0.417920 | \n", + "0.924677 | \n", + "0.217532 | \n", + "
| 996 | \n", + "0.830361 | \n", + "0.922538 | \n", + "0.872661 | \n", + "0.933965 | \n", + "0.467994 | \n", + "0.216636 | \n", + "0.152380 | \n", + "0.252526 | \n", + "0.211126 | \n", + "0.731267 | \n", + "... | \n", + "0.931373 | \n", + "0.135947 | \n", + "0.512773 | \n", + "0.559336 | \n", + "0.253575 | \n", + "0.525237 | \n", + "0.206648 | \n", + "0.263876 | \n", + "0.827428 | \n", + "0.828747 | \n", + "
| 997 | \n", + "0.111321 | \n", + "0.400065 | \n", + "0.954879 | \n", + "0.082037 | \n", + "0.184362 | \n", + "0.611459 | \n", + "0.557353 | \n", + "0.180928 | \n", + "0.829128 | \n", + "0.470532 | \n", + "... | \n", + "0.433940 | \n", + "0.731124 | \n", + "0.437903 | \n", + "0.674901 | \n", + "0.385684 | \n", + "0.915962 | \n", + "0.133351 | \n", + "0.368654 | \n", + "0.697746 | \n", + "0.226066 | \n", + "
| 998 | \n", + "0.105283 | \n", + "0.071139 | \n", + "0.626755 | \n", + "0.968089 | \n", + "0.419372 | \n", + "0.435346 | \n", + "0.117211 | \n", + "0.753026 | \n", + "0.157066 | \n", + "0.632154 | \n", + "... | \n", + "0.728839 | \n", + "0.990528 | \n", + "0.934744 | \n", + "0.208394 | \n", + "0.832231 | \n", + "0.714353 | \n", + "0.413764 | \n", + "0.939862 | \n", + "0.065200 | \n", + "0.521385 | \n", + "
| 999 | \n", + "0.416804 | \n", + "0.876420 | \n", + "0.058889 | \n", + "0.775855 | \n", + "0.244510 | \n", + "0.622739 | \n", + "0.778653 | \n", + "0.289694 | \n", + "0.551955 | \n", + "0.663487 | \n", + "... | \n", + "0.802516 | \n", + "0.238675 | \n", + "0.423408 | \n", + "0.220076 | \n", + "0.895098 | \n", + "0.046924 | \n", + "0.169185 | \n", + "0.755274 | \n", + "0.145708 | \n", + "0.578691 | \n", + "
1000 rows Ć 500 columns
\n", + "| \n", + " | type | \n", + "experiment | \n", + "test | \n", + "
|---|---|---|---|
| 0 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 1 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 2 | \n", + "low | \n", + "b | \n", + "something | \n", + "
| 3 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| 4 | \n", + "low | \n", + "a | \n", + "something | \n", + "
| \n", + " | color | \n", + "
|---|---|
| low | \n", + "blue | \n", + "
| high | \n", + "black | \n", + "
| very-high | \n", + "yellow | \n", + "
| \n", + " | cluster | \n", + "
|---|---|
| aaaadnje-1 | \n", + "15 | \n", + "
| aaacalai-1 | \n", + "9 | \n", + "
| aaacjgil-1 | \n", + "15 | \n", + "
| \n", + " | cluster | \n", + "
|---|---|
| cell_id | \n", + "\n", + " |
| 1 | \n", + "24 | \n", + "
| 2 | \n", + "24 | \n", + "
| 3 | \n", + "23 | \n", + "
| \n", + " | color | \n", + "count | \n", + "
|---|---|---|
| 1 | \n", + "#1f77b4 | \n", + "17949 | \n", + "
| 2 | \n", + "#ff7f0e | \n", + "15781 | \n", + "
| 3 | \n", + "#2ca02c | \n", + "14415 | \n", + "
| \n", + " | color | \n", + "count | \n", + "
|---|---|---|
| 1 | \n", + "#1f77b4 | \n", + "34338 | \n", + "
| 2 | \n", + "#ff7f0e | \n", + "33419 | \n", + "
| 3 | \n", + "#2ca02c | \n", + "31047 | \n", + "
| \n", + " | EPCAM | \n", + "
|---|---|
| 0 | \n", + "2 | \n", + "
| 1 | \n", + "9 | \n", + "
| 2 | \n", + "5 | \n", + "
| \n", + " | Xkr4 | \n", + "Rp1 | \n", + "Sox17 | \n", + "Lypla1 | \n", + "Tcea1 | \n", + "Rgs20 | \n", + "Atp6v1h | \n", + "Oprk1 | \n", + "Npbwr1 | \n", + "Rb1cc1 | \n", + "... | \n", + "mt-Co2 | \n", + "mt-Atp8 | \n", + "mt-Atp6 | \n", + "mt-Co3 | \n", + "mt-Nd3 | \n", + "mt-Nd4l | \n", + "mt-Nd4 | \n", + "mt-Nd5 | \n", + "mt-Nd6 | \n", + "mt-Cytb | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "\n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " |
| s_008um_00269_00526-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "2 | \n", + "0 | \n", + "1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "11 | \n", + "13 | \n", + "5 | \n", + "7 | \n", + "0 | \n", + "0 | \n", + "2 | \n", + "7 | \n", + "0 | \n", + "10 | \n", + "
| s_008um_00693_00628-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "2 | \n", + "0 | \n", + "1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "2 | \n", + "
| s_008um_00260_00253-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "2 | \n", + "0 | \n", + "1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "
| s_008um_00433_00599-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "4 | \n", + "2 | \n", + "3 | \n", + "4 | \n", + "0 | \n", + "2 | \n", + "2 | \n", + "0 | \n", + "1 | \n", + "1 | \n", + "
| s_008um_00660_00606-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "4 | \n", + "2 | \n", + "1 | \n", + "6 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| s_008um_00610_00321-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "5 | \n", + "3 | \n", + "1 | \n", + "3 | \n", + "0 | \n", + "1 | \n", + "0 | \n", + "1 | \n", + "0 | \n", + "2 | \n", + "
| s_008um_00565_00596-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "7 | \n", + "1 | \n", + "6 | \n", + "4 | \n", + "0 | \n", + "1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "1 | \n", + "
| s_008um_00307_00022-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "2 | \n", + "1 | \n", + "1 | \n", + "2 | \n", + "0 | \n", + "1 | \n", + "1 | \n", + "0 | \n", + "0 | \n", + "3 | \n", + "
| s_008um_00172_00448-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "2 | \n", + "0 | \n", + "1 | \n", + "1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "2 | \n", + "
| s_008um_00414_00651-1 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "0 | \n", + "... | \n", + "8 | \n", + "5 | \n", + "3 | \n", + "4 | \n", + "0 | \n", + "0 | \n", + "2 | \n", + "0 | \n", + "0 | \n", + "2 | \n", + "
344024 rows Ć 19070 columns
\n", + "| \n", + " | Adgrb3 | \n", + "
|---|---|
| 1026 | \n", + "1 | \n", + "
| 1146 | \n", + "1 | \n", + "
| 1276 | \n", + "1 | \n", + "
| \n", + " | name | \n", + "center_x | \n", + "center_y | \n", + "cluster | \n", + "
|---|---|---|---|---|
| s_008um_00000_00234-1 | \n", + "s_008um_00000_00234-1 | \n", + "1741.189875 | \n", + "5219.296840 | \n", + "14 | \n", + "
| s_008um_00000_00235-1 | \n", + "s_008um_00000_00235-1 | \n", + "1747.533702 | \n", + "5219.243799 | \n", + "14 | \n", + "
| s_008um_00000_00236-1 | \n", + "s_008um_00000_00236-1 | \n", + "1753.877529 | \n", + "5219.190759 | \n", + "14 | \n", + "
| s_008um_00000_00237-1 | \n", + "s_008um_00000_00237-1 | \n", + "1760.221356 | \n", + "5219.137719 | \n", + "21 | \n", + "
| s_008um_00000_00238-1 | \n", + "s_008um_00000_00238-1 | \n", + "1766.565183 | \n", + "5219.084679 | \n", + "17 | \n", + "
| \n", + " | mean | \n", + "std | \n", + "max | \n", + "non-zero | \n", + "
|---|---|---|---|---|
| Xkr4 | \n", + "0.013522 | \n", + "0.508609 | \n", + "3 | \n", + "0.000003 | \n", + "
| Rp1 | \n", + "0.000105 | \n", + "0.043446 | \n", + "1 | \n", + "0.000003 | \n", + "
| Sox17 | \n", + "0.010092 | \n", + "0.464071 | \n", + "6 | \n", + "0.000003 | \n", + "
| Lypla1 | \n", + "0.030201 | \n", + "0.749627 | \n", + "3 | \n", + "0.000003 | \n", + "
| Tcea1 | \n", + "0.146728 | \n", + "1.694673 | \n", + "5 | \n", + "0.000003 | \n", + "
| \n", + " | Epcam | \n", + "
|---|---|
| s_008um_00269_00526-1 | \n", + "1 | \n", + "
| s_008um_00261_00528-1 | \n", + "2 | \n", + "
| s_008um_00410_00025-1 | \n", + "1 | \n", + "
| s_008um_00469_00291-1 | \n", + "1 | \n", + "
| s_008um_00585_00267-1 | \n", + "1 | \n", + "
| \n", + " | mean | \n", + "std | \n", + "max | \n", + "non-zero | \n", + "
|---|---|---|---|---|
| Xkr4 | \n", + "0.013522 | \n", + "0.508609 | \n", + "3 | \n", + "0.000003 | \n", + "
| Rp1 | \n", + "0.000105 | \n", + "0.043446 | \n", + "1 | \n", + "0.000003 | \n", + "
| Sox17 | \n", + "0.010092 | \n", + "0.464071 | \n", + "6 | \n", + "0.000003 | \n", + "
| Lypla1 | \n", + "0.030201 | \n", + "0.749627 | \n", + "3 | \n", + "0.000003 | \n", + "
| Tcea1 | \n", + "0.146728 | \n", + "1.694673 | \n", + "5 | \n", + "0.000003 | \n", + "
D&&(D=n),G>r&&(r=G);w=Math.max(D-o,r-e),w=w!==0?32767/w:0}return Fw(C,E,I,o,e,w,0),E}function fb(g,A,I,B,Q){var C,E;if(Q===rq(g,A,I,B)>0)for(C=A;C=A;C-=B)E=Hb(C,g[C],g[C+1],E);return E&&tF(E,E.next)&&(Mw(E),E=E.next),E}function Qs(g,A){if(!g)return g;A||(A=g);var I=g,B;do if(B=!1,!I.steiner&&(tF(I,I.next)||VI(I.prev,I,I.next)===0)){if(Mw(I),I=A=I.prev,I===I.next)break;B=!0}else I=I.next;while(B||I!==A);return A}function Fw(g,A,I,B,Q,C,E){if(g){!E&&C&&VCA(g,B,Q,C);for(var o=g,e,D;g.prev!==g.next;){if(e=g.prev,D=g.next,C?mCA(g,B,Q,C):uCA(g)){A.push(e.i/I|0),A.push(g.i/I|0),A.push(D.i/I|0),Mw(g),g=D.next,o=D.next;continue}if(g=D,g===o){E?E===1?(g=xCA(Qs(g),A,I),Fw(g,A,I,B,Q,C,2)):E===2&&bCA(g,A,I,B,Q,C):Fw(Qs(g),A,I,B,Q,C,1);break}}}}function uCA(g){var A=g.prev,I=g,B=g.next;if(VI(A,I,B)>=0)return!1;for(var Q=A.x,C=I.x,E=B.x,o=A.y,e=I.y,D=B.y,r=QC?Q>E?Q:E:C>E?C:E,w=o>e?o>D?o:D:e>D?e:D,k=B.next;k!==A;){if(k.x>=r&&k.x<=G&&k.y>=n&&k.y<=w&&Wr(Q,o,C,e,E,D,k.x,k.y)&&VI(k.prev,k,k.next)>=0)return!1;k=k.next}return!0}function mCA(g,A,I,B){var Q=g.prev,C=g,E=g.next;if(VI(Q,C,E)>=0)return!1;for(var o=Q.x,e=C.x,D=E.x,r=Q.y,n=C.y,G=E.y,w=o e?o>D?o:D:e>D?e:D,h=r>n?r>G?r:G:n>G?n:G,N=Dq(w,k,A,I,B),Y=Dq(F,h,A,I,B),M=g.prevZ,l=g.nextZ;M&&M.z>=N&&l&&l.z<=Y;){if(M.x>=w&&M.x<=F&&M.y>=k&&M.y<=h&&M!==Q&&M!==E&&Wr(o,r,e,n,D,G,M.x,M.y)&&VI(M.prev,M,M.next)>=0||(M=M.prevZ,l.x>=w&&l.x<=F&&l.y>=k&&l.y<=h&&l!==Q&&l!==E&&Wr(o,r,e,n,D,G,l.x,l.y)&&VI(l.prev,l,l.next)>=0))return!1;l=l.nextZ}for(;M&&M.z>=N;){if(M.x>=w&&M.x<=F&&M.y>=k&&M.y<=h&&M!==Q&&M!==E&&Wr(o,r,e,n,D,G,M.x,M.y)&&VI(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;l&&l.z<=Y;){if(l.x>=w&&l.x<=F&&l.y>=k&&l.y<=h&&l!==Q&&l!==E&&Wr(o,r,e,n,D,G,l.x,l.y)&&VI(l.prev,l,l.next)>=0)return!1;l=l.nextZ}return!0}function xCA(g,A,I){var B=g;do{var Q=B.prev,C=B.next.next;!tF(Q,C)&&ub(Q,B,B.next,C)&&Rw(Q,C)&&Rw(C,Q)&&(A.push(Q.i/I|0),A.push(B.i/I|0),A.push(C.i/I|0),Mw(B),Mw(B.next),B=g=C),B=B.next}while(B!==g);return Qs(B)}function bCA(g,A,I,B,Q,C){var E=g;do{for(var o=E.next.next;o!==E.prev;){if(E.i!==o.i&&XCA(E,o)){var e=mb(E,o);E=Qs(E,E.next),e=Qs(e,e.next),Fw(E,A,I,B,Q,C,0),Fw(e,A,I,B,Q,C,0);return}o=o.next}E=E.next}while(E!==g)}function TCA(g,A,I,B){var Q=[],C,E,o,e,D;for(C=0,E=A.length;C =I.next.y&&I.next.y!==I.y){var o=I.x+(Q-I.y)*(I.next.x-I.x)/(I.next.y-I.y);if(o<=B&&o>C&&(C=o,E=I.x =I.x&&I.x>=D&&B!==I.x&&Wr(Q E.x||I.x===E.x&&OCA(E,I)))&&(E=I,n=G)),I=I.next;while(I!==e);return E}function OCA(g,A){return VI(g.prev,g,A.prev)<0&&VI(A.next,g,g.next)<0}function VCA(g,A,I,B){var Q=g;do Q.z===0&&(Q.z=Dq(Q.x,Q.y,A,I,B)),Q.prevZ=Q.prev,Q.nextZ=Q.next,Q=Q.next;while(Q!==g);Q.prevZ.nextZ=null,Q.prevZ=null,vCA(Q)}function vCA(g){var A,I,B,Q,C,E,o,e,D=1;do{for(I=g,g=null,C=null,E=0;I;){for(E++,B=I,o=0,A=0;A 0||e>0&&B;)o!==0&&(e===0||!B||I.z<=B.z)?(Q=I,I=I.nextZ,o--):(Q=B,B=B.nextZ,e--),C?C.nextZ=Q:g=Q,Q.prevZ=C,C=Q;I=B}C.nextZ=null,D*=2}while(E>1);return g}function Dq(g,A,I,B,Q){return g=(g-I)*Q|0,A=(A-B)*Q|0,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,g|A<<1}function jCA(g){var A=g,I=g;do(A.x =(g-E)*(C-o)&&(g-E)*(B-o)>=(I-E)*(A-o)&&(I-E)*(C-o)>=(Q-E)*(B-o)}function XCA(g,A){return g.next.i!==A.i&&g.prev.i!==A.i&&!zCA(g,A)&&(Rw(g,A)&&Rw(A,g)&&_CA(g,A)&&(VI(g.prev,g,A.prev)||VI(g,A.prev,A))||tF(g,A)&&VI(g.prev,g,g.next)>0&&VI(A.prev,A,A.next)>0)}function VI(g,A,I){return(A.y-g.y)*(I.x-A.x)-(A.x-g.x)*(I.y-A.y)}function tF(g,A){return g.x===A.x&&g.y===A.y}function ub(g,A,I,B){var Q=iF(VI(g,A,I)),C=iF(VI(g,A,B)),E=iF(VI(I,B,g)),o=iF(VI(I,B,A));return!!(Q!==C&&E!==o||Q===0&&EF(g,I,A)||C===0&&EF(g,B,A)||E===0&&EF(I,g,B)||o===0&&EF(I,A,B))}function EF(g,A,I){return A.x<=Math.max(g.x,I.x)&&A.x>=Math.min(g.x,I.x)&&A.y<=Math.max(g.y,I.y)&&A.y>=Math.min(g.y,I.y)}function iF(g){return g>0?1:g<0?-1:0}function zCA(g,A){var I=g;do{if(I.i!==g.i&&I.next.i!==g.i&&I.i!==A.i&&I.next.i!==A.i&&ub(I,I.next,g,A))return!0;I=I.next}while(I!==g);return!1}function Rw(g,A){return VI(g.prev,g,g.next)<0?VI(g,A,g.next)>=0&&VI(g,g.prev,A)>=0:VI(g,A,g.prev)<0||VI(g,g.next,A)<0}function _CA(g,A){var I=g,B=!1,Q=(g.x+A.x)/2,C=(g.y+A.y)/2;do I.y>C!=I.next.y>C&&I.next.y!==I.y&&Q<(I.next.x-I.x)*(C-I.y)/(I.next.y-I.y)+I.x&&(B=!B),I=I.next;while(I!==g);return B}function mb(g,A){var I=new sq(g.i,g.x,g.y),B=new sq(A.i,A.x,A.y),Q=g.next,C=A.prev;return g.next=A,A.prev=g,I.next=Q,Q.prev=I,B.next=I,I.prev=B,C.next=B,B.prev=C,B}function Hb(g,A,I,B){var Q=new sq(g,A,I);return B?(Q.next=B.next,Q.prev=B,B.next.prev=Q,B.next=Q):(Q.prev=Q,Q.next=Q),Q}function Mw(g){g.next.prev=g.prev,g.prev.next=g.next,g.prevZ&&(g.prevZ.nextZ=g.nextZ),g.nextZ&&(g.nextZ.prevZ=g.prevZ)}function sq(g,A,I){this.i=g,this.x=A,this.y=I,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}oF.deviation=function(g,A,I,B){var Q=A&&A.length,C=Q?A[0]*I:g.length,E=Math.abs(rq(g,0,C,I));if(Q)for(var o=0,e=A.length;o 0&&(B+=g[Q-1].length,I.holes.push(B))}return I}});var X8=FE((mM,j8)=>{(function(g,A){A(typeof mM==\"object\"&&typeof j8<\"u\"?mM:g.jsts={})})(mM,function(g){\"use strict\";function A(){}function I(i){this.message=i||\"\"}function B(i){this.message=i||\"\"}function Q(i){this.message=i||\"\"}function C(){}function E(i){return i===null?CI:i.color}function o(i){return i===null?null:i.parent}function e(i,t){i!==null&&(i.color=t)}function D(i){return i===null?null:i.left}function r(i){return i===null?null:i.right}function n(){this.root_=null,this.size_=0}function G(){}function w(){this.array_=[],arguments[0]instanceof BA&&this.addAll(arguments[0])}function k(){}function F(i){this.message=i||\"\"}function h(){this.array_=[]}\"fill\"in Array.prototype||Object.defineProperty(Array.prototype,\"fill\",{configurable:!0,value:function(i){if(this===void 0||this===null)throw new TypeError(this+\" is not an object\");var t=Object(this),a=Math.max(Math.min(t.length,9007199254740991),0)||0,s=1 in arguments&&parseInt(Number(arguments[1]),10)||0;s=s<0?Math.max(a+s,0):Math.min(s,a);var c=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(c=c<0?Math.max(a+arguments[2],0):Math.min(c,a);s t.x?1:this.y t.y?1:0},q.prototype.clone=function(){},q.prototype.copy=function(){return new q(this)},q.prototype.toString=function(){return\"(\"+this.x+\", \"+this.y+\", \"+this.z+\")\"},q.prototype.distance3D=function(i){var t=this.x-i.x,a=this.y-i.y,s=this.z-i.z;return Math.sqrt(t*t+a*a+s*s)},q.prototype.distance=function(i){var t=this.x-i.x,a=this.y-i.y;return Math.sqrt(t*t+a*a)},q.prototype.hashCode=function(){var i=17;return i=37*i+q.hashCode(this.x),i=37*i+q.hashCode(this.y)},q.prototype.setCoordinate=function(i){this.x=i.x,this.y=i.y,this.z=i.z},q.prototype.interfaces_=function(){return[J,U,A]},q.prototype.getClass=function(){return q},q.hashCode=function(){if(arguments.length===1){var i=arguments[0],t=M.doubleToLongBits(i);return Math.trunc((t^t)>>>32)}},P.DimensionalComparator.get=function(){return Z},P.serialVersionUID.get=function(){return 6683108902428367e3},P.NULL_ORDINATE.get=function(){return M.NaN},P.X.get=function(){return 0},P.Y.get=function(){return 1},P.Z.get=function(){return 2},Object.defineProperties(q,P);var Z=function(i){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Y(\"only 2 or 3 dimensions may be specified\");this._dimensionsToTest=t}}};Z.prototype.compare=function(i,t){var a=i,s=t,c=Z.compare(a.x,s.x);if(c!==0)return c;var y=Z.compare(a.y,s.y);return y!==0?y:this._dimensionsToTest<=2?0:Z.compare(a.z,s.z)},Z.prototype.interfaces_=function(){return[x]},Z.prototype.getClass=function(){return Z},Z.compare=function(i,t){return i t?1:M.isNaN(i)?M.isNaN(t)?0:-1:M.isNaN(t)?1:0};var X=function(){};X.prototype.create=function(){},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X};var L=function(){},j={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};L.prototype.interfaces_=function(){return[]},L.prototype.getClass=function(){return L},L.toLocationSymbol=function(i){switch(i){case L.EXTERIOR:return\"e\";case L.BOUNDARY:return\"b\";case L.INTERIOR:return\"i\";case L.NONE:return\"-\"}throw new Y(\"Unknown location value: \"+i)},j.INTERIOR.get=function(){return 0},j.BOUNDARY.get=function(){return 1},j.EXTERIOR.get=function(){return 2},j.NONE.get=function(){return-1},Object.defineProperties(L,j);var m=function(i,t){return i.interfaces_&&i.interfaces_().indexOf(t)>-1},$=function(){},NA={LOG_10:{configurable:!0}};$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.log10=function(i){var t=Math.log(i);return M.isInfinite(t)||M.isNaN(t)?t:t/$.LOG_10},$.min=function(i,t,a,s){var c=i;return t a?a:i}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],c=arguments[1],y=arguments[2];return s y?y:s}},$.wrap=function(i,t){return i<0?t- -i%t:i%t},$.max=function(){if(arguments.length===3){var i=arguments[0],t=arguments[1],a=arguments[2],s=i;return t>s&&(s=t),a>s&&(s=a),s}if(arguments.length===4){var c=arguments[0],y=arguments[1],R=arguments[2],d=arguments[3],f=c;return y>f&&(f=y),R>f&&(f=R),d>f&&(f=d),f}},$.average=function(i,t){return(i+t)/2},NA.LOG_10.get=function(){return Math.log(10)},Object.defineProperties($,NA);var wA=function(i){this.str=i};wA.prototype.append=function(i){this.str+=i},wA.prototype.setCharAt=function(i,t){this.str=this.str.substr(0,i)+t+this.str.substr(i+1)},wA.prototype.toString=function(i){return this.str};var FA=function(i){this.value=i};FA.prototype.intValue=function(){return this.value},FA.prototype.compareTo=function(i){return this.valuei?1:0},FA.isNaN=function(i){return Number.isNaN(i)};var JA=function(){};JA.isWhitespace=function(i){return i<=32&&i>=0||i===127},JA.toUpperCase=function(i){return i.toUpperCase()};var z=function i(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]==\"number\"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof i){var a=arguments[0];this.init(a)}else if(typeof arguments[0]==\"string\"){var s=arguments[0];i.call(this,i.parse(s))}}else if(arguments.length===2){var c=arguments[0],y=arguments[1];this.init(c,y)}},kg={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};z.prototype.le=function(i){return(this._hi 9?(EA=!0,aA=\"9\"):aA=\"0\"+v,R.append(aA),a=a.subtract(z.valueOf(v)).multiply(z.TEN),EA&&a.selfAdd(z.TEN);var kA=!0,yA=z.magnitude(a._hi);if(yA<0&&Math.abs(yA)>=d-f&&(kA=!1),!kA)break}return t[0]=s,R.toString()},z.prototype.sqr=function(){return this.multiply(this)},z.prototype.doubleValue=function(){return this._hi+this._lo},z.prototype.subtract=function(){if(arguments[0]instanceof z){var i=arguments[0];return this.add(i.negate())}if(typeof arguments[0]==\"number\"){var t=arguments[0];return this.add(-t)}},z.prototype.equals=function(){if(arguments.length===1){var i=arguments[0];return this._hi===i._hi&&this._lo===i._lo}},z.prototype.isZero=function(){return this._hi===0&&this._lo===0},z.prototype.selfSubtract=function(){if(arguments[0]instanceof z){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i._hi,-i._lo)}if(typeof arguments[0]==\"number\"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},z.prototype.getSpecialNumberString=function(){return this.isZero()?\"0.0\":this.isNaN()?\"NaN \":null},z.prototype.min=function(i){return this.le(i)?this:i},z.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof z){var i=arguments[0];return this.selfDivide(i._hi,i._lo)}if(typeof arguments[0]==\"number\"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var a=arguments[0],s=arguments[1],c=null,y=null,R=null,d=null,f=null,v=null,EA=null,aA=null;return f=this._hi/a,v=z.SPLIT*f,c=v-f,aA=z.SPLIT*a,c=v-c,y=f-c,R=aA-a,EA=f*a,R=aA-R,d=a-R,aA=c*R-EA+c*d+y*R+y*d,v=(this._hi-EA-aA+this._lo-f*s)/a,aA=f+v,this._hi=aA,this._lo=f-aA+v,this}},z.prototype.dump=function(){return\"DD<\"+this._hi+\", \"+this._lo+\">\"},z.prototype.divide=function(){if(arguments[0]instanceof z){var i=arguments[0],t=null,a=null,s=null,c=null,y=null,R=null,d=null,f=null;return a=(y=this._hi/i._hi)-(t=(R=z.SPLIT*y)-(t=R-y)),f=t*(s=(f=z.SPLIT*i._hi)-(s=f-i._hi))-(d=y*i._hi)+t*(c=i._hi-s)+a*s+a*c,R=(this._hi-d-f+this._lo-y*i._lo)/i._hi,new z(f=y+R,y-f+R)}if(typeof arguments[0]==\"number\"){var v=arguments[0];return M.isNaN(v)?z.createNaN():z.copy(this).selfDivide(v,0)}},z.prototype.ge=function(i){return(this._hi>i._hi||this._hi===i._hi)&&this._lo>=i._lo},z.prototype.pow=function(i){if(i===0)return z.valueOf(1);var t=new z(this),a=z.valueOf(1),s=Math.abs(i);if(s>1)for(;s>0;)s%2==1&&a.selfMultiply(t),(s/=2)>0&&(t=t.sqr());else a=t;return i<0?a.reciprocal():a},z.prototype.ceil=function(){if(this.isNaN())return z.NaN;var i=Math.ceil(this._hi),t=0;return i===this._hi&&(t=Math.ceil(this._lo)),new z(i,t)},z.prototype.compareTo=function(i){var t=i;return this._hi t._hi?1:this._lo t._lo?1:0},z.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},z.prototype.setValue=function(){if(arguments[0]instanceof z){var i=arguments[0];return this.init(i),this}if(typeof arguments[0]==\"number\"){var t=arguments[0];return this.init(t),this}},z.prototype.max=function(i){return this.ge(i)?this:i},z.prototype.sqrt=function(){if(this.isZero())return z.valueOf(0);if(this.isNegative())return z.NaN;var i=1/Math.sqrt(this._hi),t=this._hi*i,a=z.valueOf(t),s=this.subtract(a.sqr())._hi*(.5*i);return a.add(s)},z.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof z){var i=arguments[0];return this.selfAdd(i._hi,i._lo)}if(typeof arguments[0]==\"number\"){var t=arguments[0],a=null,s=null,c=null,y=null,R=null,d=null;return c=this._hi+t,R=c-this._hi,y=c-R,y=t-R+(this._hi-y),d=y+this._lo,a=c+d,s=d+(c-a),this._hi=a+s,this._lo=s+(a-this._hi),this}}else if(arguments.length===2){var f=arguments[0],v=arguments[1],EA=null,aA=null,kA=null,yA=null,lA=null,SA=null,mg=null;yA=this._hi+f,aA=this._lo+v,lA=yA-(SA=yA-this._hi),kA=aA-(mg=aA-this._lo);var bI=(EA=yA+(SA=(lA=f-SA+(this._hi-lA))+aA))+(SA=(kA=v-mg+(this._lo-kA))+(SA+(yA-EA))),AQ=SA+(EA-bI);return this._hi=bI,this._lo=AQ,this}},z.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof z){var i=arguments[0];return this.selfMultiply(i._hi,i._lo)}if(typeof arguments[0]==\"number\"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var a=arguments[0],s=arguments[1],c=null,y=null,R=null,d=null,f=null,v=null;c=(f=z.SPLIT*this._hi)-this._hi,v=z.SPLIT*a,c=f-c,y=this._hi-c,R=v-a;var EA=(f=this._hi*a)+(v=c*(R=v-R)-f+c*(d=a-R)+y*R+y*d+(this._hi*s+this._lo*a)),aA=v+(c=f-EA);return this._hi=EA,this._lo=aA,this}},z.prototype.selfSqr=function(){return this.selfMultiply(this)},z.prototype.floor=function(){if(this.isNaN())return z.NaN;var i=Math.floor(this._hi),t=0;return i===this._hi&&(t=Math.floor(this._lo)),new z(i,t)},z.prototype.negate=function(){return this.isNaN()?this:new z(-this._hi,-this._lo)},z.prototype.clone=function(){},z.prototype.multiply=function(){if(arguments[0]instanceof z){var i=arguments[0];return i.isNaN()?z.createNaN():z.copy(this).selfMultiply(i)}if(typeof arguments[0]==\"number\"){var t=arguments[0];return M.isNaN(t)?z.createNaN():z.copy(this).selfMultiply(t,0)}},z.prototype.isNaN=function(){return M.isNaN(this._hi)},z.prototype.intValue=function(){return Math.trunc(this._hi)},z.prototype.toString=function(){var i=z.magnitude(this._hi);return i>=-3&&i<=20?this.toStandardNotation():this.toSciNotation()},z.prototype.toStandardNotation=function(){var i=this.getSpecialNumberString();if(i!==null)return i;var t=new Array(1).fill(null),a=this.extractSignificantDigits(!0,t),s=t[0]+1,c=a;if(a.charAt(0)===\".\")c=\"0\"+a;else if(s<0)c=\"0.\"+z.stringOfChar(\"0\",-s)+a;else if(a.indexOf(\".\")===-1){var y=s-a.length;c=a+z.stringOfChar(\"0\",y)+\".0\"}return this.isNegative()?\"-\"+c:c},z.prototype.reciprocal=function(){var i=null,t=null,a=null,s=null,c=null,y=null,R=null,d=null;t=(c=1/this._hi)-(i=(y=z.SPLIT*c)-(i=y-c)),a=(d=z.SPLIT*this._hi)-this._hi;var f=c+(y=(1-(R=c*this._hi)-(d=i*(a=d-a)-R+i*(s=this._hi-a)+t*a+t*s)-c*this._lo)/this._hi);return new z(f,c-f+y)},z.prototype.toSciNotation=function(){if(this.isZero())return z.SCI_NOT_ZERO;var i=this.getSpecialNumberString();if(i!==null)return i;var t=new Array(1).fill(null),a=this.extractSignificantDigits(!1,t),s=z.SCI_NOT_EXPONENT_CHAR+t[0];if(a.charAt(0)===\"0\")throw new Error(\"Found leading zero: \"+a);var c=\"\";a.length>1&&(c=a.substring(1));var y=a.charAt(0)+\".\"+c;return this.isNegative()?\"-\"+y+s:y+s},z.prototype.abs=function(){return this.isNaN()?z.NaN:this.isNegative()?this.negate():new z(this)},z.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},z.prototype.lt=function(i){return(this._hi i._hi||this._hi===i._hi)&&this._lo>i._lo},z.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},z.prototype.trunc=function(){return this.isNaN()?z.NaN:this.isPositive()?this.floor():this.ceil()},z.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},z.prototype.interfaces_=function(){return[A,J,U]},z.prototype.getClass=function(){return z},z.sqr=function(i){return z.valueOf(i).selfMultiply(i)},z.valueOf=function(){if(typeof arguments[0]==\"string\"){var i=arguments[0];return z.parse(i)}if(typeof arguments[0]==\"number\"){var t=arguments[0];return new z(t)}},z.sqrt=function(i){return z.valueOf(i).sqrt()},z.parse=function(i){for(var t=0,a=i.length;JA.isWhitespace(i.charAt(t));)t++;var s=!1;if(t=a);){var v=i.charAt(t);if(t++,JA.isDigit(v)){var EA=v-\"0\";y.selfMultiply(z.TEN),y.selfAdd(EA),R++}else{if(v!==\".\"){if(v===\"e\"||v===\"E\"){var aA=i.substring(t);try{f=FA.parseInt(aA)}catch(mg){throw mg instanceof Error?new Error(\"Invalid exponent \"+aA+\" in string \"+i):mg}break}throw new Error(\"Unexpected character '\"+v+\"' at position \"+t+\" in string \"+i)}d=R}}var kA=y,yA=R-d-f;if(yA===0)kA=y;else if(yA>0){var lA=z.TEN.pow(yA);kA=y.divide(lA)}else if(yA<0){var SA=z.TEN.pow(-yA);kA=y.multiply(SA)}return s?kA.negate():kA},z.createNaN=function(){return new z(M.NaN,M.NaN)},z.copy=function(i){return new z(i)},z.magnitude=function(i){var t=Math.abs(i),a=Math.log(t)/Math.log(10),s=Math.trunc(Math.floor(a));return 10*Math.pow(10,s)<=t&&(s+=1),s},z.stringOfChar=function(i,t){for(var a=new wA,s=0;s 0){if(y<=0)return Yg.signum(R);s=c+y}else{if(!(c<0)||y>=0)return Yg.signum(R);s=-c-y}var d=Yg.DP_SAFE_EPSILON*s;return R>=d||-R>=d?Yg.signum(R):2},Yg.signum=function(i){return i>0?1:i<0?-1:0},sI.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Yg,sI);var bA=function(){},SB={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};SB.X.get=function(){return 0},SB.Y.get=function(){return 1},SB.Z.get=function(){return 2},SB.M.get=function(){return 3},bA.prototype.setOrdinate=function(i,t,a){},bA.prototype.size=function(){},bA.prototype.getOrdinate=function(i,t){},bA.prototype.getCoordinate=function(){},bA.prototype.getCoordinateCopy=function(i){},bA.prototype.getDimension=function(){},bA.prototype.getX=function(i){},bA.prototype.clone=function(){},bA.prototype.expandEnvelope=function(i){},bA.prototype.copy=function(){},bA.prototype.getY=function(i){},bA.prototype.toCoordinateArray=function(){},bA.prototype.interfaces_=function(){return[U]},bA.prototype.getClass=function(){return bA},Object.defineProperties(bA,SB);var ZI=function(){},YQ=function(i){function t(){i.call(this,\"Projective point not representable on the Cartesian plane.\")}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ZI),cg=function(){};cg.arraycopy=function(i,t,a,s,c){for(var y=0,R=t;R i._minx?this._minx:i._minx,a=this._miny>i._miny?this._miny:i._miny,s=this._maxx =this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var a=arguments[0],s=arguments[1];return!this.isNull()&&a>=this._minx&&a<=this._maxx&&s>=this._miny&&s<=this._maxy}},MA.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof MA){var i=arguments[0];return!this.isNull()&&!i.isNull()&&!(i._minx>this._maxx||i._maxx this._maxy||i._maxy this._maxx||a this._maxy||s this._maxx&&(this._maxx=t._maxx),t._miny this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var a=arguments[0],s=arguments[1];this.isNull()?(this._minx=a,this._maxx=a,this._miny=s,this._maxy=s):(a this._maxx&&(this._maxx=a),s this._maxy&&(this._maxy=s))}},MA.prototype.minExtent=function(){if(this.isNull())return 0;var i=this.getWidth(),t=this.getHeight();return i t._minx?1:this._miny t._miny?1:this._maxx t._maxx?1:this._maxy t._maxy?1:0},MA.prototype.translate=function(i,t){if(this.isNull())return null;this.init(this.getMinX()+i,this.getMaxX()+i,this.getMinY()+t,this.getMaxY()+t)},MA.prototype.toString=function(){return\"Env[\"+this._minx+\" : \"+this._maxx+\", \"+this._miny+\" : \"+this._maxy+\"]\"},MA.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},MA.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},MA.prototype.maxExtent=function(){if(this.isNull())return 0;var i=this.getWidth(),t=this.getHeight();return i>t?i:t},MA.prototype.expandBy=function(){if(arguments.length===1){var i=arguments[0];this.expandBy(i,i)}else if(arguments.length===2){var t=arguments[0],a=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=a,this._maxy+=a,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},MA.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof MA){var i=arguments[0];return this.covers(i)}if(arguments[0]instanceof q){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var a=arguments[0],s=arguments[1];return this.covers(a,s)}},MA.prototype.centre=function(){return this.isNull()?null:new q((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},MA.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof q){var i=arguments[0];this.init(i.x,i.x,i.y,i.y)}else if(arguments[0]instanceof MA){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var a=arguments[0],s=arguments[1];this.init(a.x,s.x,a.y,s.y)}else if(arguments.length===4){var c=arguments[0],y=arguments[1],R=arguments[2],d=arguments[3];c i._maxx&&(t=this._minx-i._maxx);var a=0;return this._maxy i._maxy&&(a=this._miny-i._maxy),t===0?a:a===0?t:Math.sqrt(t*t+a*a)},MA.prototype.hashCode=function(){var i=17;return i=37*i+q.hashCode(this._minx),i=37*i+q.hashCode(this._maxx),i=37*i+q.hashCode(this._miny),i=37*i+q.hashCode(this._maxy)},MA.prototype.interfaces_=function(){return[J,A]},MA.prototype.getClass=function(){return MA},MA.intersects=function(){if(arguments.length===3){var i=arguments[0],t=arguments[1],a=arguments[2];return a.x>=(i.x t.x?i.x:t.x)&&a.y>=(i.y t.y?i.y:t.y)}if(arguments.length===4){var s=arguments[0],c=arguments[1],y=arguments[2],R=arguments[3],d=Math.min(y.x,R.x),f=Math.max(y.x,R.x),v=Math.min(s.x,c.x),EA=Math.max(s.x,c.x);return!(v>f)&&!(EA f)&&!(EA this.getEdgeDistance(i,1)?(this._intLineIndex[i][0]=0,this._intLineIndex[i][1]=1):(this._intLineIndex[i][0]=1,this._intLineIndex[i][1]=0)}},wg.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},wg.prototype.setPrecisionModel=function(i){this._precisionModel=i},wg.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var i=arguments[0],t=0;t c?s:c;else{var R=Math.abs(i.x-t.x),d=Math.abs(i.y-t.y);(y=s>c?R:d)!==0||i.equals(t)||(y=Math.max(R,d))}return xA.isTrue(!(y===0&&!i.equals(t)),\"Bad distance calculation\"),y},wg.nonRobustComputeEdgeDistance=function(i,t,a){var s=i.x-t.x,c=i.y-t.y,y=Math.sqrt(s*s+c*c);return xA.isTrue(!(y===0&&!i.equals(t)),\"Invalid distance calculation\"),y},Gi.DONT_INTERSECT.get=function(){return 0},Gi.DO_INTERSECT.get=function(){return 1},Gi.COLLINEAR.get=function(){return 2},Gi.NO_INTERSECTION.get=function(){return 0},Gi.POINT_INTERSECTION.get=function(){return 1},Gi.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(wg,Gi);var cE=function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(a){var s=new MA(this._inputLines[0][0],this._inputLines[0][1]),c=new MA(this._inputLines[1][0],this._inputLines[1][1]);return s.contains(a)&&c.contains(a)},t.prototype.computeIntersection=function(){if(arguments.length!==3)return i.prototype.computeIntersection.apply(this,arguments);var a=arguments[0],s=arguments[1],c=arguments[2];if(this._isProper=!1,MA.intersects(s,c,a)&&hA.orientationIndex(s,c,a)===0&&hA.orientationIndex(c,s,a)===0)return this._isProper=!0,(a.equals(s)||a.equals(c))&&(this._isProper=!1),this._result=i.POINT_INTERSECTION,null;this._result=i.NO_INTERSECTION},t.prototype.normalizeToMinimum=function(a,s,c,y,R){R.x=this.smallestInAbsValue(a.x,s.x,c.x,y.x),R.y=this.smallestInAbsValue(a.y,s.y,c.y,y.y),a.x-=R.x,a.y-=R.y,s.x-=R.x,s.y-=R.y,c.x-=R.x,c.y-=R.y,y.x-=R.x,y.y-=R.y},t.prototype.safeHCoordinateIntersection=function(a,s,c,y){var R=null;try{R=vg.intersection(a,s,c,y)}catch(d){if(!(d instanceof YQ))throw d;R=t.nearestEndpoint(a,s,c,y)}return R},t.prototype.intersection=function(a,s,c,y){var R=this.intersectionWithNormalization(a,s,c,y);return this.isInSegmentEnvelopes(R)||(R=new q(t.nearestEndpoint(a,s,c,y))),this._precisionModel!==null&&this._precisionModel.makePrecise(R),R},t.prototype.smallestInAbsValue=function(a,s,c,y){var R=a,d=Math.abs(R);return Math.abs(s) 1e-4&&cg.out.println(\"Distance = \"+R.distance(d))},t.prototype.intersectionWithNormalization=function(a,s,c,y){var R=new q(a),d=new q(s),f=new q(c),v=new q(y),EA=new q;this.normalizeToEnvCentre(R,d,f,v,EA);var aA=this.safeHCoordinateIntersection(R,d,f,v);return aA.x+=EA.x,aA.y+=EA.y,aA},t.prototype.computeCollinearIntersection=function(a,s,c,y){var R=MA.intersects(a,s,c),d=MA.intersects(a,s,y),f=MA.intersects(c,y,a),v=MA.intersects(c,y,s);return R&&d?(this._intPt[0]=c,this._intPt[1]=y,i.COLLINEAR_INTERSECTION):f&&v?(this._intPt[0]=a,this._intPt[1]=s,i.COLLINEAR_INTERSECTION):R&&f?(this._intPt[0]=c,this._intPt[1]=a,!c.equals(a)||d||v?i.COLLINEAR_INTERSECTION:i.POINT_INTERSECTION):R&&v?(this._intPt[0]=c,this._intPt[1]=s,!c.equals(s)||d||f?i.COLLINEAR_INTERSECTION:i.POINT_INTERSECTION):d&&f?(this._intPt[0]=y,this._intPt[1]=a,!y.equals(a)||R||v?i.COLLINEAR_INTERSECTION:i.POINT_INTERSECTION):d&&v?(this._intPt[0]=y,this._intPt[1]=s,!y.equals(s)||R||f?i.COLLINEAR_INTERSECTION:i.POINT_INTERSECTION):i.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(a,s,c,y,R){var d=a.x s.x?a.x:s.x,EA=a.y>s.y?a.y:s.y,aA=c.x y.x?c.x:y.x,lA=c.y>y.y?c.y:y.y,SA=((d>aA?d:aA)+(v kA?f:kA)+(EA 0&&d>0||R<0&&d<0)return i.NO_INTERSECTION;var f=hA.orientationIndex(c,y,a),v=hA.orientationIndex(c,y,s);return f>0&&v>0||f<0&&v<0?i.NO_INTERSECTION:R===0&&d===0&&f===0&&v===0?this.computeCollinearIntersection(a,s,c,y):(R===0||d===0||f===0||v===0?(this._isProper=!1,a.equals2D(c)||a.equals2D(y)?this._intPt[0]=a:s.equals2D(c)||s.equals2D(y)?this._intPt[0]=s:R===0?this._intPt[0]=new q(c):d===0?this._intPt[0]=new q(y):f===0?this._intPt[0]=new q(a):v===0&&(this._intPt[0]=new q(s))):(this._isProper=!0,this._intPt[0]=this.intersection(a,s,c,y)),i.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(a,s,c,y){var R=a,d=hA.distancePointLine(a,c,y),f=hA.distancePointLine(s,c,y);return f 0?a>0?-c:c:a>0?c:-c;if(t===0||a===0)return s>0?i>0?c:-c:i>0?-c:c;if(t>0?s>0?t<=s||(c=-c,y=i,i=a,a=y,y=t,t=s,s=y):t<=-s?(c=-c,a=-a,s=-s):(y=i,i=-a,a=y,y=t,t=-s,s=y):s>0?-t<=s?(c=-c,i=-i,t=-t):(y=-i,i=a,a=y,y=-t,t=s,s=y):t>=s?(i=-i,t=-t,a=-a,s=-s):(c=-c,y=-i,i=-a,a=y,y=-t,t=-s,s=y),i>0){if(!(a>0)||!(i<=a))return c}else{if(a>0||!(i>=a))return-c;c=-c,i=-i,a=-a}for(;;){if(R=Math.floor(a/i),a-=R*i,(s-=R*t)<0)return-c;if(s>t)return c;if(i>a+a){if(t s+s)return-c;a=i-a,s=t-s,c=-c}if(s===0)return a===0?0:-c;if(a===0||(R=Math.floor(i/a),i-=R*a,(t-=R*s)<0))return c;if(t>s)return-c;if(a>i+i){if(st+t)return c;i=a-i,t=s-t,c=-c}if(t===0)return i===0?0:c;if(i===0)return-c}};var pQ=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var i=arguments[0];this._p=i};pQ.prototype.countSegment=function(i,t){if(i.x s&&(a=t.x,s=i.x),this._p.x>=a&&this._p.x<=s&&(this._isPointOnSegment=!0),null}if(i.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&i.y<=this._p.y){var c=i.x-this._p.x,y=i.y-this._p.y,R=t.x-this._p.x,d=t.y-this._p.y,f=wi.signOfDet2x2(c,y,R,d);if(f===0)return this._isPointOnSegment=!0,null;d 0&&this._crossingCount++}},pQ.prototype.isPointInPolygon=function(){return this.getLocation()!==L.EXTERIOR},pQ.prototype.getLocation=function(){return this._isPointOnSegment?L.BOUNDARY:this._crossingCount%2==1?L.INTERIOR:L.EXTERIOR},pQ.prototype.isOnSegment=function(){return this._isPointOnSegment},pQ.prototype.interfaces_=function(){return[]},pQ.prototype.getClass=function(){return pQ},pQ.locatePointInRing=function(){if(arguments[0]instanceof q&&m(arguments[1],bA)){for(var i=arguments[0],t=arguments[1],a=new pQ(i),s=new q,c=new q,y=1;y 1||d<0||d>1)&&(c=!0)}}else c=!0;return c?$.min(hA.distancePointLine(i,a,s),hA.distancePointLine(t,a,s),hA.distancePointLine(a,i,t),hA.distancePointLine(s,i,t)):0},hA.isPointInRing=function(i,t){return hA.locatePointInRing(i,t)!==L.EXTERIOR},hA.computeLength=function(i){var t=i.size();if(t<=1)return 0;var a=0,s=new q;i.getCoordinate(0,s);for(var c=s.x,y=s.y,R=1;R a.y&&(a=y,s=c)}var R=s;do(R-=1)<0&&(R=t);while(i[R].equals2D(a)&&R!==s);var d=s;do d=(d+1)%t;while(i[d].equals2D(a)&&d!==s);var f=i[R],v=i[d];if(f.equals2D(a)||v.equals2D(a)||f.equals2D(v))return!1;var EA=hA.computeOrientation(f,a,v),aA=!1;return aA=EA===0?f.x>v.x:EA>0,aA},hA.locatePointInRing=function(i,t){return pQ.locatePointInRing(i,t)},hA.distancePointLinePerpendicular=function(i,t,a){var s=(a.x-t.x)*(a.x-t.x)+(a.y-t.y)*(a.y-t.y),c=((t.y-i.y)*(a.x-t.x)-(t.x-i.x)*(a.y-t.y))/s;return Math.abs(c)*Math.sqrt(s)},hA.computeOrientation=function(i,t,a){return hA.orientationIndex(i,t,a)},hA.distancePointLine=function(){if(arguments.length===2){var i=arguments[0],t=arguments[1];if(t.length===0)throw new Y(\"Line array must contain at least one vertex\");for(var a=i.distance(t[0]),s=0;s =1)return y.distance(d);var EA=((R.y-y.y)*(d.x-R.x)-(R.x-y.x)*(d.y-R.y))/f;return Math.abs(EA)*Math.sqrt(f)}},hA.isOnLine=function(i,t){for(var a=new cE,s=1;s 0},V.prototype.interfaces_=function(){return[K]},V.prototype.getClass=function(){return V};var O=function(){};O.prototype.isInBoundary=function(i){return i>1},O.prototype.interfaces_=function(){return[K]},O.prototype.getClass=function(){return O};var eA=function(){};eA.prototype.isInBoundary=function(i){return i===1},eA.prototype.interfaces_=function(){return[K]},eA.prototype.getClass=function(){return eA};var BA=function(){};BA.prototype.add=function(){},BA.prototype.addAll=function(){},BA.prototype.isEmpty=function(){},BA.prototype.iterator=function(){},BA.prototype.size=function(){},BA.prototype.toArray=function(){},BA.prototype.remove=function(){},(I.prototype=new Error).name=\"IndexOutOfBoundsException\";var rA=function(){};rA.prototype.hasNext=function(){},rA.prototype.next=function(){},rA.prototype.remove=function(){};var DA=function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(BA);(B.prototype=new Error).name=\"NoSuchElementException\";var QA=function(i){function t(){i.call(this),this.array_=[],arguments[0]instanceof BA&&this.addAll(arguments[0])}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[i,BA]},t.prototype.add=function(a){return arguments.length===1?this.array_.push(a):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(a){for(var s=a.iterator();s.hasNext();)this.add(s.next());return!0},t.prototype.set=function(a,s){var c=this.array_[a];return this.array_[a]=s,c},t.prototype.iterator=function(){return new iA(this)},t.prototype.get=function(a){if(a<0||a>=this.size())throw new I;return this.array_[a]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var a=[],s=0,c=this.array_.length;s =1&&this.get(this.size()-1).equals2D(R))return null;i.prototype.add.call(this,R)}else if(arguments[0]instanceof Object&&typeof arguments[1]==\"boolean\"){var d=arguments[0],f=arguments[1];return this.add(d,f),!0}}else if(arguments.length===3){if(typeof arguments[2]==\"boolean\"&&arguments[0]instanceof Array&&typeof arguments[1]==\"boolean\"){var v=arguments[0],EA=arguments[1];if(arguments[2])for(var aA=0;aA =0;kA--)this.add(v[kA],EA);return!0}if(typeof arguments[2]==\"boolean\"&&Number.isInteger(arguments[0])&&arguments[1]instanceof q){var yA=arguments[0],lA=arguments[1];if(!arguments[2]){var SA=this.size();if(SA>0&&(yA>0&&this.get(yA-1).equals2D(lA)||yA Yi&&(qt=-1);for(var QJ=AQ;QJ!==Yi;QJ+=qt)this.add(mg[QJ],bI);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new q(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,a),t}(QA),sA=function(){},VA={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};VA.ForwardComparator.get=function(){return mA},VA.BidirectionalComparator.get=function(){return hg},VA.coordArrayType.get=function(){return new Array(0).fill(null)},sA.prototype.interfaces_=function(){return[]},sA.prototype.getClass=function(){return sA},sA.isRing=function(i){return!(i.length<4)&&!!i[0].equals2D(i[i.length-1])},sA.ptNotInList=function(i,t){for(var a=0;a =i?t:[]},sA.indexOf=function(i,t){for(var a=0;a 0)&&(t=i[a]);return t},sA.extract=function(i,t,a){t=$.clamp(t,0,i.length);var s=(a=$.clamp(a,-1,i.length))-t+1;a<0&&(s=0),t>=i.length&&(s=0),a s.length)return 1;if(a.length===0)return 0;var c=sA.compare(a,s);return sA.isEqualReversed(a,s)?0:c},hg.prototype.OLDcompare=function(i,t){var a=i,s=t;if(a.length s.length)return 1;if(a.length===0)return 0;for(var c=sA.increasingDirection(a),y=sA.increasingDirection(s),R=c>0?0:a.length-1,d=y>0?0:a.length-1,f=0;f 0))return t.value;t=t.right}}return null},n.prototype.put=function(i,t){if(this.root_===null)return this.root_={key:i,value:t,left:null,right:null,parent:null,color:CI,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var a,s,c=this.root_;do if(a=c,(s=i.compareTo(c.key))<0)c=c.left;else{if(!(s>0)){var y=c.value;return c.value=t,y}c=c.right}while(c!==null);var R={key:i,left:null,right:null,value:t,parent:a,color:CI,getValue:function(){return this.value},getKey:function(){return this.key}};return s<0?a.left=R:a.right=R,this.fixAfterInsertion(R),this.size_++,null},n.prototype.fixAfterInsertion=function(i){for(i.color=1;i!=null&&i!==this.root_&&i.parent.color===1;)if(o(i)===D(o(o(i)))){var t=r(o(o(i)));E(t)===1?(e(o(i),CI),e(t,CI),e(o(o(i)),1),i=o(o(i))):(i===r(o(i))&&(i=o(i),this.rotateLeft(i)),e(o(i),CI),e(o(o(i)),1),this.rotateRight(o(o(i))))}else{var a=D(o(o(i)));E(a)===1?(e(o(i),CI),e(a,CI),e(o(o(i)),1),i=o(o(i))):(i===D(o(i))&&(i=o(i),this.rotateRight(i)),e(o(i),CI),e(o(o(i)),1),this.rotateLeft(o(o(i))))}this.root_.color=CI},n.prototype.values=function(){var i=new QA,t=this.getFirstEntry();if(t!==null)for(i.add(t.value);(t=n.successor(t))!==null;)i.add(t.value);return i},n.prototype.entrySet=function(){var i=new KI,t=this.getFirstEntry();if(t!==null)for(i.add(t);(t=n.successor(t))!==null;)i.add(t);return i},n.prototype.rotateLeft=function(i){if(i!=null){var t=i.right;i.right=t.left,t.left!=null&&(t.left.parent=i),t.parent=i.parent,i.parent===null?this.root_=t:i.parent.left===i?i.parent.left=t:i.parent.right=t,t.left=i,i.parent=t}},n.prototype.rotateRight=function(i){if(i!=null){var t=i.left;i.left=t.right,t.right!=null&&(t.right.parent=i),t.parent=i.parent,i.parent===null?this.root_=t:i.parent.right===i?i.parent.right=t:i.parent.left=t,t.right=i,i.parent=t}},n.prototype.getFirstEntry=function(){var i=this.root_;if(i!=null)for(;i.left!=null;)i=i.left;return i},n.successor=function(i){if(i===null)return null;if(i.right!==null){for(var t=i.right;t.left!==null;)t=t.left;return t}for(var a=i.parent,s=i;a!==null&&s===a.right;)s=a,a=a.parent;return a},n.prototype.size=function(){return this.size_};var pI=function(){};pI.prototype.interfaces_=function(){return[]},pI.prototype.getClass=function(){return pI},G.prototype=new C,(w.prototype=new G).contains=function(i){for(var t=0,a=this.array_.length;t=0;){var R=c.substring(0,y);s.add(R),y=(c=c.substring(y+a)).indexOf(t)}c.length>0&&s.add(c);for(var d=new Array(s.size()).fill(null),f=0;f 0)for(var y=c;y0&&s.append(\" \");for(var y=0;y0&&s.append(\",\"),s.append($I.toString(i.getOrdinate(c,y)))}return s.append(\")\"),s.toString()}},gI.ensureValidRing=function(i,t){var a=t.size();return a===0?t:a<=3?gI.createClosedRing(i,t,4):t.getOrdinate(0,bA.X)===t.getOrdinate(a-1,bA.X)&&t.getOrdinate(0,bA.Y)===t.getOrdinate(a-1,bA.Y)?t:gI.createClosedRing(i,t,a+1)},gI.createClosedRing=function(i,t,a){var s=i.create(a,t.getDimension()),c=t.size();gI.copy(t,0,s,0,c);for(var y=c;y0&&gI.reverse(this._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?vA.FALSE:0},t.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return hA.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var s=this._points.copy();return gI.reverse(s),this.getFactory().createLineString(s)},t.prototype.compareToSameClass=function(){if(arguments.length===1){for(var s=arguments[0],c=0,y=0;c = 2)\");this._points=s},t.prototype.isCoordinate=function(s){for(var c=0;c =1&&this.getCoordinateSequence().size() = 4)\")},t.prototype.getGeometryType=function(){return\"LinearRing\"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},a.MINIMUM_VALID_SIZE.get=function(){return 4},a.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,a),t}(II),oB=function(i){function t(){i.apply(this,arguments)}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var a={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return UA.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var s=arguments[0],c=arguments[1];return!!this.isEquivalentClass(s)&&i.prototype.equalsExact.call(this,s,c)}return i.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var s=this._geometries.length,c=new Array(s).fill(null),y=0;y 0?t.createPoint(a[0]):t.createPoint():i},me.prototype.interfaces_=function(){return[wB.GeometryEditorOperation]},me.prototype.getClass=function(){return me};var xe=function(){};xe.prototype.edit=function(i,t){return i instanceof GB?t.createLinearRing(this.edit(i.getCoordinateSequence(),i)):i instanceof II?t.createLineString(this.edit(i.getCoordinateSequence(),i)):i instanceof VB?t.createPoint(this.edit(i.getCoordinateSequence(),i)):i},xe.prototype.interfaces_=function(){return[wB.GeometryEditorOperation]},xe.prototype.getClass=function(){return xe};var BI=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var i=arguments[0];this._coordinates=new Array(i).fill(null);for(var t=0;t0){var i=new wA(17*this._coordinates.length);i.append(\"(\"),i.append(this._coordinates[0]);for(var t=1;t 3&&(s=3),s<2?new BI(a):new BI(a,s)}},qQ.prototype.interfaces_=function(){return[X,A]},qQ.prototype.getClass=function(){return qQ},qQ.instance=function(){return qQ.instanceObject},CD.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},CD.instanceObject.get=function(){return new qQ},Object.defineProperties(qQ,CD);var qs=function(i){function t(){i.call(this),this.map_=new Map}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.get=function(a){return this.map_.get(a)||null},t.prototype.put=function(a,s){return this.map_.set(a,s),s},t.prototype.values=function(){for(var a=new QA,s=this.map_.values(),c=s.next();!c.done;)a.add(c.value),c=s.next();return a},t.prototype.entrySet=function(){var a=new KI;return this.map_.entries().forEach(function(s){return a.add(s)}),a},t.prototype.size=function(){return this.map_.size()},t}(gg),yg=function i(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=i.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof aQ){var t=arguments[0];this._modelType=t,t===i.FIXED&&this.setScale(1)}else if(typeof arguments[0]==\"number\"){var a=arguments[0];this._modelType=i.FIXED,this.setScale(a)}else if(arguments[0]instanceof i){var s=arguments[0];this._modelType=s._modelType,this._scale=s._scale}}},ED={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};yg.prototype.equals=function(i){if(!(i instanceof yg))return!1;var t=i;return this._modelType===t._modelType&&this._scale===t._scale},yg.prototype.compareTo=function(i){var t=i,a=this.getMaximumSignificantDigits(),s=t.getMaximumSignificantDigits();return new FA(a).compareTo(new FA(s))},yg.prototype.getScale=function(){return this._scale},yg.prototype.isFloating=function(){return this._modelType===yg.FLOATING||this._modelType===yg.FLOATING_SINGLE},yg.prototype.getType=function(){return this._modelType},yg.prototype.toString=function(){var i=\"UNKNOWN\";return this._modelType===yg.FLOATING?i=\"Floating\":this._modelType===yg.FLOATING_SINGLE?i=\"Floating-Single\":this._modelType===yg.FIXED&&(i=\"Fixed (Scale=\"+this.getScale()+\")\"),i},yg.prototype.makePrecise=function(){if(typeof arguments[0]==\"number\"){var i=arguments[0];return M.isNaN(i)||this._modelType===yg.FLOATING_SINGLE?i:this._modelType===yg.FIXED?Math.round(i*this._scale)/this._scale:i}if(arguments[0]instanceof q){var t=arguments[0];if(this._modelType===yg.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}},yg.prototype.getMaximumSignificantDigits=function(){var i=16;return this._modelType===yg.FLOATING?i=16:this._modelType===yg.FLOATING_SINGLE?i=6:this._modelType===yg.FIXED&&(i=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),i},yg.prototype.setScale=function(i){this._scale=Math.abs(i)},yg.prototype.interfaces_=function(){return[A,J]},yg.prototype.getClass=function(){return yg},yg.mostPrecise=function(i,t){return i.compareTo(t)>=0?i:t},ED.serialVersionUID.get=function(){return 7777263578777804e3},ED.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(yg,ED);var aQ=function i(t){this._name=t||null,i.nameToTypeMap.put(t,this)},xE={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};aQ.prototype.readResolve=function(){return aQ.nameToTypeMap.get(this._name)},aQ.prototype.toString=function(){return this._name},aQ.prototype.interfaces_=function(){return[A]},aQ.prototype.getClass=function(){return aQ},xE.serialVersionUID.get=function(){return-552860263173159e4},xE.nameToTypeMap.get=function(){return new qs},Object.defineProperties(aQ,xE),yg.Type=aQ,yg.FIXED=new aQ(\"FIXED\"),yg.FLOATING=new aQ(\"FLOATING\"),yg.FLOATING_SINGLE=new aQ(\"FLOATING SINGLE\");var ag=function i(){this._precisionModel=new yg,this._SRID=0,this._coordinateSequenceFactory=i.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?m(arguments[0],X)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof yg&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},gc={serialVersionUID:{configurable:!0}};ag.prototype.toGeometry=function(i){return i.isNull()?this.createPoint(null):i.getMinX()===i.getMaxX()&&i.getMinY()===i.getMaxY()?this.createPoint(new q(i.getMinX(),i.getMinY())):i.getMinX()===i.getMaxX()||i.getMinY()===i.getMaxY()?this.createLineString([new q(i.getMinX(),i.getMinY()),new q(i.getMaxX(),i.getMaxY())]):this.createPolygon(this.createLinearRing([new q(i.getMinX(),i.getMinY()),new q(i.getMinX(),i.getMaxY()),new q(i.getMaxX(),i.getMaxY()),new q(i.getMaxX(),i.getMinY()),new q(i.getMinX(),i.getMinY())]),null)},ag.prototype.createLineString=function(i){return i?i instanceof Array?new II(this.getCoordinateSequenceFactory().create(i),this):m(i,bA)?new II(i,this):void 0:new II(this.getCoordinateSequenceFactory().create([]),this)},ag.prototype.createMultiLineString=function(){if(arguments.length===0)return new eQ(null,this);if(arguments.length===1){var i=arguments[0];return new eQ(i,this)}},ag.prototype.buildGeometry=function(i){for(var t=null,a=!1,s=!1,c=i.iterator();c.hasNext();){var y=c.next(),R=y.getClass();t===null&&(t=R),R!==t&&(a=!0),y.isGeometryCollectionOrDerived()&&(s=!0)}if(t===null)return this.createGeometryCollection();if(a||s)return this.createGeometryCollection(ag.toGeometryArray(i));var d=i.iterator().next();if(i.size()>1){if(d instanceof Hg)return this.createMultiPolygon(ag.toPolygonArray(i));if(d instanceof II)return this.createMultiLineString(ag.toLineStringArray(i));if(d instanceof VB)return this.createMultiPoint(ag.toPointArray(i));xA.shouldNeverReachHere(\"Unhandled class: \"+d.getClass().getName())}return d},ag.prototype.createMultiPointFromCoords=function(i){return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)},ag.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof q){var i=arguments[0];return this.createPoint(i!==null?this.getCoordinateSequenceFactory().create([i]):null)}if(m(arguments[0],bA)){var t=arguments[0];return new VB(t,this)}}},ag.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ag.prototype.createPolygon=function(){if(arguments.length===0)return new Hg(null,null,this);if(arguments.length===1){if(m(arguments[0],bA)){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof GB){var a=arguments[0];return this.createPolygon(a,null)}}else if(arguments.length===2){var s=arguments[0],c=arguments[1];return new Hg(s,c,this)}},ag.prototype.getSRID=function(){return this._SRID},ag.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Xg(null,this);if(arguments.length===1){var i=arguments[0];return new Xg(i,this)}},ag.prototype.createGeometry=function(i){return new wB(this).edit(i,{edit:function(){if(arguments.length===2){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ag.prototype.getPrecisionModel=function(){return this._precisionModel},ag.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var i=arguments[0];return this.createLinearRing(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if(m(arguments[0],bA)){var t=arguments[0];return new GB(t,this)}}},ag.prototype.createMultiPolygon=function(){if(arguments.length===0)return new oB(null,this);if(arguments.length===1){var i=arguments[0];return new oB(i,this)}},ag.prototype.createMultiPoint=function(){if(arguments.length===0)return new GE(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var i=arguments[0];return new GE(i,this)}if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)}if(m(arguments[0],bA)){var a=arguments[0];if(a===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(a.size()).fill(null),c=0;c =this.size())throw new Error;return this.array_[i]},h.prototype.push=function(i){return this.array_.push(i),i},h.prototype.pop=function(i){if(this.array_.length===0)throw new F;return this.array_.pop()},h.prototype.peek=function(){if(this.array_.length===0)throw new F;return this.array_[this.array_.length-1]},h.prototype.empty=function(){return this.array_.length===0},h.prototype.isEmpty=function(){return this.empty()},h.prototype.search=function(i){return this.array_.indexOf(i)},h.prototype.size=function(){return this.array_.length},h.prototype.toArray=function(){for(var i=[],t=0,a=this.array_.length;t0&&this._minIndex this._minCoord.y&&a.y>this._minCoord.y&&s===hA.CLOCKWISE)&&(c=!0),c&&(this._minIndex=this._minIndex-1)},cA.prototype.getRightmostSideOfSegment=function(i,t){var a=i.getEdge().getCoordinates();if(t<0||t+1>=a.length||a[t].y===a[t+1].y)return-1;var s=u.LEFT;return a[t].ythis._minCoord.x)&&(this._minDe=i,this._minIndex=a,this._minCoord=t[a])},cA.prototype.findRightmostEdgeAtNode=function(){var i=this._minDe.getNode().getEdges();this._minDe=i.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},cA.prototype.findEdge=function(i){for(var t=i.iterator();t.hasNext();){var a=t.next();a.isForward()&&this.checkForRightmostCoordinate(a)}xA.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),\"inconsistency in rightmost processing\"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===u.LEFT&&(this._orientedDe=this._minDe.getSym())},cA.prototype.interfaces_=function(){return[]},cA.prototype.getClass=function(){return cA};var RA=function(i){function t(a,s){i.call(this,t.msgWithCoord(a,s)),this.pt=s?new q(s):null,this.name=\"TopologyException\"}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(a,s){return s?a:a+\" [ \"+s+\" ]\"},t}(KQ),Ng=function(){this.array_=[]};Ng.prototype.addLast=function(i){this.array_.push(i)},Ng.prototype.removeFirst=function(){return this.array_.shift()},Ng.prototype.isEmpty=function(){return this.array_.length===0};var dg=function(){this._finder=null,this._dirEdgeList=new QA,this._nodes=new QA,this._rightMostCoord=null,this._env=null,this._finder=new cA};dg.prototype.clearVisitedEdges=function(){for(var i=this._dirEdgeList.iterator();i.hasNext();)i.next().setVisited(!1)},dg.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},dg.prototype.computeNodeDepth=function(i){for(var t=null,a=i.getEdges().iterator();a.hasNext();){var s=a.next();if(s.isVisited()||s.getSym().isVisited()){t=s;break}}if(t===null)throw new RA(\"unable to find edge to compute depths at \"+i.getCoordinate());i.getEdges().computeDepths(t);for(var c=i.getEdges().iterator();c.hasNext();){var y=c.next();y.setVisited(!0),this.copySymDepths(y)}},dg.prototype.computeDepth=function(i){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(u.RIGHT,i),this.copySymDepths(t),this.computeDepths(t)},dg.prototype.create=function(i){this.addReachable(i),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},dg.prototype.findResultEdges=function(){for(var i=this._dirEdgeList.iterator();i.hasNext();){var t=i.next();t.getDepth(u.RIGHT)>=1&&t.getDepth(u.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},dg.prototype.computeDepths=function(i){var t=new KI,a=new Ng,s=i.getNode();for(a.addLast(s),t.add(s),i.setVisited(!0);!a.isEmpty();){var c=a.removeFirst();t.add(c),this.computeNodeDepth(c);for(var y=c.getEdges().iterator();y.hasNext();){var R=y.next().getSym();if(!R.isVisited()){var d=R.getNode();t.contains(d)||(a.addLast(d),t.add(d))}}}},dg.prototype.compareTo=function(i){var t=i;return this._rightMostCoord.x t._rightMostCoord.x?1:0},dg.prototype.getEnvelope=function(){if(this._env===null){for(var i=new MA,t=this._dirEdgeList.iterator();t.hasNext();)for(var a=t.next().getEdge().getCoordinates(),s=0;s this.location.length){var t=new Array(3).fill(null);t[u.ON]=this.location[u.ON],t[u.LEFT]=L.NONE,t[u.RIGHT]=L.NONE,this.location=t}for(var a=0;a 1&&i.append(L.toLocationSymbol(this.location[u.LEFT])),i.append(L.toLocationSymbol(this.location[u.ON])),this.location.length>1&&i.append(L.toLocationSymbol(this.location[u.RIGHT])),i.toString()},Cg.prototype.setLocations=function(i,t,a){this.location[u.ON]=i,this.location[u.LEFT]=t,this.location[u.RIGHT]=a},Cg.prototype.get=function(i){return i 1},Cg.prototype.isAnyNull=function(){for(var i=0;i this._maxNodeDegree&&(this._maxNodeDegree=t),i=this.getNext(i)}while(i!==this._startDe);this._maxNodeDegree*=2},ug.prototype.addPoints=function(i,t,a){var s=i.getCoordinates();if(t){var c=1;a&&(c=0);for(var y=c;y =0;d--)this._pts.add(s[d])}},ug.prototype.isHole=function(){return this._isHole},ug.prototype.setInResult=function(){var i=this._startDe;do i.getEdge().setInResult(!0),i=i.getNext();while(i!==this._startDe)},ug.prototype.containsPoint=function(i){var t=this.getLinearRing();if(!t.getEnvelopeInternal().contains(i)||!hA.isPointInRing(i,t.getCoordinates()))return!1;for(var a=this._holes.iterator();a.hasNext();)if(a.next().containsPoint(i))return!1;return!0},ug.prototype.addHole=function(i){this._holes.add(i)},ug.prototype.isShell=function(){return this._shell===null},ug.prototype.getLabel=function(){return this._label},ug.prototype.getEdges=function(){return this._edges},ug.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},ug.prototype.getShell=function(){return this._shell},ug.prototype.mergeLabel=function(){if(arguments.length===1){var i=arguments[0];this.mergeLabel(i,0),this.mergeLabel(i,1)}else if(arguments.length===2){var t=arguments[0],a=arguments[1],s=t.getLocation(a,u.RIGHT);if(s===L.NONE)return null;if(this._label.getLocation(a)===L.NONE)return this._label.setLocation(a,s),null}},ug.prototype.setShell=function(i){this._shell=i,i!==null&&i.addHole(this)},ug.prototype.toPolygon=function(i){for(var t=new Array(this._holes.size()).fill(null),a=0;a =2,\"found partial label\"),this.computeIM(i)},_Q.prototype.isInResult=function(){return this._isInResult},_Q.prototype.isVisited=function(){return this._isVisited},_Q.prototype.interfaces_=function(){return[]},_Q.prototype.getClass=function(){return _Q};var gN=function(i){function t(){i.call(this),this._coord=null,this._edges=null;var a=arguments[0],s=arguments[1];this._coord=a,this._edges=s,this._label=new XA(0,L.NONE)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var a=this.getEdges().getEdges().iterator();a.hasNext();)if(a.next().getEdge().isInResult())return!0;return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(a){a.println(\"node \"+this._coord+\" lbl: \"+this._label)},t.prototype.computeIM=function(a){},t.prototype.computeMergedLocation=function(a,s){var c=L.NONE;if(c=this._label.getLocation(s),!a.isNull(s)){var y=a.getLocation(s);c!==L.BOUNDARY&&(c=y)}return c},t.prototype.setLabel=function(){if(arguments.length!==2)return i.prototype.setLabel.apply(this,arguments);var a=arguments[0],s=arguments[1];this._label===null?this._label=new XA(a,s):this._label.setLocation(a,s)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){if(arguments[0]instanceof t){var a=arguments[0];this.mergeLabel(a._label)}else if(arguments[0]instanceof XA)for(var s=arguments[0],c=0;c<2;c++){var y=this.computeMergedLocation(s,c);this._label.getLocation(c)===L.NONE&&this._label.setLocation(c,y)}},t.prototype.add=function(a){this._edges.insert(a),a.setNode(this)},t.prototype.setLabelBoundary=function(a){if(this._label===null)return null;var s=L.NONE;this._label!==null&&(s=this._label.getLocation(a));var c=null;switch(s){case L.BOUNDARY:c=L.INTERIOR;break;case L.INTERIOR:default:c=L.BOUNDARY}this._label.setLocation(a,c)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(_Q),TE=function(){this.nodeMap=new n,this.nodeFact=null;var i=arguments[0];this.nodeFact=i};TE.prototype.find=function(i){return this.nodeMap.get(i)},TE.prototype.addNode=function(){if(arguments[0]instanceof q){var i=arguments[0],t=this.nodeMap.get(i);return t===null&&(t=this.nodeFact.createNode(i),this.nodeMap.put(i,t)),t}if(arguments[0]instanceof gN){var a=arguments[0],s=this.nodeMap.get(a.getCoordinate());return s===null?(this.nodeMap.put(a.getCoordinate(),a),a):(s.mergeLabel(a),s)}},TE.prototype.print=function(i){for(var t=this.iterator();t.hasNext();)t.next().print(i)},TE.prototype.iterator=function(){return this.nodeMap.values().iterator()},TE.prototype.values=function(){return this.nodeMap.values()},TE.prototype.getBoundaryNodes=function(i){for(var t=new QA,a=this.iterator();a.hasNext();){var s=a.next();s.getLabel().getLocation(i)===L.BOUNDARY&&t.add(s)}return t},TE.prototype.add=function(i){var t=i.getCoordinate();this.addNode(t).add(i)},TE.prototype.interfaces_=function(){return[]},TE.prototype.getClass=function(){return TE};var Tg=function(){},Bc={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Tg.prototype.interfaces_=function(){return[]},Tg.prototype.getClass=function(){return Tg},Tg.isNorthern=function(i){return i===Tg.NE||i===Tg.NW},Tg.isOpposite=function(i,t){return i===t?!1:(i-t+4)%4===2},Tg.commonHalfPlane=function(i,t){if(i===t)return i;if((i-t+4)%4===2)return-1;var a=i t?i:t)===3?3:a},Tg.isInHalfPlane=function(i,t){return t===Tg.SE?i===Tg.SE||i===Tg.SW:i===t||i===t+1},Tg.quadrant=function(){if(typeof arguments[0]==\"number\"&&typeof arguments[1]==\"number\"){var i=arguments[0],t=arguments[1];if(i===0&&t===0)throw new Y(\"Cannot compute the quadrant for point ( \"+i+\", \"+t+\" )\");return i>=0?t>=0?Tg.NE:Tg.SE:t>=0?Tg.NW:Tg.SW}if(arguments[0]instanceof q&&arguments[1]instanceof q){var a=arguments[0],s=arguments[1];if(s.x===a.x&&s.y===a.y)throw new Y(\"Cannot compute the quadrant for two identical points \"+a);return s.x>=a.x?s.y>=a.y?Tg.NE:Tg.SE:s.y>=a.y?Tg.NW:Tg.SW}},Bc.NE.get=function(){return 0},Bc.NW.get=function(){return 1},Bc.SW.get=function(){return 2},Bc.SE.get=function(){return 3},Object.defineProperties(Tg,Bc);var LB=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var i=arguments[0];this._edge=i}else if(arguments.length===3){var t=arguments[0],a=arguments[1],s=arguments[2];this._edge=t,this.init(a,s),this._label=null}else if(arguments.length===4){var c=arguments[0],y=arguments[1],R=arguments[2],d=arguments[3];this._edge=c,this.init(y,R),this._label=d}};LB.prototype.compareDirection=function(i){return this._dx===i._dx&&this._dy===i._dy?0:this._quadrant>i._quadrant?1:this._quadrant 2){y.linkDirectedEdgesForMinimalEdgeRings();var R=y.buildMinimalRings(),d=this.findShell(R);d!==null?(this.placePolygonHoles(d,R),t.add(d)):a.addAll(R)}else s.add(y)}return s},dQ.prototype.containsPoint=function(i){for(var t=this._shellList.iterator();t.hasNext();)if(t.next().containsPoint(i))return!0;return!1},dQ.prototype.buildMaximalEdgeRings=function(i){for(var t=new QA,a=i.iterator();a.hasNext();){var s=a.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var c=new cv(s,this._geometryFactory);t.add(c),c.setInResult()}}return t},dQ.prototype.placePolygonHoles=function(i,t){for(var a=t.iterator();a.hasNext();){var s=a.next();s.isHole()&&s.setShell(i)}},dQ.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},dQ.prototype.findEdgeRingContaining=function(i,t){for(var a=i.getLinearRing(),s=a.getEnvelopeInternal(),c=a.getCoordinateN(0),y=null,R=null,d=t.iterator();d.hasNext();){var f=d.next(),v=f.getLinearRing(),EA=v.getEnvelopeInternal();y!==null&&(R=y.getLinearRing().getEnvelopeInternal());var aA=!1;EA.contains(s)&&hA.isPointInRing(c,v.getCoordinates())&&(aA=!0),aA&&(y===null||R.contains(EA))&&(y=f)}return y},dQ.prototype.findShell=function(i){for(var t=0,a=null,s=i.iterator();s.hasNext();){var c=s.next();c.isHole()||(a=c,t++)}return xA.isTrue(t<=1,\"found two shells in MinimalEdgeRing list\"),a},dQ.prototype.add=function(){if(arguments.length===1){var i=arguments[0];this.add(i.getEdgeEnds(),i.getNodes())}else if(arguments.length===2){var t=arguments[0],a=arguments[1];GI.linkResultDirectedEdges(a);var s=this.buildMaximalEdgeRings(t),c=new QA,y=this.buildMinimalEdgeRings(s,this._shellList,c);this.sortShellsAndHoles(y,this._shellList,c),this.placeFreeHoles(this._shellList,c)}},dQ.prototype.interfaces_=function(){return[]},dQ.prototype.getClass=function(){return dQ};var Us=function(){};Us.prototype.getBounds=function(){},Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us};var wE=function(){this._bounds=null,this._item=null;var i=arguments[0],t=arguments[1];this._bounds=i,this._item=t};wE.prototype.getItem=function(){return this._item},wE.prototype.getBounds=function(){return this._bounds},wE.prototype.interfaces_=function(){return[Us,A]},wE.prototype.getClass=function(){return wE};var yo=function(){this._size=null,this._items=null,this._size=0,this._items=new QA,this._items.add(null)};yo.prototype.poll=function(){if(this.isEmpty())return null;var i=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),i},yo.prototype.size=function(){return this._size},yo.prototype.reorder=function(i){for(var t=null,a=this._items.get(i);2*i<=this._size&&((t=2*i)!==this._size&&this._items.get(t+1).compareTo(this._items.get(t))<0&&t++,this._items.get(t).compareTo(a)<0);i=t)this._items.set(i,this._items.get(t));this._items.set(i,a)},yo.prototype.clear=function(){this._size=0,this._items.clear()},yo.prototype.isEmpty=function(){return this._size===0},yo.prototype.add=function(i){this._items.add(null),this._size+=1;var t=this._size;for(this._items.set(0,i);i.compareTo(this._items.get(Math.trunc(t/2)))<0;t/=2)this._items.set(t,this._items.get(Math.trunc(t/2)));this._items.set(t,i)},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo};var kt=function(){};kt.prototype.visitItem=function(i){},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt};var oD=function(){};oD.prototype.insert=function(i,t){},oD.prototype.remove=function(i,t){},oD.prototype.query=function(){},oD.prototype.interfaces_=function(){return[]},oD.prototype.getClass=function(){return oD};var OI=function(){if(this._childBoundables=new QA,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this._level=i}}},iL={serialVersionUID:{configurable:!0}};OI.prototype.getLevel=function(){return this._level},OI.prototype.size=function(){return this._childBoundables.size()},OI.prototype.getChildBoundables=function(){return this._childBoundables},OI.prototype.addChildBoundable=function(i){xA.isTrue(this._bounds===null),this._childBoundables.add(i)},OI.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},OI.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},OI.prototype.interfaces_=function(){return[Us,A]},OI.prototype.getClass=function(){return OI},iL.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(OI,iL);var hE=function(){};hE.reverseOrder=function(){return{compare:function(i,t){return t.compareTo(i)}}},hE.min=function(i){return hE.sort(i),i.get(0)},hE.sort=function(i,t){var a=i.toArray();t?rI.sort(a,t):rI.sort(a);for(var s=i.iterator(),c=0,y=a.length;c mI.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,i,t),null):(this.expand(this._boundable2,this._boundable1,i,t),null);if(a)return this.expand(this._boundable1,this._boundable2,i,t),null;if(s)return this.expand(this._boundable2,this._boundable1,i,t),null;throw new Y(\"neither boundable is composite\")},mI.prototype.isLeaves=function(){return!(mI.isComposite(this._boundable1)||mI.isComposite(this._boundable2))},mI.prototype.compareTo=function(i){var t=i;return this._distance t._distance?1:0},mI.prototype.expand=function(i,t,a,s){for(var c=i.getChildBoundables().iterator();c.hasNext();){var y=c.next(),R=new mI(y,t,this._itemDistance);R.getDistance() 1,\"Node capacity must be greater than 1\"),this._nodeCapacity=a}},IN={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};tB.prototype.getNodeCapacity=function(){return this._nodeCapacity},tB.prototype.lastNode=function(i){return i.get(i.size()-1)},tB.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var i=0,t=arguments[0].getChildBoundables().iterator();t.hasNext();){var a=t.next();a instanceof OI?i+=this.size(a):a instanceof wE&&(i+=1)}return i}},tB.prototype.removeItem=function(i,t){for(var a=null,s=i.getChildBoundables().iterator();s.hasNext();){var c=s.next();c instanceof wE&&c.getItem()===t&&(a=c)}return a!==null&&(i.getChildBoundables().remove(a),!0)},tB.prototype.itemsTree=function(){if(arguments.length===0){this.build();var i=this.itemsTree(this._root);return i===null?new QA:i}if(arguments.length===1){for(var t=arguments[0],a=new QA,s=t.getChildBoundables().iterator();s.hasNext();){var c=s.next();if(c instanceof OI){var y=this.itemsTree(c);y!==null&&a.add(y)}else c instanceof wE?a.add(c.getItem()):xA.shouldNeverReachHere()}return a.size()<=0?null:a}},tB.prototype.insert=function(i,t){xA.isTrue(!this._built,\"Cannot insert items into an STR packed R-tree after it has been built.\"),this._itemBoundables.add(new wE(i,t))},tB.prototype.boundablesAtLevel=function(){if(arguments.length===1){var i=arguments[0],t=new QA;return this.boundablesAtLevel(i,this._root,t),t}if(arguments.length===3){var a=arguments[0],s=arguments[1],c=arguments[2];if(xA.isTrue(a>-2),s.getLevel()===a)return c.add(s),null;for(var y=s.getChildBoundables().iterator();y.hasNext();){var R=y.next();R instanceof OI?this.boundablesAtLevel(a,R,c):(xA.isTrue(R instanceof wE),a===-1&&c.add(R))}return null}},tB.prototype.query=function(){if(arguments.length===1){var i=arguments[0];this.build();var t=new QA;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,t),t}if(arguments.length===2){var a=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.query(a,this._root,s)}else if(arguments.length===3){if(m(arguments[2],kt)&&arguments[0]instanceof Object&&arguments[1]instanceof OI)for(var c=arguments[0],y=arguments[1],R=arguments[2],d=y.getChildBoundables(),f=0;fi&&(i=s)}}return i+1}},tB.prototype.createParentBoundables=function(i,t){xA.isTrue(!i.isEmpty());var a=new QA;a.add(this.createNode(t));var s=new QA(i);hE.sort(s,this.getComparator());for(var c=s.iterator();c.hasNext();){var y=c.next();this.lastNode(a).getChildBoundables().size()===this.getNodeCapacity()&&a.add(this.createNode(t)),this.lastNode(a).addChildBoundable(y)}return a},tB.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},tB.prototype.interfaces_=function(){return[A]},tB.prototype.getClass=function(){return tB},tB.compareDoubles=function(i,t){return i>t?1:i 0);for(var y=new QA,R=0;R 0;){var yA=kA.poll(),lA=yA.getDistance();if(lA>=EA)break;yA.isLeaves()?(EA=lA,aA=yA):yA.expandToQueue(kA,EA)}return[aA.getBoundable(0).getItem(),aA.getBoundable(1).getItem()]}}else if(arguments.length===3){var SA=arguments[0],mg=arguments[1],bI=arguments[2],AQ=new wE(SA,mg),Yi=new mI(this.getRoot(),AQ,bI);return this.nearestNeighbour(Yi)[0]}},t.prototype.interfaces_=function(){return[oD,A]},t.prototype.getClass=function(){return t},t.centreX=function(s){return t.avg(s.getMinX(),s.getMaxX())},t.avg=function(s,c){return(s+c)/2},t.centreY=function(s){return t.avg(s.getMinY(),s.getMaxY())},a.STRtreeNode.get=function(){return tL},a.serialVersionUID.get=function(){return 0x39920f7d5f261e0},a.xComparator.get=function(){return{interfaces_:function(){return[x]},compare:function(s,c){return i.compareDoubles(t.centreX(s.getBounds()),t.centreX(c.getBounds()))}}},a.yComparator.get=function(){return{interfaces_:function(){return[x]},compare:function(s,c){return i.compareDoubles(t.centreY(s.getBounds()),t.centreY(c.getBounds()))}}},a.intersectsOp.get=function(){return{interfaces_:function(){return[i.IntersectsOp]},intersects:function(s,c){return s.intersects(c)}}},a.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,a),t}(tB),tL=function(i){function t(){var a=arguments[0];i.call(this,a)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var a=null,s=this.getChildBoundables().iterator();s.hasNext();){var c=s.next();a===null?a=new MA(c.getBounds()):a.expandToInclude(c.getBounds())}return a},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(OI),DQ=function(){};DQ.prototype.interfaces_=function(){return[]},DQ.prototype.getClass=function(){return DQ},DQ.relativeSign=function(i,t){return i t?1:0},DQ.compare=function(i,t,a){if(t.equals2D(a))return 0;var s=DQ.relativeSign(t.x,a.x),c=DQ.relativeSign(t.y,a.y);switch(i){case 0:return DQ.compareValue(s,c);case 1:return DQ.compareValue(c,s);case 2:return DQ.compareValue(c,-s);case 3:return DQ.compareValue(-s,c);case 4:return DQ.compareValue(-s,-c);case 5:return DQ.compareValue(-c,-s);case 6:return DQ.compareValue(-c,s);case 7:return DQ.compareValue(s,-c)}return xA.shouldNeverReachHere(\"invalid octant value\"),0},DQ.compareValue=function(i,t){return i<0?-1:i>0?1:t<0?-1:t>0?1:0};var yt=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var i=arguments[0],t=arguments[1],a=arguments[2],s=arguments[3];this._segString=i,this.coord=new q(t),this.segmentIndex=a,this._segmentOctant=s,this._isInterior=!t.equals2D(i.getCoordinate(a))};yt.prototype.getCoordinate=function(){return this.coord},yt.prototype.print=function(i){i.print(this.coord),i.print(\" seg # = \"+this.segmentIndex)},yt.prototype.compareTo=function(i){var t=i;return this.segmentIndex t.segmentIndex?1:this.coord.equals2D(t.coord)?0:DQ.compare(this._segmentOctant,this.coord,t.coord)},yt.prototype.isEndPoint=function(i){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===i},yt.prototype.isInterior=function(){return this._isInterior},yt.prototype.interfaces_=function(){return[J]},yt.prototype.getClass=function(){return yt};var vB=function(){this._nodeMap=new n,this._edge=null;var i=arguments[0];this._edge=i};vB.prototype.getSplitCoordinates=function(){var i=new nA;this.addEndpoints();for(var t=this.iterator(),a=t.next();t.hasNext();){var s=t.next();this.addEdgeCoordinates(a,s,i),a=s}return i.toCoordinateArray()},vB.prototype.addCollapsedNodes=function(){var i=new QA;this.findCollapsesFromInsertedNodes(i),this.findCollapsesFromExistingVertices(i);for(var t=i.iterator();t.hasNext();){var a=t.next().intValue();this.add(this._edge.getCoordinate(a),a)}},vB.prototype.print=function(i){i.println(\"Intersections:\");for(var t=this.iterator();t.hasNext();)t.next().print(i)},vB.prototype.findCollapsesFromExistingVertices=function(i){for(var t=0;t =0?t>=0?a>=s?0:1:a>=s?7:6:t>=0?a>=s?3:2:a>=s?4:5}if(arguments[0]instanceof q&&arguments[1]instanceof q){var c=arguments[0],y=arguments[1],R=y.x-c.x,d=y.y-c.y;if(R===0&&d===0)throw new Y(\"Cannot compute the octant for two identical points \"+c);return tD.octant(R,d)}};var Ni=function(){};Ni.prototype.getCoordinates=function(){},Ni.prototype.size=function(){},Ni.prototype.getCoordinate=function(i){},Ni.prototype.isClosed=function(){},Ni.prototype.setData=function(i){},Ni.prototype.getData=function(){},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni};var Qc=function(){};Qc.prototype.addIntersection=function(i,t){},Qc.prototype.interfaces_=function(){return[Ni]},Qc.prototype.getClass=function(){return Qc};var qI=function(){this._nodeList=new vB(this),this._pts=null,this._data=null;var i=arguments[0],t=arguments[1];this._pts=i,this._data=t};qI.prototype.getCoordinates=function(){return this._pts},qI.prototype.size=function(){return this._pts.length},qI.prototype.getCoordinate=function(i){return this._pts[i]},qI.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},qI.prototype.getSegmentOctant=function(i){return i===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(i),this.getCoordinate(i+1))},qI.prototype.setData=function(i){this._data=i},qI.prototype.safeOctant=function(i,t){return i.equals2D(t)?0:tD.octant(i,t)},qI.prototype.getData=function(){return this._data},qI.prototype.addIntersection=function(){if(arguments.length===2){var i=arguments[0],t=arguments[1];this.addIntersectionNode(i,t)}else if(arguments.length===4){var a=arguments[0],s=arguments[1],c=arguments[3],y=new q(a.getIntersection(c));this.addIntersection(y,s)}},qI.prototype.toString=function(){return PI.toLineString(new BI(this._pts))},qI.prototype.getNodeList=function(){return this._nodeList},qI.prototype.addIntersectionNode=function(i,t){var a=t,s=a+1;if(s =0&&a>=0||t<=0&&a<=0?Math.max(t,a):0}if(arguments[0]instanceof q){var s=arguments[0];return hA.orientationIndex(this.p0,this.p1,s)}},qA.prototype.toGeometry=function(i){return i.createLineString([this.p0,this.p1])},qA.prototype.isVertical=function(){return this.p0.x===this.p1.x},qA.prototype.equals=function(i){if(!(i instanceof qA))return!1;var t=i;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},qA.prototype.intersection=function(i){var t=new cE;return t.computeIntersection(this.p0,this.p1,i.p0,i.p1),t.hasIntersection()?t.getIntersection(0):null},qA.prototype.project=function(){if(arguments[0]instanceof q){var i=arguments[0];if(i.equals(this.p0)||i.equals(this.p1))return new q(i);var t=this.projectionFactor(i),a=new q;return a.x=this.p0.x+t*(this.p1.x-this.p0.x),a.y=this.p0.y+t*(this.p1.y-this.p0.y),a}if(arguments[0]instanceof qA){var s=arguments[0],c=this.projectionFactor(s.p0),y=this.projectionFactor(s.p1);if(c>=1&&y>=1||c<=0&&y<=0)return null;var R=this.project(s.p0);c<0&&(R=this.p0),c>1&&(R=this.p1);var d=this.project(s.p1);return y<0&&(d=this.p0),y>1&&(d=this.p1),new qA(R,d)}},qA.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},qA.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},qA.prototype.getCoordinate=function(i){return i===0?this.p0:this.p1},qA.prototype.distancePerpendicular=function(i){return hA.distancePointLinePerpendicular(i,this.p0,this.p1)},qA.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},qA.prototype.midPoint=function(){return qA.midPoint(this.p0,this.p1)},qA.prototype.projectionFactor=function(i){if(i.equals(this.p0))return 0;if(i.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,a=this.p1.y-this.p0.y,s=t*t+a*a;return s<=0?M.NaN:((i.x-this.p0.x)*t+(i.y-this.p0.y)*a)/s},qA.prototype.closestPoints=function(i){var t=this.intersection(i);if(t!==null)return[t,t];var a=new Array(2).fill(null),s=M.MAX_VALUE,c=null,y=this.closestPoint(i.p0);s=y.distance(i.p0),a[0]=y,a[1]=i.p0;var R=this.closestPoint(i.p1);(c=R.distance(i.p1)) 0&&t<1?this.project(i):this.p0.distance(i)1||M.isNaN(t))&&(t=1),t},qA.prototype.toString=function(){return\"LINESTRING( \"+this.p0.x+\" \"+this.p0.y+\", \"+this.p1.x+\" \"+this.p1.y+\")\"},qA.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},qA.prototype.distance=function(){if(arguments[0]instanceof qA){var i=arguments[0];return hA.distanceLineLine(this.p0,this.p1,i.p0,i.p1)}if(arguments[0]instanceof q){var t=arguments[0];return hA.distancePointLine(t,this.p0,this.p1)}},qA.prototype.pointAlong=function(i){var t=new q;return t.x=this.p0.x+i*(this.p1.x-this.p0.x),t.y=this.p0.y+i*(this.p1.y-this.p0.y),t},qA.prototype.hashCode=function(){var i=M.doubleToLongBits(this.p0.x);i^=31*M.doubleToLongBits(this.p0.y);var t=Math.trunc(i)^Math.trunc(i>>32),a=M.doubleToLongBits(this.p1.x);return a^=31*M.doubleToLongBits(this.p1.y),t^(Math.trunc(a)^Math.trunc(a>>32))},qA.prototype.interfaces_=function(){return[J,A]},qA.prototype.getClass=function(){return qA},qA.midPoint=function(i,t){return new q((i.x+t.x)/2,(i.y+t.y)/2)},eL.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(qA,eL);var Cc=function(){this.tempEnv1=new MA,this.tempEnv2=new MA,this._overlapSeg1=new qA,this._overlapSeg2=new qA};Cc.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var i=arguments[0],t=arguments[1],a=arguments[2],s=arguments[3];i.getLineSegment(t,this._overlapSeg1),a.getLineSegment(s,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc};var UQ=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var i=arguments[0],t=arguments[1],a=arguments[2],s=arguments[3];this._pts=i,this._start=t,this._end=a,this._context=s};UQ.prototype.getLineSegment=function(i,t){t.p0=this._pts[i],t.p1=this._pts[i+1]},UQ.prototype.computeSelect=function(i,t,a,s){var c=this._pts[t],y=this._pts[a];if(s.tempEnv1.init(c,y),a-t==1)return s.select(this,t),null;if(!i.intersects(s.tempEnv1))return null;var R=Math.trunc((t+a)/2);t =i.length-1)return i.length-1;for(var s=Tg.quadrant(i[a],i[a+1]),c=t+1;c y.getId()&&(y.computeOverlaps(d,s),this._nOverlaps++),this._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},a.SegmentOverlapAction.get=function(){return aL},Object.defineProperties(t,a),t}(Ec),aL=function(i){function t(){i.call(this),this._si=null;var a=arguments[0];this._si=a}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length!==4)return i.prototype.overlap.apply(this,arguments);var a=arguments[0],s=arguments[1],c=arguments[2],y=arguments[3],R=a.getContext(),d=c.getContext();this._si.processIntersections(R,s,d,y)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Cc),Ug=function i(){if(this._quadrantSegments=i.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=i.CAP_ROUND,this._joinStyle=i.JOIN_ROUND,this._mitreLimit=i.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=i.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var a=arguments[0],s=arguments[1];this.setQuadrantSegments(a),this.setEndCapStyle(s)}else if(arguments.length===4){var c=arguments[0],y=arguments[1],R=arguments[2],d=arguments[3];this.setQuadrantSegments(c),this.setEndCapStyle(y),this.setJoinStyle(R),this.setMitreLimit(d)}}},Fo={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Ug.prototype.getEndCapStyle=function(){return this._endCapStyle},Ug.prototype.isSingleSided=function(){return this._isSingleSided},Ug.prototype.setQuadrantSegments=function(i){this._quadrantSegments=i,this._quadrantSegments===0&&(this._joinStyle=Ug.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Ug.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),i<=0&&(this._quadrantSegments=1),this._joinStyle!==Ug.JOIN_ROUND&&(this._quadrantSegments=Ug.DEFAULT_QUADRANT_SEGMENTS)},Ug.prototype.getJoinStyle=function(){return this._joinStyle},Ug.prototype.setJoinStyle=function(i){this._joinStyle=i},Ug.prototype.setSimplifyFactor=function(i){this._simplifyFactor=i<0?0:i},Ug.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Ug.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Ug.prototype.setEndCapStyle=function(i){this._endCapStyle=i},Ug.prototype.getMitreLimit=function(){return this._mitreLimit},Ug.prototype.setMitreLimit=function(i){this._mitreLimit=i},Ug.prototype.setSingleSided=function(i){this._isSingleSided=i},Ug.prototype.interfaces_=function(){return[]},Ug.prototype.getClass=function(){return Ug},Ug.bufferDistanceError=function(i){var t=Math.PI/2/i;return 1-Math.cos(t/2)},Fo.CAP_ROUND.get=function(){return 1},Fo.CAP_FLAT.get=function(){return 2},Fo.CAP_SQUARE.get=function(){return 3},Fo.JOIN_ROUND.get=function(){return 1},Fo.JOIN_MITRE.get=function(){return 2},Fo.JOIN_BEVEL.get=function(){return 3},Fo.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Fo.DEFAULT_MITRE_LIMIT.get=function(){return 5},Fo.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Ug,Fo);var FI=function(i){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=hA.COUNTERCLOCKWISE,this._inputLine=i||null},ic={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};FI.prototype.isDeletable=function(i,t,a,s){var c=this._inputLine[i],y=this._inputLine[t],R=this._inputLine[a];return!!this.isConcave(c,y,R)&&!!this.isShallow(c,y,R,s)&&this.isShallowSampled(c,y,i,a,s)},FI.prototype.deleteShallowConcavities=function(){for(var i=1,t=this.findNextNonDeletedIndex(i),a=this.findNextNonDeletedIndex(t),s=!1;a =0;s--)this.addPt(i[s])},$Q.prototype.isRedundant=function(i){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1);return i.distance(t) Math.PI;)i-=Fg.PI_TIMES_2;for(;i<=-Math.PI;)i+=Fg.PI_TIMES_2;return i},Fg.angle=function(){if(arguments.length===1){var i=arguments[0];return Math.atan2(i.y,i.x)}if(arguments.length===2){var t=arguments[0],a=arguments[1],s=a.x-t.x,c=a.y-t.y;return Math.atan2(c,s)}},Fg.isAcute=function(i,t,a){var s=i.x-t.x,c=i.y-t.y;return s*(a.x-t.x)+c*(a.y-t.y)>0},Fg.isObtuse=function(i,t,a){var s=i.x-t.x,c=i.y-t.y;return s*(a.x-t.x)+c*(a.y-t.y)<0},Fg.interiorAngle=function(i,t,a){var s=Fg.angle(t,i),c=Fg.angle(t,a);return Math.abs(c-s)},Fg.normalizePositive=function(i){if(i<0){for(;i<0;)i+=Fg.PI_TIMES_2;i>=Fg.PI_TIMES_2&&(i=0)}else{for(;i>=Fg.PI_TIMES_2;)i-=Fg.PI_TIMES_2;i<0&&(i=0)}return i},Fg.angleBetween=function(i,t,a){var s=Fg.angle(t,i),c=Fg.angle(t,a);return Fg.diff(s,c)},Fg.diff=function(i,t){var a=null;return(a=i Math.PI&&(a=2*Math.PI-a),a},Fg.toRadians=function(i){return i*Math.PI/180},Fg.getTurn=function(i,t){var a=Math.sin(t-i);return a>0?Fg.COUNTERCLOCKWISE:a<0?Fg.CLOCKWISE:Fg.NONE},Fg.angleBetweenOriented=function(i,t,a){var s=Fg.angle(t,i),c=Fg.angle(t,a)-s;return c<=-Math.PI?c+Fg.PI_TIMES_2:c>Math.PI?c-Fg.PI_TIMES_2:c},eD.PI_TIMES_2.get=function(){return 2*Math.PI},eD.PI_OVER_2.get=function(){return Math.PI/2},eD.PI_OVER_4.get=function(){return Math.PI/4},eD.COUNTERCLOCKWISE.get=function(){return hA.COUNTERCLOCKWISE},eD.CLOCKWISE.get=function(){return hA.CLOCKWISE},eD.NONE.get=function(){return hA.COLLINEAR},Object.defineProperties(Fg,eD);var EI=function i(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new qA,this._seg1=new qA,this._offset0=new qA,this._offset1=new qA,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],a=arguments[1],s=arguments[2];this._precisionModel=t,this._bufParams=a,this._li=new cE,this._filletAngleQuantum=Math.PI/2/a.getQuadrantSegments(),a.getQuadrantSegments()>=8&&a.getJoinStyle()===Ug.JOIN_ROUND&&(this._closingSegLengthFactor=i.MAX_CLOSING_SEG_LEN_FACTOR),this.init(s)},oc={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};EI.prototype.addNextSegment=function(i,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=i,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var a=hA.computeOrientation(this._s0,this._s1,this._s2),s=a===hA.CLOCKWISE&&this._side===u.LEFT||a===hA.COUNTERCLOCKWISE&&this._side===u.RIGHT;a===0?this.addCollinear(t):s?this.addOutsideTurn(a,t):this.addInsideTurn(a,t)},EI.prototype.addLineEndCap=function(i,t){var a=new qA(i,t),s=new qA;this.computeOffsetSegment(a,u.LEFT,this._distance,s);var c=new qA;this.computeOffsetSegment(a,u.RIGHT,this._distance,c);var y=t.x-i.x,R=t.y-i.y,d=Math.atan2(R,y);switch(this._bufParams.getEndCapStyle()){case Ug.CAP_ROUND:this._segList.addPt(s.p1),this.addFilletArc(t,d+Math.PI/2,d-Math.PI/2,hA.CLOCKWISE,this._distance),this._segList.addPt(c.p1);break;case Ug.CAP_FLAT:this._segList.addPt(s.p1),this._segList.addPt(c.p1);break;case Ug.CAP_SQUARE:var f=new q;f.x=Math.abs(this._distance)*Math.cos(d),f.y=Math.abs(this._distance)*Math.sin(d);var v=new q(s.p1.x+f.x,s.p1.y+f.y),EA=new q(c.p1.x+f.x,c.p1.y+f.y);this._segList.addPt(v),this._segList.addPt(EA)}},EI.prototype.getCoordinates=function(){return this._segList.getCoordinates()},EI.prototype.addMitreJoin=function(i,t,a,s){var c=!0,y=null;try{y=vg.intersection(t.p0,t.p1,a.p0,a.p1),(s<=0?1:y.distance(i)/Math.abs(s))>this._bufParams.getMitreLimit()&&(c=!1)}catch(R){if(!(R instanceof YQ))throw R;y=new q(0,0),c=!1}c?this._segList.addPt(y):this.addLimitedMitreJoin(t,a,s,this._bufParams.getMitreLimit())},EI.prototype.addFilletCorner=function(i,t,a,s,c){var y=t.x-i.x,R=t.y-i.y,d=Math.atan2(R,y),f=a.x-i.x,v=a.y-i.y,EA=Math.atan2(v,f);s===hA.CLOCKWISE?d<=EA&&(d+=2*Math.PI):d>=EA&&(d-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(i,d,EA,s,c),this._segList.addPt(a)},EI.prototype.addOutsideTurn=function(i,t){if(this._offset0.p1.distance(this._offset1.p0) 0){var a=new q((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(a);var s=new q((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(s)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},EI.prototype.createCircle=function(i){var t=new q(i.x+this._distance,i.y);this._segList.addPt(t),this.addFilletArc(i,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},EI.prototype.addBevelJoin=function(i,t){this._segList.addPt(i.p1),this._segList.addPt(t.p0)},EI.prototype.init=function(i){this._distance=i,this._maxCurveSegmentError=i*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new $Q,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(i*EI.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},EI.prototype.addCollinear=function(i){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Ug.JOIN_BEVEL||this._bufParams.getJoinStyle()===Ug.JOIN_MITRE?(i&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,hA.CLOCKWISE,this._distance))},EI.prototype.closeRing=function(){this._segList.closeRing()},EI.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},EI.prototype.interfaces_=function(){return[]},EI.prototype.getClass=function(){return EI},oc.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},oc.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},oc.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},oc.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(EI,oc);var sQ=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var i=arguments[0],t=arguments[1];this._precisionModel=i,this._bufParams=t};sQ.prototype.getOffsetCurve=function(i,t){if(this._distance=t,t===0)return null;var a=t<0,s=Math.abs(t),c=this.getSegGen(s);i.length<=1?this.computePointCurve(i[0],c):this.computeOffsetCurve(i,a,c);var y=c.getCoordinates();return a&&sA.reverse(y),y},sQ.prototype.computeSingleSidedBufferCurve=function(i,t,a){var s=this.simplifyTolerance(this._distance);if(t){a.addSegments(i,!0);var c=FI.simplify(i,-s),y=c.length-1;a.initSideSegments(c[y],c[y-1],u.LEFT),a.addFirstSegment();for(var R=y-2;R>=0;R--)a.addNextSegment(c[R],!0)}else{a.addSegments(i,!1);var d=FI.simplify(i,s),f=d.length-1;a.initSideSegments(d[0],d[1],u.LEFT),a.addFirstSegment();for(var v=2;v<=f;v++)a.addNextSegment(d[v],!0)}a.addLastSegment(),a.closeRing()},sQ.prototype.computeRingBufferCurve=function(i,t,a){var s=this.simplifyTolerance(this._distance);t===u.RIGHT&&(s=-s);var c=FI.simplify(i,s),y=c.length-1;a.initSideSegments(c[y-1],c[0],t);for(var R=1;R<=y;R++){var d=R!==1;a.addNextSegment(c[R],d)}a.closeRing()},sQ.prototype.computeLineBufferCurve=function(i,t){var a=this.simplifyTolerance(this._distance),s=FI.simplify(i,a),c=s.length-1;t.initSideSegments(s[0],s[1],u.LEFT);for(var y=2;y<=c;y++)t.addNextSegment(s[y],!0);t.addLastSegment(),t.addLineEndCap(s[c-1],s[c]);var R=FI.simplify(i,-a),d=R.length-1;t.initSideSegments(R[d],R[d-1],u.LEFT);for(var f=d-2;f>=0;f--)t.addNextSegment(R[f],!0);t.addLastSegment(),t.addLineEndCap(R[1],R[0]),t.closeRing()},sQ.prototype.computePointCurve=function(i,t){switch(this._bufParams.getEndCapStyle()){case Ug.CAP_ROUND:t.createCircle(i);break;case Ug.CAP_SQUARE:t.createSquare(i)}},sQ.prototype.getLineCurve=function(i,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var a=Math.abs(t),s=this.getSegGen(a);if(i.length<=1)this.computePointCurve(i[0],s);else if(this._bufParams.isSingleSided()){var c=t<0;this.computeSingleSidedBufferCurve(i,c,s)}else this.computeLineBufferCurve(i,s);return s.getCoordinates()},sQ.prototype.getBufferParameters=function(){return this._bufParams},sQ.prototype.simplifyTolerance=function(i){return i*this._bufParams.getSimplifyFactor()},sQ.prototype.getRingCurve=function(i,t,a){if(this._distance=a,i.length<=2)return this.getLineCurve(i,a);if(a===0)return sQ.copyCoordinates(i);var s=this.getSegGen(a);return this.computeRingBufferCurve(i,t,s),s.getCoordinates()},sQ.prototype.computeOffsetCurve=function(i,t,a){var s=this.simplifyTolerance(this._distance);if(t){var c=FI.simplify(i,-s),y=c.length-1;a.initSideSegments(c[y],c[y-1],u.LEFT),a.addFirstSegment();for(var R=y-2;R>=0;R--)a.addNextSegment(c[R],!0)}else{var d=FI.simplify(i,s),f=d.length-1;a.initSideSegments(d[0],d[1],u.LEFT),a.addFirstSegment();for(var v=2;v<=f;v++)a.addNextSegment(d[v],!0)}a.addLastSegment()},sQ.prototype.getSegGen=function(i){return new EI(this._precisionModel,this._bufParams,i)},sQ.prototype.interfaces_=function(){return[]},sQ.prototype.getClass=function(){return sQ},sQ.copyCoordinates=function(i){for(var t=new Array(i.length).fill(null),a=0;a c.getMaxY()||this.findStabbedSegments(i,s.getDirectedEdges(),t)}return t}if(arguments.length===3){if(m(arguments[2],DA)&&arguments[0]instanceof q&&arguments[1]instanceof jl){for(var y=arguments[0],R=arguments[1],d=arguments[2],f=R.getEdge().getCoordinates(),v=0;v this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x) this._seg.p1.y||hA.computeOrientation(this._seg.p0,this._seg.p1,y)===hA.RIGHT)){var EA=R.getDepth(u.LEFT);this._seg.p0.equals(f[v])||(EA=R.getDepth(u.RIGHT));var aA=new Te(this._seg,EA);d.add(aA)}}else if(m(arguments[2],DA)&&arguments[0]instanceof q&&m(arguments[1],DA))for(var kA=arguments[0],yA=arguments[1],lA=arguments[2],SA=yA.iterator();SA.hasNext();){var mg=SA.next();mg.isForward()&&this.findStabbedSegments(kA,mg,lA)}}},aD.prototype.getDepth=function(i){var t=this.findStabbedSegments(i);return t.size()===0?0:hE.min(t)._leftDepth},aD.prototype.interfaces_=function(){return[]},aD.prototype.getClass=function(){return aD},sL.DepthSegment.get=function(){return Te},Object.defineProperties(aD,sL);var Te=function(){this._upwardSeg=null,this._leftDepth=null;var i=arguments[0],t=arguments[1];this._upwardSeg=new qA(i),this._leftDepth=t};Te.prototype.compareTo=function(i){var t=i;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var a=this._upwardSeg.orientationIndex(t._upwardSeg);return a!==0||(a=-1*t._upwardSeg.orientationIndex(this._upwardSeg))!=0?a:this._upwardSeg.compareTo(t._upwardSeg)},Te.prototype.compareX=function(i,t){var a=i.p0.compareTo(t.p0);return a!==0?a:i.p1.compareTo(t.p1)},Te.prototype.toString=function(){return this._upwardSeg.toString()},Te.prototype.interfaces_=function(){return[J]},Te.prototype.getClass=function(){return Te};var Sg=function(i,t,a){this.p0=i||null,this.p1=t||null,this.p2=a||null};Sg.prototype.area=function(){return Sg.area(this.p0,this.p1,this.p2)},Sg.prototype.signedArea=function(){return Sg.signedArea(this.p0,this.p1,this.p2)},Sg.prototype.interpolateZ=function(i){if(i===null)throw new Y(\"Supplied point is null.\");return Sg.interpolateZ(i,this.p0,this.p1,this.p2)},Sg.prototype.longestSideLength=function(){return Sg.longestSideLength(this.p0,this.p1,this.p2)},Sg.prototype.isAcute=function(){return Sg.isAcute(this.p0,this.p1,this.p2)},Sg.prototype.circumcentre=function(){return Sg.circumcentre(this.p0,this.p1,this.p2)},Sg.prototype.area3D=function(){return Sg.area3D(this.p0,this.p1,this.p2)},Sg.prototype.centroid=function(){return Sg.centroid(this.p0,this.p1,this.p2)},Sg.prototype.inCentre=function(){return Sg.inCentre(this.p0,this.p1,this.p2)},Sg.prototype.interfaces_=function(){return[]},Sg.prototype.getClass=function(){return Sg},Sg.area=function(i,t,a){return Math.abs(((a.x-i.x)*(t.y-i.y)-(t.x-i.x)*(a.y-i.y))/2)},Sg.signedArea=function(i,t,a){return((a.x-i.x)*(t.y-i.y)-(t.x-i.x)*(a.y-i.y))/2},Sg.det=function(i,t,a,s){return i*s-t*a},Sg.interpolateZ=function(i,t,a,s){var c=t.x,y=t.y,R=a.x-c,d=s.x-c,f=a.y-y,v=s.y-y,EA=R*v-d*f,aA=i.x-c,kA=i.y-y,yA=(v*aA-d*kA)/EA,lA=(-f*aA+R*kA)/EA;return t.z+yA*(a.z-t.z)+lA*(s.z-t.z)},Sg.longestSideLength=function(i,t,a){var s=i.distance(t),c=t.distance(a),y=a.distance(i),R=s;return c>R&&(R=c),y>R&&(R=y),R},Sg.isAcute=function(i,t,a){return!!Fg.isAcute(i,t,a)&&!!Fg.isAcute(t,a,i)&&!!Fg.isAcute(a,i,t)},Sg.circumcentre=function(i,t,a){var s=a.x,c=a.y,y=i.x-s,R=i.y-c,d=t.x-s,f=t.y-c,v=2*Sg.det(y,R,d,f),EA=Sg.det(R,y*y+R*R,f,d*d+f*f),aA=Sg.det(y,y*y+R*R,d,d*d+f*f);return new q(s-EA/v,c+aA/v)},Sg.perpendicularBisector=function(i,t){var a=t.x-i.x,s=t.y-i.y,c=new vg(i.x+a/2,i.y+s/2,1),y=new vg(i.x-s+a/2,i.y+a+s/2,1);return new vg(c,y)},Sg.angleBisector=function(i,t,a){var s=t.distance(i),c=s/(s+t.distance(a)),y=a.x-i.x,R=a.y-i.y;return new q(i.x+c*y,i.y+c*R)},Sg.area3D=function(i,t,a){var s=t.x-i.x,c=t.y-i.y,y=t.z-i.z,R=a.x-i.x,d=a.y-i.y,f=a.z-i.z,v=c*f-y*d,EA=y*R-s*f,aA=s*d-c*R,kA=v*v+EA*EA+aA*aA,yA=Math.sqrt(kA)/2;return yA},Sg.centroid=function(i,t,a){var s=(i.x+t.x+a.x)/3,c=(i.y+t.y+a.y)/3;return new q(s,c)},Sg.inCentre=function(i,t,a){var s=t.distance(a),c=i.distance(a),y=i.distance(t),R=s+c+y,d=(s*i.x+c*t.x+y*a.x)/R,f=(s*i.y+c*t.y+y*a.y)/R;return new q(d,f)};var XC=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new QA;var i=arguments[0],t=arguments[1],a=arguments[2];this._inputGeom=i,this._distance=t,this._curveBuilder=a};XC.prototype.addPoint=function(i){if(this._distance<=0)return null;var t=i.getCoordinates(),a=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(a,L.EXTERIOR,L.INTERIOR)},XC.prototype.addPolygon=function(i){var t=this._distance,a=u.LEFT;this._distance<0&&(t=-this._distance,a=u.RIGHT);var s=i.getExteriorRing(),c=sA.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&c.length<3)return null;this.addPolygonRing(c,t,a,L.EXTERIOR,L.INTERIOR);for(var y=0;y 0&&this.isErodedCompletely(R,-this._distance)||this.addPolygonRing(d,t,u.opposite(a),L.INTERIOR,L.EXTERIOR)}},XC.prototype.isTriangleErodedCompletely=function(i,t){var a=new Sg(i[0],i[1],i[2]),s=a.inCentre();return hA.distancePointLine(s,a.p0,a.p1) =GB.MINIMUM_VALID_SIZE&&hA.isCCW(i)&&(y=c,R=s,a=u.opposite(a));var d=this._curveBuilder.getRingCurve(i,a,t);this.addCurve(d,y,R)},XC.prototype.add=function(i){if(i.isEmpty())return null;i instanceof Hg?this.addPolygon(i):i instanceof II?this.addLineString(i):i instanceof VB?this.addPoint(i):i instanceof GE?this.addCollection(i):i instanceof eQ?this.addCollection(i):i instanceof oB?this.addCollection(i):i instanceof Xg&&this.addCollection(i)},XC.prototype.isErodedCompletely=function(i,t){var a=i.getCoordinates();if(a.length<4)return t<0;if(a.length===4)return this.isTriangleErodedCompletely(a,t);var s=i.getEnvelopeInternal(),c=Math.min(s.getHeight(),s.getWidth());return t<0&&2*Math.abs(t)>c},XC.prototype.addCollection=function(i){for(var t=0;t =this._max)throw new B;var i=this._parent.getGeometryN(this._index++);return i instanceof Xg?(this._subcollectionIterator=new ki(i),this._subcollectionIterator.next()):i},ki.prototype.remove=function(){throw new Error(this.getClass().getName())},ki.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},ki.prototype.interfaces_=function(){return[rA]},ki.prototype.getClass=function(){return ki},ki.isAtomic=function(i){return!(i instanceof Xg)};var AC=function(){this._geom=null;var i=arguments[0];this._geom=i};AC.prototype.locate=function(i){return AC.locate(i,this._geom)},AC.prototype.interfaces_=function(){return[Ls]},AC.prototype.getClass=function(){return AC},AC.isPointInRing=function(i,t){return!!t.getEnvelopeInternal().intersects(i)&&hA.isPointInRing(i,t.getCoordinates())},AC.containsPointInPolygon=function(i,t){if(t.isEmpty())return!1;var a=t.getExteriorRing();if(!AC.isPointInRing(i,a))return!1;for(var s=0;s =0;c--){var y=this._edgeList.get(c),R=y.getSym();s===null&&(s=R),a!==null&&R.setNext(a),a=y}s.setNext(a)},t.prototype.computeDepths=function(){if(arguments.length===1){var a=arguments[0],s=this.findIndex(a),c=a.getDepth(u.LEFT),y=a.getDepth(u.RIGHT),R=this.computeDepths(s+1,this._edgeList.size(),c);if(this.computeDepths(0,s,R)!==y)throw new RA(\"depth mismatch at \"+a.getCoordinate())}else if(arguments.length===3){for(var d=arguments[0],f=arguments[1],v=arguments[2],EA=d;EA =0;R--){var d=this._resultAreaEdgeList.get(R),f=d.getSym();switch(s===null&&d.getEdgeRing()===a&&(s=d),y){case this._SCANNING_FOR_INCOMING:if(f.getEdgeRing()!==a)continue;c=f,y=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(d.getEdgeRing()!==a)continue;c.setNextMin(d),y=this._SCANNING_FOR_INCOMING}}y===this._LINKING_TO_OUTGOING&&(xA.isTrue(s!==null,\"found null for first outgoing dirEdge\"),xA.isTrue(s.getEdgeRing()===a,\"unable to link last incoming dirEdge\"),c.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var a=0,s=this.iterator();s.hasNext();)s.next().isInResult()&&a++;return a}if(arguments.length===1){for(var c=arguments[0],y=0,R=this.iterator();R.hasNext();)R.next().getEdgeRing()===c&&y++;return y}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var a=L.NONE,s=this.iterator();s.hasNext();){var c=s.next(),y=c.getSym();if(!c.isLineEdge()){if(c.isInResult()){a=L.INTERIOR;break}if(y.isInResult()){a=L.EXTERIOR;break}}}if(a===L.NONE)return null;for(var R=a,d=this.iterator();d.hasNext();){var f=d.next(),v=f.getSym();f.isLineEdge()?f.getEdge().setCovered(R===L.INTERIOR):(f.isInResult()&&(R=L.EXTERIOR),v.isInResult()&&(R=L.INTERIOR))}},t.prototype.computeLabelling=function(a){i.prototype.computeLabelling.call(this,a),this._label=new XA(L.NONE);for(var s=this.iterator();s.hasNext();)for(var c=s.next().getEdge().getLabel(),y=0;y<2;y++){var R=c.getLocation(y);R!==L.INTERIOR&&R!==L.BOUNDARY||this._label.setLocation(y,L.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(HB),rL=function(i){function t(){i.apply(this,arguments)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.createNode=function(a){return new gN(a,new wv)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ds),Ft=function i(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=i.orientation(t)};Ft.prototype.compareTo=function(i){var t=i;return Ft.compareOriented(this._pts,this._orientation,t._pts,t._orientation)},Ft.prototype.interfaces_=function(){return[J]},Ft.prototype.getClass=function(){return Ft},Ft.orientation=function(i){return sA.increasingDirection(i)===1},Ft.compareOriented=function(i,t,a,s){for(var c=t?1:-1,y=s?1:-1,R=t?i.length:-1,d=s?a.length:-1,f=t?0:i.length-1,v=s?0:a.length-1;;){var EA=i[f].compareTo(a[v]);if(EA!==0)return EA;var aA=(f+=c)===R,kA=(v+=y)===d;if(aA&&!kA)return-1;if(!aA&&kA)return 1;if(aA&&kA)return 0}};var NE=function(){this._edges=new QA,this._ocaMap=new n};NE.prototype.print=function(i){i.print(\"MULTILINESTRING ( \");for(var t=0;t 0&&i.print(\",\"),i.print(\"(\");for(var s=a.getCoordinates(),c=0;c 0&&i.print(\",\"),i.print(s[c].x+\" \"+s[c].y);i.println(\")\")}i.print(\") \")},NE.prototype.addAll=function(i){for(var t=i.iterator();t.hasNext();)this.add(t.next())},NE.prototype.findEdgeIndex=function(i){for(var t=0;t i?1:this.dist t?1:0},ZE.prototype.interfaces_=function(){return[J]},ZE.prototype.getClass=function(){return ZE};var yi=function(){this._nodeMap=new n,this.edge=null;var i=arguments[0];this.edge=i};yi.prototype.print=function(i){i.println(\"Intersections:\");for(var t=this.iterator();t.hasNext();)t.next().print(i)},yi.prototype.iterator=function(){return this._nodeMap.values().iterator()},yi.prototype.addSplitEdges=function(i){this.addEndpoints();for(var t=this.iterator(),a=t.next();t.hasNext();){var s=t.next(),c=this.createSplitEdge(a,s);i.add(c),a=s}},yi.prototype.addEndpoints=function(){var i=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[i],i,0)},yi.prototype.createSplitEdge=function(i,t){var a=t.segmentIndex-i.segmentIndex+2,s=this.edge.pts[t.segmentIndex],c=t.dist>0||!t.coord.equals2D(s);c||a--;var y=new Array(a).fill(null),R=0;y[R++]=new q(i.coord);for(var d=i.segmentIndex+1;d<=t.segmentIndex;d++)y[R++]=this.edge.pts[d];return c&&(y[R]=t.coord),new BN(y,new XA(this.edge._label))},yi.prototype.add=function(i,t,a){var s=new ZE(i,t,a),c=this._nodeMap.get(s);return c!==null?c:(this._nodeMap.put(s,s),s)},yi.prototype.isIntersection=function(i){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(i))return!0;return!1},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var Ze=function(){};Ze.prototype.getChainStartIndices=function(i){var t=0,a=new QA;a.add(new FA(t));do{var s=this.findChainEnd(i,t);a.add(new FA(s)),t=s}while(t a?t:a},Ro.prototype.getMinX=function(i){var t=this.pts[this.startIndex[i]].x,a=this.pts[this.startIndex[i+1]].x;return tt&&(s=1),this._depth[i][a]=s}}},hB.prototype.getDelta=function(i){return this._depth[i][u.RIGHT]-this._depth[i][u.LEFT]},hB.prototype.getLocation=function(i,t){return this._depth[i][t]<=0?L.EXTERIOR:L.INTERIOR},hB.prototype.toString=function(){return\"A: \"+this._depth[0][1]+\",\"+this._depth[0][2]+\" B: \"+this._depth[1][1]+\",\"+this._depth[1][2]},hB.prototype.add=function(){if(arguments.length===1)for(var i=arguments[0],t=0;t<2;t++)for(var a=1;a<3;a++){var s=i.getLocation(t,a);s!==L.EXTERIOR&&s!==L.INTERIOR||(this.isNull(t,a)?this._depth[t][a]=hB.depthAtLocation(s):this._depth[t][a]+=hB.depthAtLocation(s))}else if(arguments.length===3){var c=arguments[0],y=arguments[1];arguments[2]===L.INTERIOR&&this._depth[c][y]++}},hB.prototype.interfaces_=function(){return[]},hB.prototype.getClass=function(){return hB},hB.depthAtLocation=function(i){return i===L.EXTERIOR?0:i===L.INTERIOR?1:hB.NULL_VALUE},nL.NULL_VALUE.get=function(){return-1},Object.defineProperties(hB,nL);var BN=function(i){function t(){if(i.call(this),this.pts=null,this._env=null,this.eiList=new yi(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new hB,this._depthDelta=0,arguments.length===1){var a=arguments[0];t.call(this,a,null)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.pts=s,this._label=c}}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var a=new Array(2).fill(null);return a[0]=this.pts[0],a[1]=this.pts[1],new t(a,XA.toLineLabel(this._label))},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(a){this._isIsolated=a},t.prototype.setName=function(a){this._name=a},t.prototype.equals=function(a){if(!(a instanceof t))return!1;var s=a;if(this.pts.length!==s.pts.length)return!1;for(var c=!0,y=!0,R=this.pts.length,d=0;d 0?this.pts[0]:null;if(arguments.length===1){var a=arguments[0];return this.pts[a]}},t.prototype.print=function(a){a.print(\"edge \"+this._name+\": \"),a.print(\"LINESTRING (\");for(var s=0;s 0&&a.print(\",\"),a.print(this.pts[s].x+\" \"+this.pts[s].y);a.print(\") \"+this._label+\" \"+this._depthDelta)},t.prototype.computeIM=function(a){t.updateIM(this._label,a)},t.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(a){a.print(\"edge \"+this._name+\": \");for(var s=this.pts.length-1;s>=0;s--)a.print(this.pts[s]+\" \");a.println(\"\")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ro(this)),this._mce},t.prototype.getEnvelope=function(){if(this._env===null){this._env=new MA;for(var a=0;a 0&&a.append(\",\"),a.append(this.pts[s].x+\" \"+this.pts[s].y);return a.append(\") \"+this._label+\" \"+this._depthDelta),a.toString()},t.prototype.isPointwiseEqual=function(a){if(this.pts.length!==a.pts.length)return!1;for(var s=0;s s||this._maxy y;if(R)return!1;var d=this.intersectsToleranceSquare(i,t);return xA.isTrue(!(R&&d),\"Found bad envelope test\"),d},rQ.prototype.initCorners=function(i){this._minx=i.x-.5,this._maxx=i.x+.5,this._miny=i.y-.5,this._maxy=i.y+.5,this._corner[0]=new q(this._maxx,this._maxy),this._corner[1]=new q(this._minx,this._maxy),this._corner[2]=new q(this._minx,this._miny),this._corner[3]=new q(this._maxx,this._miny)},rQ.prototype.intersects=function(i,t){return this._scaleFactor===1?this.intersectsScaled(i,t):(this.copyScaled(i,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},rQ.prototype.scale=function(i){return Math.round(i*this._scaleFactor)},rQ.prototype.getCoordinate=function(){return this._originalPt},rQ.prototype.copyScaled=function(i,t){t.x=this.scale(i.x),t.y=this.scale(i.y)},rQ.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var i=rQ.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new MA(this._originalPt.x-i,this._originalPt.x+i,this._originalPt.y-i,this._originalPt.y+i)}return this._safeEnv},rQ.prototype.intersectsPixelClosure=function(i,t){return this._li.computeIntersection(i,t,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(i,t,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(i,t,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(i,t,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},rQ.prototype.intersectsToleranceSquare=function(i,t){var a=!1,s=!1;return this._li.computeIntersection(i,t,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(i,t,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(a=!0),this._li.computeIntersection(i,t,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(s=!0),this._li.computeIntersection(i,t,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!a||!s)||!!i.equals(this._pt)||!!t.equals(this._pt))))},rQ.prototype.addSnappedNode=function(i,t){var a=i.getCoordinate(t),s=i.getCoordinate(t+1);return!!this.intersects(a,s)&&(i.addIntersection(this.getCoordinate(),t),!0)},rQ.prototype.interfaces_=function(){return[]},rQ.prototype.getClass=function(){return rQ},GL.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(rQ,GL);var tc=function(){this.tempEnv1=new MA,this.selectedSegment=new qA};tc.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var i=arguments[0],t=arguments[1];i.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}},tc.prototype.interfaces_=function(){return[]},tc.prototype.getClass=function(){return tc};var Hs=function(){this._index=null;var i=arguments[0];this._index=i},wL={HotPixelSnapAction:{configurable:!0}};Hs.prototype.snap=function(){if(arguments.length===1){var i=arguments[0];return this.snap(i,null,-1)}if(arguments.length===3){var t=arguments[0],a=arguments[1],s=arguments[2],c=t.getSafeEnvelope(),y=new hL(t,a,s);return this._index.query(c,{interfaces_:function(){return[kt]},visitItem:function(R){R.select(c,y)}}),y.isNodeAdded()}},Hs.prototype.interfaces_=function(){return[]},Hs.prototype.getClass=function(){return Hs},wL.HotPixelSnapAction.get=function(){return hL},Object.defineProperties(Hs,wL);var hL=function(i){function t(){i.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var a=arguments[0],s=arguments[1],c=arguments[2];this._hotPixel=a,this._parentEdge=s,this._hotPixelVertexIndex=c}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length!==2)return i.prototype.select.apply(this,arguments);var a=arguments[0],s=arguments[1],c=a.getContext();if(this._parentEdge!==null&&c===this._parentEdge&&s===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(c,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(tc),DD=function(){this._li=null,this._interiorIntersections=null;var i=arguments[0];this._li=i,this._interiorIntersections=new QA};DD.prototype.processIntersections=function(i,t,a,s){if(i===a&&t===s)return null;var c=i.getCoordinates()[t],y=i.getCoordinates()[t+1],R=a.getCoordinates()[s],d=a.getCoordinates()[s+1];if(this._li.computeIntersection(c,y,R,d),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var f=0;f =0;t--){try{i.bufferReducedPrecision(t)}catch(y){if(!(y instanceof RA))throw y;i._saveException=y}if(i._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var a=arguments[0],s=NB.precisionScaleFactor(this._argGeom,this._distance,a),c=new yg(s);this.bufferFixedPrecision(c)}},NB.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var i=this._argGeom.getFactory().getPrecisionModel();i.getType()===yg.FIXED?this.bufferFixedPrecision(i):this.bufferReducedPrecision()},NB.prototype.setQuadrantSegments=function(i){this._bufParams.setQuadrantSegments(i)},NB.prototype.bufferOriginalPrecision=function(){try{var i=new jB(this._bufParams);this._resultGeometry=i.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof KQ))throw t;this._saveException=t}},NB.prototype.getResultGeometry=function(i){return this._distance=i,this.computeGeometry(),this._resultGeometry},NB.prototype.setEndCapStyle=function(i){this._bufParams.setEndCapStyle(i)},NB.prototype.interfaces_=function(){return[]},NB.prototype.getClass=function(){return NB},NB.bufferOp=function(){if(arguments.length===2){var i=arguments[0],t=arguments[1];return new NB(i).getResultGeometry(t)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof UA&&typeof arguments[1]==\"number\"){var a=arguments[0],s=arguments[1],c=arguments[2],y=new NB(a);return y.setQuadrantSegments(c),y.getResultGeometry(s)}if(arguments[2]instanceof Ug&&arguments[0]instanceof UA&&typeof arguments[1]==\"number\"){var R=arguments[0],d=arguments[1],f=arguments[2];return new NB(R,f).getResultGeometry(d)}}else if(arguments.length===4){var v=arguments[0],EA=arguments[1],aA=arguments[2],kA=arguments[3],yA=new NB(v);return yA.setQuadrantSegments(aA),yA.setEndCapStyle(kA),yA.getResultGeometry(EA)}},NB.precisionScaleFactor=function(i,t,a){var s=i.getEnvelopeInternal(),c=$.max(Math.abs(s.getMaxX()),Math.abs(s.getMaxY()),Math.abs(s.getMinX()),Math.abs(s.getMinY()))+2*(t>0?t:0),y=a-Math.trunc(Math.log(c)/Math.log(10)+1);return Math.pow(10,y)},fs.CAP_ROUND.get=function(){return Ug.CAP_ROUND},fs.CAP_BUTT.get=function(){return Ug.CAP_FLAT},fs.CAP_FLAT.get=function(){return Ug.CAP_FLAT},fs.CAP_SQUARE.get=function(){return Ug.CAP_SQUARE},fs.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(NB,fs);var XB=function(){this._pt=[new q,new q],this._distance=M.NaN,this._isNull=!0};XB.prototype.getCoordinates=function(){return this._pt},XB.prototype.getCoordinate=function(i){return this._pt[i]},XB.prototype.setMinimum=function(){if(arguments.length===1){var i=arguments[0];this.setMinimum(i._pt[0],i._pt[1])}else if(arguments.length===2){var t=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(t,a),null;var s=t.distance(a);s this._distance&&this.initialize(t,a,s)}},XB.prototype.interfaces_=function(){return[]},XB.prototype.getClass=function(){return XB};var Ri=function(){};Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.computeDistance=function(){if(arguments[2]instanceof XB&&arguments[0]instanceof II&&arguments[1]instanceof q)for(var i=arguments[0],t=arguments[1],a=arguments[2],s=i.getCoordinates(),c=new qA,y=0;y 0||this._isIn?L.INTERIOR:L.EXTERIOR)},kE.prototype.interfaces_=function(){return[]},kE.prototype.getClass=function(){return kE};var zB=function i(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],a=arguments[1];i.call(this,t,i.INSIDE_AREA,a)}else if(arguments.length===3){var s=arguments[0],c=arguments[1],y=arguments[2];this._component=s,this._segIndex=c,this._pt=y}},NL={INSIDE_AREA:{configurable:!0}};zB.prototype.isInsideArea=function(){return this._segIndex===zB.INSIDE_AREA},zB.prototype.getCoordinate=function(){return this._pt},zB.prototype.getGeometryComponent=function(){return this._component},zB.prototype.getSegmentIndex=function(){return this._segIndex},zB.prototype.interfaces_=function(){return[]},zB.prototype.getClass=function(){return zB},NL.INSIDE_AREA.get=function(){return-1},Object.defineProperties(zB,NL);var lt=function(i){this._pts=i||null};lt.prototype.filter=function(i){i instanceof VB&&this._pts.add(i)},lt.prototype.interfaces_=function(){return[cI]},lt.prototype.getClass=function(){return lt},lt.getPoints=function(){if(arguments.length===1){var i=arguments[0];return i instanceof VB?hE.singletonList(i):lt.getPoints(i,new QA)}if(arguments.length===2){var t=arguments[0],a=arguments[1];return t instanceof VB?a.add(t):t instanceof Xg&&t.apply(new lt(a)),a}};var rD=function(){this._locations=null;var i=arguments[0];this._locations=i};rD.prototype.filter=function(i){(i instanceof VB||i instanceof II||i instanceof Hg)&&this._locations.add(new zB(i,0,i.getCoordinate()))},rD.prototype.interfaces_=function(){return[cI]},rD.prototype.getClass=function(){return rD},rD.getLocations=function(i){var t=new QA;return i.apply(new rD(t)),t};var yB=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new kE,this._minDistanceLocation=null,this._minDistance=M.MAX_VALUE,arguments.length===2){var i=arguments[0],t=arguments[1];this._geom=[i,t],this._terminateDistance=0}else if(arguments.length===3){var a=arguments[0],s=arguments[1],c=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=a,this._geom[1]=s,this._terminateDistance=c}};yB.prototype.computeContainmentDistance=function(){if(arguments.length===0){var i=new Array(2).fill(null);if(this.computeContainmentDistance(0,i),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,i)}else if(arguments.length===2){var t=arguments[0],a=arguments[1],s=1-t,c=Mo.getPolygons(this._geom[t]);if(c.size()>0){var y=rD.getLocations(this._geom[s]);if(this.computeContainmentDistance(y,c,a),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=a[0],this._minDistanceLocation[t]=a[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&m(arguments[0],DA)&&m(arguments[1],DA)){for(var R=arguments[0],d=arguments[1],f=arguments[2],v=0;v this._minDistance)return null;for(var s=i.getCoordinates(),c=t.getCoordinate(),y=0;y this._minDistance)return null;for(var aA=f.getCoordinates(),kA=v.getCoordinates(),yA=0;yA this._distance&&this.initialize(t,a,s)}},fB.prototype.interfaces_=function(){return[]},fB.prototype.getClass=function(){return fB};var OE=function(){};OE.prototype.interfaces_=function(){return[]},OE.prototype.getClass=function(){return OE},OE.computeDistance=function(){if(arguments[2]instanceof fB&&arguments[0]instanceof II&&arguments[1]instanceof q)for(var i=arguments[0],t=arguments[1],a=arguments[2],s=new qA,c=i.getCoordinates(),y=0;y 1||i<=0)throw new Y(\"Fraction is not in range (0.0 - 1.0]\");this._densifyFrac=i},zC.prototype.compute=function(i,t){this.computeOrientedDistance(i,t,this._ptDist),this.computeOrientedDistance(t,i,this._ptDist)},zC.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},zC.prototype.computeOrientedDistance=function(i,t,a){var s=new nD(t);if(i.apply(s),a.setMaximum(s.getMaxPointDistance()),this._densifyFrac>0){var c=new Jt(t,this._densifyFrac);i.apply(c),a.setMaximum(c.getMaxPointDistance())}},zC.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},zC.prototype.interfaces_=function(){return[]},zC.prototype.getClass=function(){return zC},zC.distance=function(){if(arguments.length===2){var i=arguments[0],t=arguments[1];return new zC(i,t).distance()}if(arguments.length===3){var a=arguments[0],s=arguments[1],c=arguments[2],y=new zC(a,s);return y.setDensifyFraction(c),y.distance()}},_l.MaxPointDistanceFilter.get=function(){return nD},_l.MaxDensifiedByFractionDistanceFilter.get=function(){return Jt},Object.defineProperties(zC,_l);var nD=function(){this._maxPtDist=new fB,this._minPtDist=new fB,this._euclideanDist=new OE,this._geom=null;var i=arguments[0];this._geom=i};nD.prototype.filter=function(i){this._minPtDist.initialize(),OE.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},nD.prototype.getMaxPointDistance=function(){return this._maxPtDist},nD.prototype.interfaces_=function(){return[AA]},nD.prototype.getClass=function(){return nD};var Jt=function(){this._maxPtDist=new fB,this._minPtDist=new fB,this._geom=null,this._numSubSegs=0;var i=arguments[0],t=arguments[1];this._geom=i,this._numSubSegs=Math.trunc(Math.round(1/t))};Jt.prototype.filter=function(i,t){if(t===0)return null;for(var a=i.getCoordinate(t-1),s=i.getCoordinate(t),c=(s.x-a.x)/this._numSubSegs,y=(s.y-a.y)/this._numSubSegs,R=0;R a){this._isValid=!1;var c=s.getCoordinates();this._errorLocation=c[1],this._errorIndicator=i.getFactory().createLineString(c),this._errMsg=\"Distance between buffer curve and input is too large (\"+this._maxDistanceFound+\" at \"+PI.toLineString(c[0],c[1])+\")\"}},SQ.prototype.isValid=function(){var i=Math.abs(this._bufDistance),t=SQ.MAX_DISTANCE_DIFF_FRAC*i;return this._minValidDistance=i-t,this._maxValidDistance=i+t,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),SQ.VERBOSE&&cg.out.println(\"Min Dist= \"+this._minDistanceFound+\" err= \"+(1-this._minDistanceFound/this._bufDistance)+\" Max Dist= \"+this._maxDistanceFound+\" err= \"+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},SQ.prototype.checkNegativeValid=function(){if(!(this._input instanceof Hg||this._input instanceof oB||this._input instanceof Xg))return null;var i=this.getPolygonLines(this._input);if(this.checkMinimumDistance(i,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(i,this._result,this._maxValidDistance)},SQ.prototype.getErrorIndicator=function(){return this._errorIndicator},SQ.prototype.checkMinimumDistance=function(i,t,a){var s=new yB(i,t,a);if(this._minDistanceFound=s.distance(),this._minDistanceFound0&&i>t&&(this._isValid=!1,this._errorMsg=\"Area of positive buffer is smaller than input\",this._errorIndicator=this._result),this._distance<0&&i =2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg=\"Result is non-empty\",this._errorIndicator=this._result),void this.report(\"ExpectedEmpty\"))},FB.prototype.report=function(i){if(!FB.VERBOSE)return null;cg.out.println(\"Check \"+i+\": \"+(this._isValid?\"passed\":\"FAILED\"))},FB.prototype.getErrorMessage=function(){return this._errorMsg},FB.prototype.interfaces_=function(){return[]},FB.prototype.getClass=function(){return FB},FB.isValidMsg=function(i,t,a){var s=new FB(i,t,a);return s.isValid()?null:s.getErrorMessage()},FB.isValid=function(i,t,a){return!!new FB(i,t,a).isValid()},AJ.VERBOSE.get=function(){return!1},AJ.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(FB,AJ);var VE=function(){this._pts=null,this._data=null;var i=arguments[0],t=arguments[1];this._pts=i,this._data=t};VE.prototype.getCoordinates=function(){return this._pts},VE.prototype.size=function(){return this._pts.length},VE.prototype.getCoordinate=function(i){return this._pts[i]},VE.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},VE.prototype.getSegmentOctant=function(i){return i===this._pts.length-1?-1:tD.octant(this.getCoordinate(i),this.getCoordinate(i+1))},VE.prototype.setData=function(i){this._data=i},VE.prototype.getData=function(){return this._data},VE.prototype.toString=function(){return PI.toLineString(new BI(this._pts))},VE.prototype.interfaces_=function(){return[Ni]},VE.prototype.getClass=function(){return VE};var eB=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new QA,this._intersectionCount=0,this._keepIntersections=!0;var i=arguments[0];this._li=i,this._interiorIntersection=null};eB.prototype.getInteriorIntersection=function(){return this._interiorIntersection},eB.prototype.setCheckEndSegmentsOnly=function(i){this._isCheckEndSegmentsOnly=i},eB.prototype.getIntersectionSegments=function(){return this._intSegments},eB.prototype.count=function(){return this._intersectionCount},eB.prototype.getIntersections=function(){return this._intersections},eB.prototype.setFindAllIntersections=function(i){this._findAllIntersections=i},eB.prototype.setKeepIntersections=function(i){this._keepIntersections=i},eB.prototype.processIntersections=function(i,t,a,s){if(!this._findAllIntersections&&this.hasIntersection()||i===a&&t===s||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(i,t)||this.isEndSegment(a,s)))return null;var c=i.getCoordinates()[t],y=i.getCoordinates()[t+1],R=a.getCoordinates()[s],d=a.getCoordinates()[s+1];this._li.computeIntersection(c,y,R,d),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=c,this._intSegments[1]=y,this._intSegments[2]=R,this._intSegments[3]=d,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},eB.prototype.isEndSegment=function(i,t){return t===0||t>=i.size()-2},eB.prototype.hasIntersection=function(){return this._interiorIntersection!==null},eB.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},eB.prototype.interfaces_=function(){return[We]},eB.prototype.getClass=function(){return eB},eB.createAllIntersectionsFinder=function(i){var t=new eB(i);return t.setFindAllIntersections(!0),t},eB.createAnyIntersectionFinder=function(i){return new eB(i)},eB.createIntersectionCounter=function(i){var t=new eB(i);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var yE=function(){this._li=new cE,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var i=arguments[0];this._segStrings=i};yE.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},yE.prototype.getIntersections=function(){return this._segInt.getIntersections()},yE.prototype.isValid=function(){return this.execute(),this._isValid},yE.prototype.setFindAllIntersections=function(i){this._findAllIntersections=i},yE.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new eB(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var i=new Xl;if(i.setSegmentIntersector(this._segInt),i.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},yE.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new RA(this.getErrorMessage(),this._segInt.getInteriorIntersection())},yE.prototype.getErrorMessage=function(){if(this._isValid)return\"no intersections found\";var i=this._segInt.getIntersectionSegments();return\"found non-noded intersection between \"+PI.toLineString(i[0],i[1])+\" and \"+PI.toLineString(i[2],i[3])},yE.prototype.interfaces_=function(){return[]},yE.prototype.getClass=function(){return yE},yE.computeIntersections=function(i){var t=new yE(i);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var Oe=function i(){this._nv=null;var t=arguments[0];this._nv=new yE(i.toSegmentStrings(t))};Oe.prototype.checkValid=function(){this._nv.checkValid()},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.toSegmentStrings=function(i){for(var t=new QA,a=i.iterator();a.hasNext();){var s=a.next();t.add(new VE(s.getCoordinates(),s))}return t},Oe.checkValid=function(i){new Oe(i).checkValid()};var cD=function(i){this._mapOp=i};cD.prototype.map=function(i){for(var t=new QA,a=0;a 0&&s<4&&!this._preserveType?this._factory.createLineString(a):this._factory.createLinearRing(a)},nQ.prototype.interfaces_=function(){return[]},nQ.prototype.getClass=function(){return nQ};var Mi=function i(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new qA,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof II&&typeof arguments[1]==\"number\"){var t=arguments[0],a=arguments[1];i.call(this,t.getCoordinates(),a)}else if(arguments[0]instanceof Array&&typeof arguments[1]==\"number\"){var s=arguments[0],c=arguments[1];this._srcPts=s,this._isClosed=i.isClosed(s),this._snapTolerance=c}};Mi.prototype.snapVertices=function(i,t){for(var a=this._isClosed?i.size()-1:i.size(),s=0;s=0&&i.add(y+1,new q(c),!1)}},Mi.prototype.findSegmentIndexToSnap=function(i,t){for(var a=M.MAX_VALUE,s=-1,c=0;c t&&(t=s)}return t}if(arguments.length===2){var c=arguments[0],y=arguments[1];return Math.min(dI.computeOverlaySnapTolerance(c),dI.computeOverlaySnapTolerance(y))}},dI.computeSizeBasedSnapTolerance=function(i){var t=i.getEnvelopeInternal();return Math.min(t.getHeight(),t.getWidth())*dI.SNAP_PRECISION_FACTOR},dI.snapToSelf=function(i,t,a){return new dI(i).snapToSelf(t,a)},kL.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(dI,kL);var yL=function(i){function t(a,s,c){i.call(this),this._snapTolerance=a||null,this._snapPts=s||null,this._isSelfSnap=c!==void 0&&c}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(a,s){var c=new Mi(a,this._snapTolerance);return c.setAllowSnappingToSourceVertices(this._isSelfSnap),c.snapTo(s)},t.prototype.transformCoordinates=function(a,s){var c=a.toCoordinateArray(),y=this.snapLine(c,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(y)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(nQ),_B=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};_B.prototype.getCommon=function(){return M.longBitsToDouble(this._commonBits)},_B.prototype.add=function(i){var t=M.doubleToLongBits(i);if(this._isFirst)return this._commonBits=t,this._commonSignExp=_B.signExpBits(this._commonBits),this._isFirst=!1,null;if(_B.signExpBits(t)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=_B.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=_B.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},_B.prototype.toString=function(){if(arguments.length===1){var i=arguments[0],t=M.longBitsToDouble(i),a=\"0000000000000000000000000000000000000000000000000000000000000000\"+M.toBinaryString(i),s=a.substring(a.length-64);return s.substring(0,1)+\" \"+s.substring(1,12)+\"(exp) \"+s.substring(12)+\" [ \"+t+\" ]\"}},_B.prototype.interfaces_=function(){return[]},_B.prototype.getClass=function(){return _B},_B.getBit=function(i,t){return i&1< >52},_B.zeroLowerBits=function(i,t){return i&~((1< =0;s--){if(_B.getBit(i,s)!==_B.getBit(t,s))return a;a++}return 52};var Yt=function(){this._commonCoord=null,this._ccFilter=new wD},gJ={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Yt.prototype.addCommonBits=function(i){var t=new Kt(this._commonCoord);i.apply(t),i.geometryChanged()},Yt.prototype.removeCommonBits=function(i){if(this._commonCoord.x===0&&this._commonCoord.y===0)return i;var t=new q(this._commonCoord);t.x=-t.x,t.y=-t.y;var a=new Kt(t);return i.apply(a),i.geometryChanged(),i},Yt.prototype.getCommonCoordinate=function(){return this._commonCoord},Yt.prototype.add=function(i){i.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},gJ.CommonCoordinateFilter.get=function(){return wD},gJ.Translater.get=function(){return Kt},Object.defineProperties(Yt,gJ);var wD=function(){this._commonBitsX=new _B,this._commonBitsY=new _B};wD.prototype.filter=function(i){this._commonBitsX.add(i.x),this._commonBitsY.add(i.y)},wD.prototype.getCommonCoordinate=function(){return new q(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},wD.prototype.interfaces_=function(){return[AA]},wD.prototype.getClass=function(){return wD};var Kt=function(){this.trans=null;var i=arguments[0];this.trans=i};Kt.prototype.filter=function(i,t){var a=i.getOrdinate(t,0)+this.trans.x,s=i.getOrdinate(t,1)+this.trans.y;i.setOrdinate(t,0,a),i.setOrdinate(t,1,s)},Kt.prototype.isDone=function(){return!1},Kt.prototype.isGeometryChanged=function(){return!0},Kt.prototype.interfaces_=function(){return[oI]},Kt.prototype.getClass=function(){return Kt};var aB=function(i,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=i,this._geom[1]=t,this.computeSnapTolerance()};aB.prototype.selfSnap=function(i){return new dI(i).snapTo(i,this._snapTolerance)},aB.prototype.removeCommonBits=function(i){this._cbr=new Yt,this._cbr.add(i[0]),this._cbr.add(i[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(i[0].copy()),t[1]=this._cbr.removeCommonBits(i[1].copy()),t},aB.prototype.prepareResult=function(i){return this._cbr.addCommonBits(i),i},aB.prototype.getResultGeometry=function(i){var t=this.snap(this._geom),a=zA.overlayOp(t[0],t[1],i);return this.prepareResult(a)},aB.prototype.checkValid=function(i){i.isValid()||cg.out.println(\"Snapped geometry is invalid\")},aB.prototype.computeSnapTolerance=function(){this._snapTolerance=dI.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},aB.prototype.snap=function(i){var t=this.removeCommonBits(i);return dI.snap(t[0],t[1],this._snapTolerance)},aB.prototype.interfaces_=function(){return[]},aB.prototype.getClass=function(){return aB},aB.overlayOp=function(i,t,a){return new aB(i,t).getResultGeometry(a)},aB.union=function(i,t){return aB.overlayOp(i,t,zA.UNION)},aB.intersection=function(i,t){return aB.overlayOp(i,t,zA.INTERSECTION)},aB.symDifference=function(i,t){return aB.overlayOp(i,t,zA.SYMDIFFERENCE)},aB.difference=function(i,t){return aB.overlayOp(i,t,zA.DIFFERENCE)};var $B=function(i,t){this._geom=new Array(2).fill(null),this._geom[0]=i,this._geom[1]=t};$B.prototype.getResultGeometry=function(i){var t=null,a=!1,s=null;try{t=zA.overlayOp(this._geom[0],this._geom[1],i),a=!0}catch(c){if(!(c instanceof KQ))throw c;s=c}if(!a)try{t=aB.overlayOp(this._geom[0],this._geom[1],i)}catch(c){throw c instanceof KQ?s:c}return t},$B.prototype.interfaces_=function(){return[]},$B.prototype.getClass=function(){return $B},$B.overlayOp=function(i,t,a){return new $B(i,t).getResultGeometry(a)},$B.union=function(i,t){return $B.overlayOp(i,t,zA.UNION)},$B.intersection=function(i,t){return $B.overlayOp(i,t,zA.INTERSECTION)},$B.symDifference=function(i,t){return $B.overlayOp(i,t,zA.SYMDIFFERENCE)},$B.difference=function(i,t){return $B.overlayOp(i,t,zA.DIFFERENCE)};var ec=function(){this.mce=null,this.chainIndex=null;var i=arguments[0],t=arguments[1];this.mce=i,this.chainIndex=t};ec.prototype.computeIntersections=function(i,t){this.mce.computeIntersectsForChain(this.chainIndex,i.mce,i.chainIndex,t)},ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec};var LQ=function i(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],a=arguments[1];this._eventType=i.DELETE,this._xValue=t,this._insertEvent=a}else if(arguments.length===3){var s=arguments[0],c=arguments[1],y=arguments[2];this._eventType=i.INSERT,this._label=s,this._xValue=c,this._obj=y}},IJ={INSERT:{configurable:!0},DELETE:{configurable:!0}};LQ.prototype.isDelete=function(){return this._eventType===LQ.DELETE},LQ.prototype.setDeleteEventIndex=function(i){this._deleteEventIndex=i},LQ.prototype.getObject=function(){return this._obj},LQ.prototype.compareTo=function(i){var t=i;return this._xValue t._xValue?1:this._eventType t._eventType?1:0},LQ.prototype.getInsertEvent=function(){return this._insertEvent},LQ.prototype.isInsert=function(){return this._eventType===LQ.INSERT},LQ.prototype.isSameLabel=function(i){return this._label!==null&&this._label===i._label},LQ.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},LQ.prototype.interfaces_=function(){return[J]},LQ.prototype.getClass=function(){return LQ},IJ.INSERT.get=function(){return 1},IJ.DELETE.get=function(){return 2},Object.defineProperties(LQ,IJ);var QN=function(){};QN.prototype.interfaces_=function(){return[]},QN.prototype.getClass=function(){return QN};var RB=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var i=arguments[0],t=arguments[1],a=arguments[2];this._li=i,this._includeProper=t,this._recordIsolated=a};RB.prototype.isTrivialIntersection=function(i,t,a,s){if(i===a&&this._li.getIntersectionNum()===1){if(RB.isAdjacentSegments(t,s))return!0;if(i.isClosed()){var c=i.getNumPoints()-1;if(t===0&&s===c||s===0&&t===c)return!0}}return!1},RB.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},RB.prototype.setIsDoneIfProperInt=function(i){this._isDoneWhenProperInt=i},RB.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},RB.prototype.isBoundaryPointInternal=function(i,t){for(var a=t.iterator();a.hasNext();){var s=a.next().getCoordinate();if(i.isIntersection(s))return!0}return!1},RB.prototype.hasProperIntersection=function(){return this._hasProper},RB.prototype.hasIntersection=function(){return this._hasIntersection},RB.prototype.isDone=function(){return this._isDone},RB.prototype.isBoundaryPoint=function(i,t){return t!==null&&(!!this.isBoundaryPointInternal(i,t[0])||!!this.isBoundaryPointInternal(i,t[1]))},RB.prototype.setBoundaryNodes=function(i,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=i,this._bdyNodes[1]=t},RB.prototype.addIntersections=function(i,t,a,s){if(i===a&&t===s)return null;this.numTests++;var c=i.getCoordinates()[t],y=i.getCoordinates()[t+1],R=a.getCoordinates()[s],d=a.getCoordinates()[s+1];this._li.computeIntersection(c,y,R,d),this._li.hasIntersection()&&(this._recordIsolated&&(i.setIsolated(!1),a.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(i,t,a,s)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(i.addIntersections(this._li,t,0),a.addIntersections(this._li,s,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},RB.prototype.interfaces_=function(){return[]},RB.prototype.getClass=function(){return RB},RB.isAdjacentSegments=function(i,t){return Math.abs(i-t)===1};var hv=function(i){function t(){i.call(this),this.events=new QA,this.nOverlaps=null}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){hE.sort(this.events);for(var a=0;a t||this._maxy?1:0},ac.prototype.interfaces_=function(){return[x]},ac.prototype.getClass=function(){return ac};var Nv=function(i){function t(){i.call(this),this._item=null;var a=arguments[0],s=arguments[1],c=arguments[2];this._min=a,this._max=s,this._item=c}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.query=function(a,s,c){if(!this.intersects(a,s))return null;c.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(li),kv=function(i){function t(){i.call(this),this._node1=null,this._node2=null;var a=arguments[0],s=arguments[1];this._node1=a,this._node2=s,this.buildExtent(this._node1,this._node2)}return i&&(t.__proto__=i),t.prototype=Object.create(i&&i.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(a,s){this._min=Math.min(a._min,s._min),this._max=Math.max(a._max,s._max)},t.prototype.query=function(a,s,c){if(!this.intersects(a,s))return null;this._node1!==null&&this._node1.query(a,s,c),this._node2!==null&&this._node2.query(a,s,c)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(li),Ji=function(){this._leaves=new QA,this._root=null,this._level=0};Ji.prototype.buildTree=function(){hE.sort(this._leaves,new li.NodeComparator);for(var i=this._leaves,t=null,a=new QA;;){if(this.buildLevel(i,a),a.size()===1)return a.get(0);t=i,i=a,a=t}},Ji.prototype.insert=function(i,t,a){if(this._root!==null)throw new Error(\"Index cannot be added to once it has been queried\");this._leaves.add(new Nv(i,t,a))},Ji.prototype.query=function(i,t,a){this.init(),this._root.query(i,t,a)},Ji.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Ji.prototype.printNode=function(i){cg.out.println(PI.toLineString(new q(i._min,this._level),new q(i._max,this._level)))},Ji.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Ji.prototype.buildLevel=function(i,t){this._level++,t.clear();for(var a=0;a =2,\"found LineString with single point\"),this.insertBoundaryPoint(this._argIndex,s[0]),this.insertBoundaryPoint(this._argIndex,s[s.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var a=this.getBoundaryNodes(),s=new Array(a.size()).fill(null),c=0,y=a.iterator();y.hasNext();){var R=y.next();s[c++]=R.getCoordinate().copy()}return s},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(a,s,c){if(this.isBoundaryNode(a,s))return null;c===L.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(a,s):this.insertPoint(a,s,c)},t.prototype.addPolygonRing=function(a,s,c){if(a.isEmpty())return null;var y=sA.removeRepeatedPoints(a.getCoordinates());if(y.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=y[0],null;var R=s,d=c;hA.isCCW(y)&&(R=c,d=s);var f=new BN(y,new XA(this._argIndex,L.BOUNDARY,R,d));this._lineEdgeMap.put(a,f),this.insertEdge(f),this.insertPoint(this._argIndex,y[0],L.BOUNDARY)},t.prototype.insertPoint=function(a,s,c){var y=this._nodes.addNode(s),R=y.getLabel();R===null?y._label=new XA(a,c):R.setLocation(a,c)},t.prototype.createEdgeSetIntersector=function(){return new hv},t.prototype.addSelfIntersectionNodes=function(a){for(var s=this._edges.iterator();s.hasNext();)for(var c=s.next(),y=c.getLabel().getLocation(a),R=c.eiList.iterator();R.hasNext();){var d=R.next();this.addSelfIntersectionNode(a,d.coord,y)}},t.prototype.add=function(){if(arguments.length!==1)return i.prototype.add.apply(this,arguments);var a=arguments[0];if(a.isEmpty())return null;if(a instanceof oB&&(this._useBoundaryDeterminationRule=!1),a instanceof Hg)this.addPolygon(a);else if(a instanceof II)this.addLineString(a);else if(a instanceof VB)this.addPoint(a);else if(a instanceof GE)this.addCollection(a);else if(a instanceof eQ)this.addCollection(a);else if(a instanceof oB)this.addCollection(a);else{if(!(a instanceof Xg))throw new Error(a.getClass().getName());this.addCollection(a)}},t.prototype.addCollection=function(a){for(var s=0;s 50?(this._areaPtLocator===null&&(this._areaPtLocator=new ms(this._parentGeom)),this._areaPtLocator.locate(a)):this._ptLocator.locate(a,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var a=arguments[0];return this._lineEdgeMap.get(a)}return i.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(a,s){return a.isInBoundary(s)?L.BOUNDARY:L.INTERIOR},t}(GI),bs=function(){if(this._li=new cE,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var i=arguments[0];this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Dc(0,i)}else if(arguments.length===2){var t=arguments[0],a=arguments[1],s=K.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(a.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Dc(0,t,s),this._arg[1]=new Dc(1,a,s)}else if(arguments.length===3){var c=arguments[0],y=arguments[1],R=arguments[2];c.getPrecisionModel().compareTo(y.getPrecisionModel())>=0?this.setComputationPrecision(c.getPrecisionModel()):this.setComputationPrecision(y.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Dc(0,c,R),this._arg[1]=new Dc(1,y,R)}};bs.prototype.getArgGeometry=function(i){return this._arg[i].getGeometry()},bs.prototype.setComputationPrecision=function(i){this._resultPrecisionModel=i,this._li.setPrecisionModel(this._resultPrecisionModel)},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var ve=function(){};ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve},ve.map=function(){if(arguments[0]instanceof UA&&m(arguments[1],ve.MapOp)){for(var i=arguments[0],t=arguments[1],a=new QA,s=0;s =i.size()?null:i.get(t)},xI.union=function(i){return new xI(i).union()},ML.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(xI,ML);var sc=function(){};sc.prototype.interfaces_=function(){return[]},sc.prototype.getClass=function(){return sc},sc.union=function(i,t){if(i.isEmpty()||t.isEmpty()){if(i.isEmpty()&&t.isEmpty())return zA.createEmptyResult(zA.UNION,i,t,i.getFactory());if(i.isEmpty())return t.copy();if(t.isEmpty())return i.copy()}return i.checkNotGeometryCollection(i),i.checkNotGeometryCollection(t),$B.overlayOp(i,t,zA.UNION)},g.GeoJSONReader=H,g.GeoJSONWriter=b,g.OverlayOp=zA,g.UnionOp=sc,g.BufferOp=NB,Object.defineProperty(g,\"__esModule\",{value:!0})})});var tl=FE((HU,fU)=>{(function(g,A){typeof HU==\"object\"&&typeof fU<\"u\"?fU.exports=A():(g=typeof globalThis<\"u\"?globalThis:g||self,g.polygonClipping=A())})(HU,function(){\"use strict\";function g(AA,K){var S={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},T,V,O,eA;return eA={next:BA(0),throw:BA(1),return:BA(2)},typeof Symbol==\"function\"&&(eA[Symbol.iterator]=function(){return this}),eA;function BA(DA){return function(QA){return rA([DA,QA])}}function rA(DA){if(T)throw new TypeError(\"Generator is already executing.\");for(;S;)try{if(T=1,V&&(O=DA[0]&2?V.return:DA[0]?V.throw||((O=V.return)&&O.call(V),0):V.next)&&!(O=O.call(V,DA[1])).done)return O;switch(V=0,O&&(DA=[DA[0]&2,O.value]),DA[0]){case 0:case 1:O=DA;break;case 4:return S.label++,{value:DA[1],done:!1};case 5:S.label++,V=DA[1],DA=[0];continue;case 7:DA=S.ops.pop(),S.trys.pop();continue;default:if(O=S.trys,!(O=O.length>0&&O[O.length-1])&&(DA[0]===6||DA[0]===2)){S=0;continue}if(DA[0]===3&&(!O||DA[1]>O[0]&&DA[1] K?1:AA 0){if(K.right===null)break;if(S(AA,K.right.key)>0){var BA=K.right;if(K.right=BA.left,BA.left=K,K=BA,K.right===null)break}V.right=K,V=K,K=K.right}else break}return V.right=K.left,O.left=K.right,K.left=T.right,K.right=T.left,K}function Q(AA,K,S,T){var V=new A(AA,K);if(S===null)return V.left=V.right=null,V;S=B(AA,S,T);var O=T(AA,S.key);return O<0?(V.left=S.left,V.right=S,S.left=null):O>=0&&(V.right=S.right,V.left=S,S.right=null),V}function C(AA,K,S){var T=null,V=null;if(K){K=B(AA,K,S);var O=S(K.key,AA);O===0?(T=K.left,V=K.right):O<0?(V=K.right,K.right=null,T=K):(T=K.left,K.left=null,V=K)}return{left:T,right:V}}function E(AA,K,S){return K===null?AA:(AA===null||(K=B(AA.key,K,S),K.left=AA),K)}function o(AA,K,S,T,V){if(AA){T(\"\"+K+(S?\"\\u2514\\u2500\\u2500 \":\"\\u251C\\u2500\\u2500 \")+V(AA)+`\n`);var O=K+(S?\" \":\"\\u2502 \");AA.left&&o(AA.left,O,!1,T,V),AA.right&&o(AA.right,O,!0,T,V)}}var e=function(){function AA(K){K===void 0&&(K=I),this._root=null,this._size=0,this._comparator=K}return AA.prototype.insert=function(K,S){return this._size++,this._root=Q(K,S,this._root,this._comparator)},AA.prototype.add=function(K,S){var T=new A(K,S);this._root===null&&(T.left=T.right=null,this._size++,this._root=T);var V=this._comparator,O=B(K,this._root,V),eA=V(K,O.key);return eA===0?this._root=O:(eA<0?(T.left=O.left,T.right=O,O.left=null):eA>0&&(T.right=O.right,T.left=O,O.right=null),this._size++,this._root=T),this._root},AA.prototype.remove=function(K){this._root=this._remove(K,this._root,this._comparator)},AA.prototype._remove=function(K,S,T){var V;if(S===null)return null;S=B(K,S,T);var O=T(K,S.key);return O===0?(S.left===null?V=S.right:(V=B(K,S.left,T),V.right=S.right),this._size--,V):S},AA.prototype.pop=function(){var K=this._root;if(K){for(;K.left;)K=K.left;return this._root=B(K.key,this._root,this._comparator),this._root=this._remove(K.key,this._root,this._comparator),{key:K.key,data:K.data}}return null},AA.prototype.findStatic=function(K){for(var S=this._root,T=this._comparator;S;){var V=T(K,S.key);if(V===0)return S;V<0?S=S.left:S=S.right}return null},AA.prototype.find=function(K){return this._root&&(this._root=B(K,this._root,this._comparator),this._comparator(K,this._root.key)!==0)?null:this._root},AA.prototype.contains=function(K){for(var S=this._root,T=this._comparator;S;){var V=T(K,S.key);if(V===0)return!0;V<0?S=S.left:S=S.right}return!1},AA.prototype.forEach=function(K,S){for(var T=this._root,V=[],O=!1;!O;)T!==null?(V.push(T),T=T.left):V.length!==0?(T=V.pop(),K.call(S,T),T=T.right):O=!0;return this},AA.prototype.range=function(K,S,T,V){for(var O=[],eA=this._comparator,BA=this._root,rA;O.length!==0||BA;)if(BA)O.push(BA),BA=BA.left;else{if(BA=O.pop(),rA=eA(BA.key,S),rA>0)break;if(eA(BA.key,K)>=0&&T.call(V,BA))return this;BA=BA.right}return this},AA.prototype.keys=function(){var K=[];return this.forEach(function(S){var T=S.key;return K.push(T)}),K},AA.prototype.values=function(){var K=[];return this.forEach(function(S){var T=S.data;return K.push(T)}),K},AA.prototype.min=function(){return this._root?this.minNode(this._root).key:null},AA.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},AA.prototype.minNode=function(K){if(K===void 0&&(K=this._root),K)for(;K.left;)K=K.left;return K},AA.prototype.maxNode=function(K){if(K===void 0&&(K=this._root),K)for(;K.right;)K=K.right;return K},AA.prototype.at=function(K){for(var S=this._root,T=!1,V=0,O=[];!T;)if(S)O.push(S),S=S.left;else if(O.length>0){if(S=O.pop(),V===K)return S;V++,S=S.right}else T=!0;return null},AA.prototype.next=function(K){var S=this._root,T=null;if(K.right){for(T=K.right;T.left;)T=T.left;return T}for(var V=this._comparator;S;){var O=V(K.key,S.key);if(O===0)break;O<0?(T=S,S=S.left):S=S.right}return T},AA.prototype.prev=function(K){var S=this._root,T=null;if(K.left!==null){for(T=K.left;T.right;)T=T.right;return T}for(var V=this._comparator;S;){var O=V(K.key,S.key);if(O===0)break;O<0?S=S.left:(T=S,S=S.right)}return T},AA.prototype.clear=function(){return this._root=null,this._size=0,this},AA.prototype.toList=function(){return n(this._root)},AA.prototype.load=function(K,S,T){S===void 0&&(S=[]),T===void 0&&(T=!1);var V=K.length,O=this._comparator;if(T&&k(K,S,0,V-1,O),this._root===null)this._root=D(K,S,0,V),this._size=V;else{var eA=w(this.toList(),r(K,S),O);V=this._size+V,this._root=G({head:eA},0,V)}return this},AA.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(AA.prototype,\"size\",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(AA.prototype,\"root\",{get:function(){return this._root},enumerable:!0,configurable:!0}),AA.prototype.toString=function(K){K===void 0&&(K=function(T){return String(T.key)});var S=[];return o(this._root,\"\",!0,function(T){return S.push(T)},K),S.join(\"\")},AA.prototype.update=function(K,S,T){var V=this._comparator,O=C(K,this._root,V),eA=O.left,BA=O.right;V(K,S)<0?BA=Q(S,T,BA,V):eA=Q(S,T,eA,V),this._root=E(eA,BA,V)},AA.prototype.split=function(K){return C(K,this._root,this._comparator)},AA.prototype[Symbol.iterator]=function(){var K,S,T;return g(this,function(V){switch(V.label){case 0:K=this._root,S=[],T=!1,V.label=1;case 1:return T?[3,6]:K===null?[3,2]:(S.push(K),K=K.left,[3,5]);case 2:return S.length===0?[3,4]:(K=S.pop(),[4,K]);case 3:return V.sent(),K=K.right,[3,5];case 4:T=!0,V.label=5;case 5:return[3,1];case 6:return[2]}})},AA}();function D(AA,K,S,T){var V=T-S;if(V>0){var O=S+Math.floor(V/2),eA=AA[O],BA=K[O],rA=new A(eA,BA);return rA.left=D(AA,K,S,O),rA.right=D(AA,K,O+1,T),rA}return null}function r(AA,K){for(var S=new A(null,null),T=S,V=0;V 0?(K=O=O.next=S.pop(),K=K.right):T=!0;return O.next=null,V.next}function G(AA,K,S){var T=S-K;if(T>0){var V=K+Math.floor(T/2),O=G(AA,K,V),eA=AA.head;return eA.left=O,AA.head=AA.head.next,eA.right=G(AA,V+1,S),eA}return null}function w(AA,K,S){for(var T=new A(null,null),V=T,O=AA,eA=K;O!==null&&eA!==null;)S(O.key,eA.key)<0?(V.next=O,O=O.next):(V.next=eA,eA=eA.next),V=V.next;return O!==null?V.next=O:eA!==null&&(V.next=eA),T.next}function k(AA,K,S,T,V){if(!(S>=T)){for(var O=AA[S+T>>1],eA=S-1,BA=T+1;;){do eA++;while(V(AA[eA],O)<0);do BA--;while(V(AA[BA],O)>0);if(eA>=BA)break;var rA=AA[eA];AA[eA]=AA[BA],AA[BA]=rA,rA=K[eA],K[eA]=K[BA],K[BA]=rA}k(AA,K,S,BA,V),k(AA,K,BA+1,T,V)}}let F=(AA,K)=>AA.ll.x<=K.x&&K.x<=AA.ur.x&&AA.ll.y<=K.y&&K.y<=AA.ur.y,h=(AA,K)=>{if(K.ur.x {if(-N DA==QA>-DA?(O=DA,DA=K[++iA]):(O=QA,QA=T[++nA]);let sA=0;if(iA DA==QA>-DA?(eA=DA+O,BA=O-(eA-DA),DA=K[++iA]):(eA=QA+O,BA=O-(eA-QA),QA=T[++nA]),O=eA,BA!==0&&(V[sA++]=BA);iA DA==QA>-DA?(eA=O+DA,rA=eA-O,BA=O-(eA-rA)+(DA-rA),DA=K[++iA]):(eA=O+QA,rA=eA-O,BA=O-(eA-rA)+(QA-rA),QA=T[++nA]),O=eA,BA!==0&&(V[sA++]=BA);for(;iA =eQ||-Xg>=eQ||(iA=AA-vA,BA=AA-(vA+iA)+(iA-V),iA=S-nI,DA=S-(nI+iA)+(iA-V),iA=K-cI,rA=K-(cI+iA)+(iA-O),iA=T-oI,QA=T-(oI+iA)+(iA-O),BA===0&&rA===0&&DA===0&&QA===0)||(eQ=$*eA+P*Math.abs(Xg),Xg+=vA*QA+oI*BA-(cI*DA+nI*rA),Xg>=eQ||-Xg>=eQ))return Xg;uI=BA*oI,nA=q*BA,sA=nA-(nA-BA),VA=BA-sA,nA=q*oI,mA=nA-(nA-oI),hg=oI-mA,CI=VA*hg-(uI-sA*mA-VA*mA-sA*hg),pI=rA*nI,nA=q*rA,sA=nA-(nA-rA),VA=rA-sA,nA=q*nI,mA=nA-(nA-nI),hg=nI-mA,iB=VA*hg-(pI-sA*mA-VA*mA-sA*hg),gg=CI-iB,iA=CI-gg,z[0]=CI-(gg+iA)+(iA-iB),iI=uI+gg,iA=iI-uI,KI=uI-(iI-iA)+(gg-iA),gg=KI-pI,iA=KI-gg,z[1]=KI-(gg+iA)+(iA-pI),rI=iI+gg,iA=rI-iI,z[2]=iI-(rI-iA)+(gg-iA),z[3]=rI;let cB=Z(4,NA,4,z,wA);uI=vA*QA,nA=q*vA,sA=nA-(nA-vA),VA=vA-sA,nA=q*QA,mA=nA-(nA-QA),hg=QA-mA,CI=VA*hg-(uI-sA*mA-VA*mA-sA*hg),pI=cI*DA,nA=q*cI,sA=nA-(nA-cI),VA=cI-sA,nA=q*DA,mA=nA-(nA-DA),hg=DA-mA,iB=VA*hg-(pI-sA*mA-VA*mA-sA*hg),gg=CI-iB,iA=CI-gg,z[0]=CI-(gg+iA)+(iA-iB),iI=uI+gg,iA=iI-uI,KI=uI-(iI-iA)+(gg-iA),gg=KI-pI,iA=KI-gg,z[1]=KI-(gg+iA)+(iA-pI),rI=iI+gg,iA=rI-iI,z[2]=iI-(rI-iA)+(gg-iA),z[3]=rI;let OC=Z(cB,wA,4,z,FA);uI=BA*QA,nA=q*BA,sA=nA-(nA-BA),VA=BA-sA,nA=q*QA,mA=nA-(nA-QA),hg=QA-mA,CI=VA*hg-(uI-sA*mA-VA*mA-sA*hg),pI=rA*DA,nA=q*rA,sA=nA-(nA-rA),VA=rA-sA,nA=q*DA,mA=nA-(nA-DA),hg=DA-mA,iB=VA*hg-(pI-sA*mA-VA*mA-sA*hg),gg=CI-iB,iA=CI-gg,z[0]=CI-(gg+iA)+(iA-iB),iI=uI+gg,iA=iI-uI,KI=uI-(iI-iA)+(gg-iA),gg=KI-pI,iA=KI-gg,z[1]=KI-(gg+iA)+(iA-pI),rI=iI+gg,iA=rI-iI,z[2]=iI-(rI-iA)+(gg-iA),z[3]=rI;let $I=Z(OC,FA,4,z,JA);return JA[$I-1]}function Yg(AA,K,S,T,V,O){let eA=(K-O)*(S-V),BA=(AA-V)*(T-O),rA=eA-BA,DA=Math.abs(eA+BA);return Math.abs(rA)>=j*DA?rA:-kg(AA,K,S,T,V,O,DA)}let sI=(AA,K)=>AA.x*K.y-AA.y*K.x,bA=(AA,K)=>AA.x*K.x+AA.y*K.y,SB=(AA,K,S)=>{let T=Yg(AA.x,AA.y,K.x,K.y,S.x,S.y);return T>0?-1:T<0?1:0},ZI=AA=>Math.sqrt(bA(AA,AA)),YQ=(AA,K,S)=>{let T={x:K.x-AA.x,y:K.y-AA.y},V={x:S.x-AA.x,y:S.y-AA.y};return sI(V,T)/ZI(V)/ZI(T)},cg=(AA,K,S)=>{let T={x:K.x-AA.x,y:K.y-AA.y},V={x:S.x-AA.x,y:S.y-AA.y};return bA(V,T)/ZI(V)/ZI(T)},vg=(AA,K,S)=>K.y===0?null:{x:AA.x+K.x/K.y*(S-AA.y),y:S},MA=(AA,K,S)=>K.x===0?null:{x:S,y:AA.y+K.y/K.x*(S-AA.x)},No=(AA,K,S,T)=>{if(K.x===0)return MA(S,T,AA.x);if(T.x===0)return MA(AA,K,S.x);if(K.y===0)return vg(S,T,AA.y);if(T.y===0)return vg(AA,K,S.y);let V=sI(K,T);if(V==0)return null;let O={x:S.x-AA.x,y:S.y-AA.y},eA=sI(O,K)/V,BA=sI(O,T)/V,rA=AA.x+BA*K.x,DA=S.x+eA*T.x,QA=AA.y+BA*K.y,iA=S.y+eA*T.y,nA=(rA+DA)/2,sA=(QA+iA)/2;return{x:nA,y:sA}};class jg{static compare(K,S){let T=jg.comparePoints(K.point,S.point);return T!==0?T:(K.point!==S.point&&K.link(S),K.isLeft!==S.isLeft?K.isLeft?1:-1:YI.compare(K.segment,S.segment))}static comparePoints(K,S){return K.x S.x?1:K.y S.y?1:0}constructor(K,S){K.events===void 0?K.events=[this]:K.events.push(this),this.point=K,this.isLeft=S}link(K){if(K.point===this.point)throw new Error(\"Tried to link already linked events\");let S=K.point.events;for(let T=0,V=S.length;T {let O=V.otherSE;S.set(V,{sine:YQ(this.point,K.point,O.point),cosine:cg(this.point,K.point,O.point)})};return(V,O)=>{S.has(V)||T(V),S.has(O)||T(O);let{sine:eA,cosine:BA}=S.get(V),{sine:rA,cosine:DA}=S.get(O);return eA>=0&&rA>=0?BA DA?-1:0:eA<0&&rA<0?BA DA?1:0:rA eA?1:0}}}let uE=0;class YI{static compare(K,S){let T=K.leftSE.point.x,V=S.leftSE.point.x,O=K.rightSE.point.x,eA=S.rightSE.point.x;if(eA BA&&rA>DA)return-1;let iA=K.comparePoint(S.leftSE.point);if(iA<0)return 1;if(iA>0)return-1;let nA=S.comparePoint(K.rightSE.point);return nA!==0?nA:-1}if(T>V){if(BA rA&&BA>QA)return 1;let iA=S.comparePoint(K.leftSE.point);if(iA!==0)return iA;let nA=K.comparePoint(S.rightSE.point);return nA<0?1:nA>0?-1:1}if(BA rA)return 1;if(O eA){let iA=K.comparePoint(S.rightSE.point);if(iA<0)return 1;if(iA>0)return-1}if(O!==eA){let iA=DA-BA,nA=O-T,sA=QA-rA,VA=eA-V;if(iA>nA&&sA VA)return-1}return O>eA?1:O QA?1:K.id S.id?1:0}constructor(K,S,T,V){this.id=++uE,this.leftSE=K,K.segment=this,K.otherSE=S,this.rightSE=S,S.segment=this,S.otherSE=K,this.rings=T,this.windings=V}static fromRing(K,S,T){let V,O,eA,BA=jg.comparePoints(K,S);if(BA<0)V=K,O=S,eA=1;else if(BA>0)V=S,O=K,eA=-1;else throw new Error(`Tried to create degenerate segment at [${K.x}, ${K.y}]`);let rA=new jg(V,!0),DA=new jg(O,!1);return new YI(rA,DA,[T],[eA])}replaceRightSE(K){this.rightSE=K,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let K=this.leftSE.point.y,S=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:K S?K:S}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(K){return K.x===this.leftSE.point.x&&K.y===this.leftSE.point.y||K.x===this.rightSE.point.x&&K.y===this.rightSE.point.y}comparePoint(K){if(this.isAnEndpoint(K))return 0;let S=this.leftSE.point,T=this.rightSE.point,V=this.vector();if(S.x===T.x)return K.x===S.x?0:K.x0&&BA.swapEvents(),jg.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),T&&(V.checkForConsuming(),O.checkForConsuming()),S}swapEvents(){let K=this.rightSE;this.rightSE=this.leftSE,this.leftSE=K,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let S=0,T=this.windings.length;S 0){let O=S;S=T,T=O}if(S.prev===T){let O=S;S=T,T=O}for(let O=0,eA=T.rings.length;O V.length===1&&V[0].isSubject;this._isInResult=T(K)!==T(S);break}default:throw new Error(`Unrecognized operation type found ${hA.type}`)}return this._isInResult}}class nB{constructor(K,S,T){if(!Array.isArray(K)||K.length===0)throw new Error(\"Input geometry is not a valid Polygon or MultiPolygon\");if(this.poly=S,this.isExterior=T,this.segments=[],typeof K[0][0]!=\"number\"||typeof K[0][1]!=\"number\")throw new Error(\"Input geometry is not a valid Polygon or MultiPolygon\");let V=U.round(K[0][0],K[0][1]);this.bbox={ll:{x:V.x,y:V.y},ur:{x:V.x,y:V.y}};let O=V;for(let eA=1,BA=K.length;eA this.bbox.ur.x&&(this.bbox.ur.x=rA.x),rA.y>this.bbox.ur.y&&(this.bbox.ur.y=rA.y),O=rA)}(V.x!==O.x||V.y!==O.y)&&this.segments.push(YI.fromRing(O,V,this))}getSweepEvents(){let K=[];for(let S=0,T=this.segments.length;S this.bbox.ur.x&&(this.bbox.ur.x=O.bbox.ur.x),O.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=O.bbox.ur.y),this.interiorRings.push(O)}this.multiPoly=S}getSweepEvents(){let K=this.exteriorRing.getSweepEvents();for(let S=0,T=this.interiorRings.length;S this.bbox.ur.x&&(this.bbox.ur.x=O.bbox.ur.x),O.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=O.bbox.ur.y),this.polys.push(O)}this.isSubject=S}getSweepEvents(){let K=[];for(let S=0,T=this.polys.length;S 0&&(K=eA)}let S=K.segment.prevInResult(),T=S?S.prevInResult():null;for(;;){if(!S)return null;if(!T)return S.ringOut;if(T.ringOut!==S.ringOut)return T.ringOut.enclosingRing()!==S.ringOut?S.ringOut:S.ringOut.enclosingRing();S=T.prevInResult(),T=S?S.prevInResult():null}}}class xA{constructor(K){this.exteriorRing=K,K.poly=this,this.interiorRings=[]}addInterior(K){this.interiorRings.push(K),K.poly=this}getGeom(){let K=[this.exteriorRing.getGeom()];if(K[0]===null)return null;for(let S=0,T=this.interiorRings.length;S 1&&arguments[1]!==void 0?arguments[1]:YI.compare;this.queue=K,this.tree=new e(S),this.segments=[]}process(K){let S=K.segment,T=[];if(K.consumedBy)return K.isLeft?this.queue.remove(K.otherSE):this.tree.remove(S),T;let V=K.isLeft?this.tree.add(S):this.tree.find(S);if(!V)throw new Error(`Unable to find segment #${S.id} [${S.leftSE.point.x}, ${S.leftSE.point.y}] -> [${S.rightSE.point.x}, ${S.rightSE.point.y}] in SweepLine tree.`);let O=V,eA=V,BA,rA;for(;BA===void 0;)O=this.tree.prev(O),O===null?BA=null:O.key.consumedBy===void 0&&(BA=O.key);for(;rA===void 0;)eA=this.tree.next(eA),eA===null?rA=null:eA.key.consumedBy===void 0&&(rA=eA.key);if(K.isLeft){let DA=null;if(BA){let iA=BA.getIntersection(S);if(iA!==null&&(S.isAnEndpoint(iA)||(DA=iA),!BA.isAnEndpoint(iA))){let nA=this._splitSafely(BA,iA);for(let sA=0,VA=nA.length;sA 0?(this.tree.remove(S),T.push(K)):(this.segments.push(S),S.prev=BA)}else{if(BA&&rA){let DA=BA.getIntersection(rA);if(DA!==null){if(!BA.isAnEndpoint(DA)){let QA=this._splitSafely(BA,DA);for(let iA=0,nA=QA.length;iA cE)throw new Error(\"Infinite loop when putting segment endpoints in a priority queue (queue size too big).\")}let eA=new Gi(O),BA=O.size,rA=O.pop();for(;rA;){let iA=rA.key;if(O.size===BA){let sA=iA.segment;throw new Error(`Unable to pop() ${iA.isLeft?\"left\":\"right\"} SweepEvent [${iA.point.x}, ${iA.point.y}] from segment #${sA.id} [${sA.leftSE.point.x}, ${sA.leftSE.point.y}] -> [${sA.rightSE.point.x}, ${sA.rightSE.point.y}] from queue.`)}if(O.size>cE)throw new Error(\"Infinite loop when passing sweep line over endpoints (queue size too big).\");if(eA.segments.length>wi)throw new Error(\"Infinite loop when passing sweep line over endpoints (too many sweep line segments).\");let nA=eA.process(iA);for(let sA=0,VA=nA.length;sA 1?K-1:0),T=1;T 1?K-1:0),T=1;T 1?K-1:0),T=1;T 1?K-1:0),T=1;T {\"use strict\";var dDA=Object.prototype.hasOwnProperty,MC=\"~\";function w0(){}Object.create&&(w0.prototype=Object.create(null),new w0().__proto__||(MC=!1));function UDA(g,A,I){this.fn=g,this.context=A,this.once=I||!1}function LP(g,A,I,B,Q){if(typeof I!=\"function\")throw new TypeError(\"The listener must be a function\");var C=new UDA(I,B||g,Q),E=MC?MC+A:A;return g._events[E]?g._events[E].fn?g._events[E]=[g._events[E],C]:g._events[E].push(C):(g._events[E]=C,g._eventsCount++),g}function el(g,A){--g._eventsCount===0?g._events=new w0:delete g._events[A]}function PQ(){this._events=new w0,this._eventsCount=0}PQ.prototype.eventNames=function(){var A=[],I,B;if(this._eventsCount===0)return A;for(B in I=this._events)dDA.call(I,B)&&A.push(MC?B.slice(1):B);return Object.getOwnPropertySymbols?A.concat(Object.getOwnPropertySymbols(I)):A};PQ.prototype.listeners=function(A){var I=MC?MC+A:A,B=this._events[I];if(!B)return[];if(B.fn)return[B.fn];for(var Q=0,C=B.length,E=new Array(C);Q {(function(g,A){typeof qS==\"object\"&&typeof dS<\"u\"?dS.exports=A():(g=g||self).RBush=A()})(qS,function(){\"use strict\";function g(h,N,Y,M,l){(function J(U,x,q,P,Z){for(;P>q;){if(P-q>600){var X=P-q+1,L=x-q+1,j=Math.log(X),m=.5*Math.exp(2*j/3),$=.5*Math.sqrt(j*m*(X-m)/X)*(L-X/2<0?-1:1),NA=Math.max(q,Math.floor(x-L*m/X+$)),wA=Math.min(P,Math.floor(x+(X-L)*m/X+$));J(U,x,NA,wA,Z)}var FA=U[x],JA=q,z=P;for(A(U,q,x),Z(U[P],FA)>0&&A(U,q,P);JA 0;)z--}Z(U[q],FA)===0?A(U,q,z):A(U,++z,P),z<=x&&(q=z+1),x<=z&&(P=z-1)}})(h,N,Y||0,M||h.length-1,l||I)}function A(h,N,Y){var M=h[N];h[N]=h[Y],h[Y]=M}function I(h,N){return h N?1:0}var B=function(h){h===void 0&&(h=9),this._maxEntries=Math.max(4,h),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function Q(h,N,Y){if(!Y)return N.indexOf(h);for(var M=0;M =h.minX&&N.maxY>=h.minY}function k(h){return{children:h,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function F(h,N,Y,M,l){for(var J=[N,Y];J.length;)if(!((Y=J.pop())-(N=J.pop())<=M)){var U=N+Math.ceil((Y-N)/M/2)*M;g(h,U,N,Y,l),J.push(N,U,U,Y)}}return B.prototype.all=function(){return this._all(this.data,[])},B.prototype.search=function(h){var N=this.data,Y=[];if(!w(h,N))return Y;for(var M=this.toBBox,l=[];N;){for(var J=0;J =0&&l[N].children.length>this._maxEntries;)this._split(l,N),N--;this._adjustParentBBoxes(M,l,N)},B.prototype._split=function(h,N){var Y=h[N],M=Y.children.length,l=this._minEntries;this._chooseSplitAxis(Y,l,M);var J=this._chooseSplitIndex(Y,l,M),U=k(Y.children.splice(J,Y.children.length-J));U.height=Y.height,U.leaf=Y.leaf,C(Y,this.toBBox),C(U,this.toBBox),N?h[N-1].children.push(U):this._splitRoot(Y,U)},B.prototype._splitRoot=function(h,N){this.data=k([h,N]),this.data.height=h.height+1,this.data.leaf=!1,C(this.data,this.toBBox)},B.prototype._chooseSplitIndex=function(h,N,Y){for(var M,l,J,U,x,q,P,Z=1/0,X=1/0,L=N;L<=Y-N;L++){var j=E(h,0,L,this.toBBox),m=E(h,L,Y,this.toBBox),$=(l=j,J=m,U=void 0,x=void 0,q=void 0,P=void 0,U=Math.max(l.minX,J.minX),x=Math.max(l.minY,J.minY),q=Math.min(l.maxX,J.maxX),P=Math.min(l.maxY,J.maxY),Math.max(0,q-U)*Math.max(0,P-x)),NA=r(j)+r(m);$ =N;Z--){var X=h.children[Z];o(U,h.leaf?l(X):X),x+=n(U)}return x},B.prototype._adjustParentBBoxes=function(h,N,Y){for(var M=Y;M>=0;M--)o(N[M],h)},B.prototype._condense=function(h){for(var N=h.length-1,Y=void 0;N>=0;N--)h[N].children.length===0?N>0?(Y=h[N-1].children).splice(Y.indexOf(h[N]),1):this.clear():C(h[N],this.toBBox)},B})});var fS=FE($A=>{\"use strict\";Object.defineProperty($A,\"__esModule\",{value:!0});$A.earthRadius=63710088e-1;$A.factors={centimeters:$A.earthRadius*100,centimetres:$A.earthRadius*100,degrees:$A.earthRadius/111325,feet:$A.earthRadius*3.28084,inches:$A.earthRadius*39.37,kilometers:$A.earthRadius/1e3,kilometres:$A.earthRadius/1e3,meters:$A.earthRadius,metres:$A.earthRadius,miles:$A.earthRadius/1609.344,millimeters:$A.earthRadius*1e3,millimetres:$A.earthRadius*1e3,nauticalmiles:$A.earthRadius/1852,radians:1,yards:$A.earthRadius*1.0936};$A.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/$A.earthRadius,yards:1.0936133};$A.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function AD(g,A,I){I===void 0&&(I={});var B={type:\"Feature\"};return(I.id===0||I.id)&&(B.id=I.id),I.bbox&&(B.bbox=I.bbox),B.properties=A||{},B.geometry=g,B}$A.feature=AD;function LsA(g,A,I){switch(I===void 0&&(I={}),g){case\"Point\":return US(A).geometry;case\"LineString\":return LS(A).geometry;case\"Polygon\":return SS(A).geometry;case\"MultiPoint\":return aO(A).geometry;case\"MultiLineString\":return eO(A).geometry;case\"MultiPolygon\":return DO(A).geometry;default:throw new Error(g+\" is invalid\")}}$A.geometry=LsA;function US(g,A,I){if(I===void 0&&(I={}),!g)throw new Error(\"coordinates is required\");if(!Array.isArray(g))throw new Error(\"coordinates must be an Array\");if(g.length<2)throw new Error(\"coordinates must be at least 2 numbers long\");if(!pl(g[0])||!pl(g[1]))throw new Error(\"coordinates must contain numbers\");var B={type:\"Point\",coordinates:g};return AD(B,A,I)}$A.point=US;function HsA(g,A,I){return I===void 0&&(I={}),ql(g.map(function(B){return US(B,A)}),I)}$A.points=HsA;function SS(g,A,I){I===void 0&&(I={});for(var B=0,Q=g;B =0))throw new Error(\"precision must be a positive number\");var I=Math.pow(10,A||0);return Math.round(g*I)/I}$A.round=xsA;function sO(g,A){A===void 0&&(A=\"kilometers\");var I=$A.factors[A];if(!I)throw new Error(A+\" units is invalid\");return g*I}$A.radiansToLength=sO;function HS(g,A){A===void 0&&(A=\"kilometers\");var I=$A.factors[A];if(!I)throw new Error(A+\" units is invalid\");return g/I}$A.lengthToRadians=HS;function bsA(g,A){return rO(HS(g,A))}$A.lengthToDegrees=bsA;function TsA(g){var A=g%360;return A<0&&(A+=360),A}$A.bearingToAzimuth=TsA;function rO(g){var A=g%(2*Math.PI);return A*180/Math.PI}$A.radiansToDegrees=rO;function WsA(g){var A=g%360;return A*Math.PI/180}$A.degreesToRadians=WsA;function ZsA(g,A,I){if(A===void 0&&(A=\"kilometers\"),I===void 0&&(I=\"kilometers\"),!(g>=0))throw new Error(\"length must be a positive number\");return sO(HS(g,A),I)}$A.convertLength=ZsA;function PsA(g,A,I){if(A===void 0&&(A=\"meters\"),I===void 0&&(I=\"kilometers\"),!(g>=0))throw new Error(\"area must be a positive number\");var B=$A.areaFactors[A];if(!B)throw new Error(\"invalid original units\");var Q=$A.areaFactors[I];if(!Q)throw new Error(\"invalid final units\");return g/B*Q}$A.convertArea=PsA;function pl(g){return!isNaN(g)&&g!==null&&!Array.isArray(g)}$A.isNumber=pl;function OsA(g){return!!g&&g.constructor===Object}$A.isObject=OsA;function VsA(g){if(!g)throw new Error(\"bbox is required\");if(!Array.isArray(g))throw new Error(\"bbox must be an Array\");if(g.length!==4&&g.length!==6)throw new Error(\"bbox must be an Array of 4 or 6 numbers\");g.forEach(function(A){if(!pl(A))throw new Error(\"bbox must only contain numbers\")})}$A.validateBBox=VsA;function vsA(g){if(!g)throw new Error(\"id is required\");if([\"string\",\"number\"].indexOf(typeof g)===-1)throw new Error(\"id must be a number or a string\")}$A.validateId=vsA});var hO=FE(PB=>{\"use strict\";Object.defineProperty(PB,\"__esModule\",{value:!0});var OQ=fS();function p0(g,A,I){if(g!==null)for(var B,Q,C,E,o,e,D,r=0,n=0,G,w=g.type,k=w===\"FeatureCollection\",F=w===\"Feature\",h=k?g.features.length:1,N=0;N e||k>D||F>r){o=n,e=B,D=k,r=F,C=0;return}var h=OQ.lineString([o,n],I.properties);if(A(h,B,Q,F,C)===!1)return!1;C++,o=n})===!1)return!1}}})}function grA(g,A,I){var B=I,Q=!1;return GO(g,function(C,E,o,e,D){Q===!1&&I===void 0?B=C:B=A(B,C,E,o,e,D),Q=!0}),B}function wO(g,A){if(!g)throw new Error(\"geojson is required\");dl(g,function(I,B,Q){if(I.geometry!==null){var C=I.geometry.type,E=I.geometry.coordinates;switch(C){case\"LineString\":if(A(I,B,Q,0,0)===!1)return!1;break;case\"Polygon\":for(var o=0;o {\"use strict\";Object.defineProperty(Ag,\"__esModule\",{value:!0});Ag.earthRadius=63710088e-1;Ag.factors={centimeters:Ag.earthRadius*100,centimetres:Ag.earthRadius*100,degrees:Ag.earthRadius/111325,feet:Ag.earthRadius*3.28084,inches:Ag.earthRadius*39.37,kilometers:Ag.earthRadius/1e3,kilometres:Ag.earthRadius/1e3,meters:Ag.earthRadius,metres:Ag.earthRadius,miles:Ag.earthRadius/1609.344,millimeters:Ag.earthRadius*1e3,millimetres:Ag.earthRadius*1e3,nauticalmiles:Ag.earthRadius/1852,radians:1,yards:Ag.earthRadius*1.0936};Ag.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ag.earthRadius,yards:1.0936133};Ag.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function gD(g,A,I){I===void 0&&(I={});var B={type:\"Feature\"};return(I.id===0||I.id)&&(B.id=I.id),I.bbox&&(B.bbox=I.bbox),B.properties=A||{},B.geometry=g,B}Ag.feature=gD;function CrA(g,A,I){switch(I===void 0&&(I={}),g){case\"Point\":return mS(A).geometry;case\"LineString\":return bS(A).geometry;case\"Polygon\":return xS(A).geometry;case\"MultiPoint\":return kO(A).geometry;case\"MultiLineString\":return NO(A).geometry;case\"MultiPolygon\":return yO(A).geometry;default:throw new Error(g+\" is invalid\")}}Ag.geometry=CrA;function mS(g,A,I){if(I===void 0&&(I={}),!g)throw new Error(\"coordinates is required\");if(!Array.isArray(g))throw new Error(\"coordinates must be an Array\");if(g.length<2)throw new Error(\"coordinates must be at least 2 numbers long\");if(!Ul(g[0])||!Ul(g[1]))throw new Error(\"coordinates must contain numbers\");var B={type:\"Point\",coordinates:g};return gD(B,A,I)}Ag.point=mS;function ErA(g,A,I){return I===void 0&&(I={}),Sl(g.map(function(B){return mS(B,A)}),I)}Ag.points=ErA;function xS(g,A,I){I===void 0&&(I={});for(var B=0,Q=g;B =0))throw new Error(\"precision must be a positive number\");var I=Math.pow(10,A||0);return Math.round(g*I)/I}Ag.round=erA;function FO(g,A){A===void 0&&(A=\"kilometers\");var I=Ag.factors[A];if(!I)throw new Error(A+\" units is invalid\");return g*I}Ag.radiansToLength=FO;function TS(g,A){A===void 0&&(A=\"kilometers\");var I=Ag.factors[A];if(!I)throw new Error(A+\" units is invalid\");return g/I}Ag.lengthToRadians=TS;function arA(g,A){return RO(TS(g,A))}Ag.lengthToDegrees=arA;function DrA(g){var A=g%360;return A<0&&(A+=360),A}Ag.bearingToAzimuth=DrA;function RO(g){var A=g%(2*Math.PI);return A*180/Math.PI}Ag.radiansToDegrees=RO;function srA(g){var A=g%360;return A*Math.PI/180}Ag.degreesToRadians=srA;function rrA(g,A,I){if(A===void 0&&(A=\"kilometers\"),I===void 0&&(I=\"kilometers\"),!(g>=0))throw new Error(\"length must be a positive number\");return FO(TS(g,A),I)}Ag.convertLength=rrA;function nrA(g,A,I){if(A===void 0&&(A=\"meters\"),I===void 0&&(I=\"kilometers\"),!(g>=0))throw new Error(\"area must be a positive number\");var B=Ag.areaFactors[A];if(!B)throw new Error(\"invalid original units\");var Q=Ag.areaFactors[I];if(!Q)throw new Error(\"invalid final units\");return g/B*Q}Ag.convertArea=nrA;function Ul(g){return!isNaN(g)&&g!==null&&!Array.isArray(g)}Ag.isNumber=Ul;function crA(g){return!!g&&g.constructor===Object}Ag.isObject=crA;function GrA(g){if(!g)throw new Error(\"bbox is required\");if(!Array.isArray(g))throw new Error(\"bbox must be an Array\");if(g.length!==4&&g.length!==6)throw new Error(\"bbox must be an Array of 4 or 6 numbers\");g.forEach(function(A){if(!Ul(A))throw new Error(\"bbox must only contain numbers\")})}Ag.validateBBox=GrA;function wrA(g){if(!g)throw new Error(\"id is required\");if([\"string\",\"number\"].indexOf(typeof g)===-1)throw new Error(\"id must be a number or a string\")}Ag.validateId=wrA});var pO=FE(OB=>{\"use strict\";Object.defineProperty(OB,\"__esModule\",{value:!0});var VQ=MO();function q0(g,A,I){if(g!==null)for(var B,Q,C,E,o,e,D,r=0,n=0,G,w=g.type,k=w===\"FeatureCollection\",F=w===\"Feature\",h=k?g.features.length:1,N=0;N e||k>D||F>r){o=n,e=B,D=k,r=F,C=0;return}var h=VQ.lineString([o,n],I.properties);if(A(h,B,Q,F,C)===!1)return!1;C++,o=n})===!1)return!1}}})}function MrA(g,A,I){var B=I,Q=!1;return YO(g,function(C,E,o,e,D){Q===!1&&I===void 0?B=C:B=A(B,C,E,o,e,D),Q=!0}),B}function KO(g,A){if(!g)throw new Error(\"geojson is required\");Ll(g,function(I,B,Q){if(I.geometry!==null){var C=I.geometry.type,E=I.geometry.coordinates;switch(C){case\"LineString\":if(A(I,B,Q,0,0)===!1)return!1;break;case\"Polygon\":for(var o=0;o {\"use strict\";Object.defineProperty(PS,\"__esModule\",{value:!0});var KrA=pO();function ZS(g){var A=[1/0,1/0,-1/0,-1/0];return KrA.coordEach(g,function(I){A[0]>I[0]&&(A[0]=I[0]),A[1]>I[1]&&(A[1]=I[1]),A[2]{var Gt=tO(),UO=fS(),SO=hO(),Vn=qO().default,prA=SO.featureEach,hrg=SO.coordEach,Nrg=UO.polygon,dO=UO.featureCollection;function LO(g){var A=new Gt(g);return A.insert=function(I){if(I.type!==\"Feature\")throw new Error(\"invalid feature\");return I.bbox=I.bbox?I.bbox:Vn(I),Gt.prototype.insert.call(this,I)},A.load=function(I){var B=[];return Array.isArray(I)?I.forEach(function(Q){if(Q.type!==\"Feature\")throw new Error(\"invalid features\");Q.bbox=Q.bbox?Q.bbox:Vn(Q),B.push(Q)}):prA(I,function(Q){if(Q.type!==\"Feature\")throw new Error(\"invalid features\");Q.bbox=Q.bbox?Q.bbox:Vn(Q),B.push(Q)}),Gt.prototype.load.call(this,B)},A.remove=function(I,B){if(I.type!==\"Feature\")throw new Error(\"invalid feature\");return I.bbox=I.bbox?I.bbox:Vn(I),Gt.prototype.remove.call(this,I,B)},A.clear=function(){return Gt.prototype.clear.call(this)},A.search=function(I){var B=Gt.prototype.search.call(this,this.toBBox(I));return dO(B)},A.collides=function(I){return Gt.prototype.collides.call(this,this.toBBox(I))},A.all=function(){var I=Gt.prototype.all.call(this);return dO(I)},A.toJSON=function(){return Gt.prototype.toJSON.call(this)},A.fromJSON=function(I){return Gt.prototype.fromJSON.call(this,I)},A.toBBox=function(I){var B;if(I.bbox)B=I.bbox;else if(Array.isArray(I)&&I.length===4)B=I;else if(Array.isArray(I)&&I.length===6)B=[I[0],I[1],I[3],I[4]];else if(I.type===\"Feature\")B=Vn(I);else if(I.type===\"FeatureCollection\")B=Vn(I);else throw new Error(\"invalid geojson\");return{minX:B[0],minY:B[1],maxX:B[2],maxY:B[3]}},A}OS.exports=LO;OS.exports.default=LO});var $O=FE((tGg,_O)=>{var zO=\"Expected a function\",jO=NaN,TrA=\"[object Symbol]\",WrA=/^\\s+|\\s+$/g,ZrA=/^[-+]0x[0-9a-f]+$/i,PrA=/^0b[01]+$/i,OrA=/^0o[0-7]+$/i,VrA=parseInt,vrA=typeof global==\"object\"&&global&&global.Object===Object&&global,jrA=typeof self==\"object\"&&self&&self.Object===Object&&self,XrA=vrA||jrA||Function(\"return this\")(),zrA=Object.prototype,_rA=zrA.toString,$rA=Math.max,AnA=Math.min,_S=function(){return XrA.Date.now()};function gnA(g,A,I){var B,Q,C,E,o,e,D=0,r=!1,n=!1,G=!0;if(typeof g!=\"function\")throw new TypeError(zO);A=XO(A)||0,bl(I)&&(r=!!I.leading,n=\"maxWait\"in I,C=n?$rA(XO(I.maxWait)||0,A):C,G=\"trailing\"in I?!!I.trailing:G);function w(U){var x=B,q=Q;return B=Q=void 0,D=U,E=g.apply(q,x),E}function k(U){return D=U,o=setTimeout(N,A),r?w(U):E}function F(U){var x=U-e,q=U-D,P=A-x;return n?AnA(P,C-q):P}function h(U){var x=U-e,q=U-D;return e===void 0||x>=A||x<0||n&&q>=C}function N(){var U=_S();if(h(U))return Y(U);o=setTimeout(N,F(U))}function Y(U){return o=void 0,G&&B?w(U):(B=Q=void 0,E)}function M(){o!==void 0&&clearTimeout(o),D=0,B=e=Q=o=void 0}function l(){return o===void 0?E:Y(_S())}function J(){var U=_S(),x=h(U);if(B=arguments,Q=this,e=U,x){if(o===void 0)return k(e);if(n)return o=setTimeout(N,A),w(e)}return o===void 0&&(o=setTimeout(N,A)),E}return J.cancel=M,J.flush=l,J}function InA(g,A,I){var B=!0,Q=!0;if(typeof g!=\"function\")throw new TypeError(zO);return bl(I)&&(B=\"leading\"in I?!!I.leading:B,Q=\"trailing\"in I?!!I.trailing:Q),gnA(g,A,{leading:B,maxWait:A,trailing:Q})}function bl(g){var A=typeof g;return!!g&&(A==\"object\"||A==\"function\")}function BnA(g){return!!g&&typeof g==\"object\"}function QnA(g){return typeof g==\"symbol\"||BnA(g)&&_rA.call(g)==TrA}function XO(g){if(typeof g==\"number\")return g;if(QnA(g))return jO;if(bl(g)){var A=typeof g.valueOf==\"function\"?g.valueOf():g;g=bl(A)?A+\"\":A}if(typeof g!=\"string\")return g===0?g:+g;g=g.replace(WrA,\"\");var I=PrA.test(g);return I||OrA.test(g)?VrA(g.slice(2),I?2:8):ZrA.test(g)?jO:+g}_O.exports=InA});function hD(g,A){return g==null||A==null?NaN:gA?1:g>=A?0:NaN}function CJ(g,A){return g==null||A==null?NaN:A g?1:A>=g?0:NaN}function EN(g){let A,I,B;g.length!==2?(A=hD,I=(o,e)=>hD(g(o),e),B=(o,e)=>g(o)-e):(A=g===hD||g===CJ?g:Kv,I=g,B=g);function Q(o,e,D=0,r=o.length){if(D >>1;I(o[n],e)<0?D=n+1:r=n}while(D >>1;I(o[n],e)<=0?D=n+1:r=n}while(D D&&B(o[n-1],e)>-B(o[n],e)?n-1:n}return{left:Q,center:E,right:C}}function Kv(){return 0}function EJ(g){return g===null?NaN:+g}var lL=EN(hD),JL=lL.right,pv=lL.left,qv=EN(EJ).center,iJ=JL;var Ws=class extends Map{constructor(A,I=Sv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:I}}),A!=null)for(let[B,Q]of A)this.set(B,Q)}get(A){return super.get(YL(this,A))}has(A){return super.has(YL(this,A))}set(A,I){return super.set(dv(this,A),I)}delete(A){return super.delete(Uv(this,A))}};function YL({_intern:g,_key:A},I){let B=A(I);return g.has(B)?g.get(B):I}function dv({_intern:g,_key:A},I){let B=A(I);return g.has(B)?g.get(B):(g.set(B,I),I)}function Uv({_intern:g,_key:A},I){let B=A(I);return g.has(B)&&(I=g.get(B),g.delete(B)),I}function Sv(g){return g!==null&&typeof g==\"object\"?g.valueOf():g}var Lv=Math.sqrt(50),Hv=Math.sqrt(10),fv=Math.sqrt(2);function iN(g,A,I){let B=(A-g)/Math.max(0,I),Q=Math.floor(Math.log10(B)),C=B/Math.pow(10,Q),E=C>=Lv?10:C>=Hv?5:C>=fv?2:1,o,e,D;return Q<0?(D=Math.pow(10,-Q)/E,o=Math.round(g*D),e=Math.round(A*D),o/D A&&--e,D=-D):(D=Math.pow(10,Q)*E,o=Math.round(g/D),e=Math.round(A/D),o*D A&&--e),e 0))return[];if(g===A)return[g];let B=A =Q))return[];let o=C-Q+1,e=new Array(o);if(B)if(E<0)for(let D=0;D =B)&&(I=B);else{let B=-1;for(let Q of g)(Q=A(Q,++B,g))!=null&&(I =Q)&&(I=Q)}return I}function jE(g,A){let I;if(A===void 0)for(let B of g)B!=null&&(I>B||I===void 0&&B>=B)&&(I=B);else{let B=-1;for(let Q of g)(Q=A(Q,++B,g))!=null&&(I>Q||I===void 0&&Q>=Q)&&(I=Q)}return I}function ND(g,A,I){g=+g,A=+A,I=(Q=arguments.length)<2?(A=g,g=0,1):Q<3?1:+I;for(var B=-1,Q=Math.max(0,Math.ceil((A-g)/I))|0,C=new Array(Q);++B{}};function pL(){for(var g=0,A=arguments.length,I={},B;g=0&&(B=I.slice(Q+1),I=I.slice(0,Q)),I&&!A.hasOwnProperty(I))throw new Error(\"unknown type: \"+I);return{type:I,name:B}})}tN.prototype=pL.prototype={constructor:tN,on:function(g,A){var I=this._,B=mv(g+\"\",I),Q,C=-1,E=B.length;if(arguments.length<2){for(;++C0)for(var I=new Array(Q),B=0,Q,C;B =0&&(A=g.slice(0,I))!==\"xmlns\"&&(g=g.slice(I+1)),eJ.hasOwnProperty(A)?{space:eJ[A],local:g}:g}function bv(g){return function(){var A=this.ownerDocument,I=this.namespaceURI;return I===eN&&A.documentElement.namespaceURI===eN?A.createElement(g):A.createElementNS(I,g)}}function Tv(g){return function(){return this.ownerDocument.createElementNS(g.space,g.local)}}function Zs(g){var A=Ut(g);return(A.local?Tv:bv)(A)}function Wv(){}function kD(g){return g==null?Wv:function(){return this.querySelector(g)}}function qL(g){typeof g!=\"function\"&&(g=kD(g));for(var A=this._groups,I=A.length,B=new Array(I),Q=0;Q=M&&(M=Y+1);!(J=h[M])&&++M=0;)(E=B[Q])&&(C&&E.compareDocumentPosition(C)^4&&C.parentNode.insertBefore(E,C),C=E);return this}function WL(g){g||(g=Ij);function A(n,G){return n&&G?g(n.__data__,G.__data__):!n-!G}for(var I=this._groups,B=I.length,Q=new Array(B),C=0;CA?1:g>=A?0:NaN}function ZL(){var g=arguments[0];return arguments[0]=this,g.apply(null,arguments),this}function PL(){return Array.from(this)}function OL(){for(var g=this._groups,A=0,I=g.length;A1?this.each((A==null?tj:typeof A==\"function\"?aj:ej)(g,A,I??\"\")):Xe(this.node(),g)}function Xe(g,A){return g.style.getPropertyValue(A)||sN(g).getComputedStyle(g,null).getPropertyValue(A)}function Dj(g){return function(){delete this[g]}}function sj(g,A){return function(){this[g]=A}}function rj(g,A){return function(){var I=A.apply(this,arguments);I==null?delete this[g]:this[g]=I}}function _L(g,A){return arguments.length>1?this.each((A==null?Dj:typeof A==\"function\"?rj:sj)(g,A)):this.node()[g]}function $L(g){return g.trim().split(/^|\\s+/)}function aJ(g){return g.classList||new AH(g)}function AH(g){this._node=g,this._names=$L(g.getAttribute(\"class\")||\"\")}AH.prototype={add:function(g){var A=this._names.indexOf(g);A<0&&(this._names.push(g),this._node.setAttribute(\"class\",this._names.join(\" \")))},remove:function(g){var A=this._names.indexOf(g);A>=0&&(this._names.splice(A,1),this._node.setAttribute(\"class\",this._names.join(\" \")))},contains:function(g){return this._names.indexOf(g)>=0}};function gH(g,A){for(var I=aJ(g),B=-1,Q=A.length;++B =0&&(I=A.slice(B+1),A=A.slice(0,B)),{type:A,name:I}})}function dj(g){return function(){var A=this.__on;if(A){for(var I=0,B=-1,Q=A.length,C;I>8&15|A>>4&240,A>>4&15|A&240,(A&15)<<4|A&15,1):I===8?nN(A>>24&255,A>>16&255,A>>8&255,(A&255)/255):I===4?nN(A>>12&15|A>>8&240,A>>8&15|A>>4&240,A>>4&15|A&240,((A&15)<<4|A&15)/255):null):(A=uj.exec(g))?new _C(A[1],A[2],A[3],1):(A=mj.exec(g))?new _C(A[1]*255/100,A[2]*255/100,A[3]*255/100,1):(A=xj.exec(g))?nN(A[1],A[2],A[3],A[4]):(A=bj.exec(g))?nN(A[1]*255/100,A[2]*255/100,A[3]*255/100,A[4]):(A=Tj.exec(g))?RH(A[1],A[2]/100,A[3]/100,1):(A=Wj.exec(g))?RH(A[1],A[2]/100,A[3]/100,A[4]):wH.hasOwnProperty(g)?kH(wH[g]):g===\"transparent\"?new _C(NaN,NaN,NaN,0):null}function kH(g){return new _C(g>>16&255,g>>8&255,g&255,1)}function nN(g,A,I,B){return B<=0&&(g=A=I=NaN),new _C(g,A,I,B)}function Oj(g){return g instanceof yc||(g=pi(g)),g?(g=g.rgb(),new _C(g.r,g.g,g.b,g.opacity)):new _C}function Os(g,A,I,B){return arguments.length===1?Oj(g):new _C(g,A,I,B??1)}function _C(g,A,I,B){this.r=+g,this.g=+A,this.b=+I,this.opacity=+B}rN(_C,Os,sJ(yc,{brighter(g){return g=g==null?GN:Math.pow(GN,g),new _C(this.r*g,this.g*g,this.b*g,this.opacity)},darker(g){return g=g==null?Nc:Math.pow(Nc,g),new _C(this.r*g,this.g*g,this.b*g,this.opacity)},rgb(){return this},clamp(){return new _C(FD(this.r),FD(this.g),FD(this.b),wN(this.opacity))},displayable(){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:yH,formatHex:yH,formatHex8:Vj,formatRgb:FH,toString:FH}));function yH(){return`#${yD(this.r)}${yD(this.g)}${yD(this.b)}`}function Vj(){return`#${yD(this.r)}${yD(this.g)}${yD(this.b)}${yD((isNaN(this.opacity)?1:this.opacity)*255)}`}function FH(){let g=wN(this.opacity);return`${g===1?\"rgb(\":\"rgba(\"}${FD(this.r)}, ${FD(this.g)}, ${FD(this.b)}${g===1?\")\":`, ${g})`}`}function wN(g){return isNaN(g)?1:Math.max(0,Math.min(1,g))}function FD(g){return Math.max(0,Math.min(255,Math.round(g)||0))}function yD(g){return g=FD(g),(g<16?\"0\":\"\")+g.toString(16)}function RH(g,A,I,B){return B<=0?g=A=I=NaN:I<=0||I>=1?g=A=NaN:A<=0&&(g=NaN),new Ki(g,A,I,B)}function lH(g){if(g instanceof Ki)return new Ki(g.h,g.s,g.l,g.opacity);if(g instanceof yc||(g=pi(g)),!g)return new Ki;if(g instanceof Ki)return g;g=g.rgb();var A=g.r/255,I=g.g/255,B=g.b/255,Q=Math.min(A,I,B),C=Math.max(A,I,B),E=NaN,o=C-Q,e=(C+Q)/2;return o?(A===C?E=(I-B)/o+(I0&&e<1?0:E,new Ki(E,o,e,g.opacity)}function JH(g,A,I,B){return arguments.length===1?lH(g):new Ki(g,A,I,B??1)}function Ki(g,A,I,B){this.h=+g,this.s=+A,this.l=+I,this.opacity=+B}rN(Ki,JH,sJ(yc,{brighter(g){return g=g==null?GN:Math.pow(GN,g),new Ki(this.h,this.s,this.l*g,this.opacity)},darker(g){return g=g==null?Nc:Math.pow(Nc,g),new Ki(this.h,this.s,this.l*g,this.opacity)},rgb(){var g=this.h%360+(this.h<0)*360,A=isNaN(g)||isNaN(this.s)?0:this.s,I=this.l,B=I+(I<.5?I:1-I)*A,Q=2*I-B;return new _C(rJ(g>=240?g-240:g+120,Q,B),rJ(g,Q,B),rJ(g<120?g+240:g-120,Q,B),this.opacity)},clamp(){return new Ki(MH(this.h),cN(this.s),cN(this.l),wN(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let g=wN(this.opacity);return`${g===1?\"hsl(\":\"hsla(\"}${MH(this.h)}, ${cN(this.s)*100}%, ${cN(this.l)*100}%${g===1?\")\":`, ${g})`}`}}));function MH(g){return g=(g||0)%360,g<0?g+360:g}function cN(g){return Math.max(0,Math.min(1,g||0))}function rJ(g,A,I){return(g<60?A+(I-A)*g/60:g<180?I:g<240?A+(I-A)*(240-g)/60:A)*255}function nJ(g,A,I,B,Q){var C=g*g,E=C*g;return((1-3*g+3*C-E)*A+(4-6*C+3*E)*I+(1+3*g+3*C-3*E)*B+E*Q)/6}function YH(g){var A=g.length-1;return function(I){var B=I<=0?I=0:I>=1?(I=1,A-1):Math.floor(I*A),Q=g[B],C=g[B+1],E=B>0?g[B-1]:2*Q-C,o=B()=>g;function vj(g,A){return function(I){return g+I*A}}function jj(g,A,I){return g=Math.pow(g,I),A=Math.pow(A,I)-g,I=1/I,function(B){return Math.pow(g+B*A,I)}}function pH(g){return(g=+g)==1?hN:function(A,I){return I-A?jj(A,I,g):Fc(isNaN(A)?I:A)}}function hN(g,A){var I=A-g;return I?vj(g,I):Fc(isNaN(g)?A:g)}var RD=function g(A){var I=pH(A);function B(Q,C){var E=I((Q=Os(Q)).r,(C=Os(C)).r),o=I(Q.g,C.g),e=I(Q.b,C.b),D=hN(Q.opacity,C.opacity);return function(r){return Q.r=E(r),Q.g=o(r),Q.b=e(r),Q.opacity=D(r),Q+\"\"}}return B.gamma=g,B}(1);function qH(g){return function(A){var I=A.length,B=new Array(I),Q=new Array(I),C=new Array(I),E,o;for(E=0;EI&&(C=A.slice(I,C),o[E]?o[E]+=C:o[++E]=C),(B=B[0])===(Q=Q[0])?o[E]?o[E]+=Q:o[++E]=Q:(o[++E]=null,e.push({i:E,x:cQ(B,Q)})),I=cJ.lastIndex;return I 180?r+=360:r-D>180&&(D+=360),G.push({i:n.push(Q(n)+\"rotate(\",null,B)-2,x:cQ(D,r)})):r&&n.push(Q(n)+\"rotate(\"+r+B)}function o(D,r,n,G){D!==r?G.push({i:n.push(Q(n)+\"skewX(\",null,B)-2,x:cQ(D,r)}):r&&n.push(Q(n)+\"skewX(\"+r+B)}function e(D,r,n,G,w,k){if(D!==n||r!==G){var F=w.push(Q(w)+\"scale(\",null,\",\",null,\")\");k.push({i:F-4,x:cQ(D,n)},{i:F-2,x:cQ(r,G)})}else(n!==1||G!==1)&&w.push(Q(w)+\"scale(\"+n+\",\"+G+\")\")}return function(D,r){var n=[],G=[];return D=g(D),r=g(r),C(D.translateX,D.translateY,r.translateX,r.translateY,n,G),E(D.rotate,r.rotate,n,G),o(D.skewX,r.skewX,n,G),e(D.scaleX,D.scaleY,r.scaleX,r.scaleY,n,G),D=r=null,function(w){for(var k=-1,F=G.length,h;++k =0&&g._call.call(void 0,A),g=g._next;--Vs}function bH(){lD=(FN=Yc.now())+RN,Vs=lc=0;try{ZH()}finally{Vs=0,I9(),lD=0}}function g9(){var g=Yc.now(),A=g-FN;A>TH&&(RN-=A,FN=g)}function I9(){for(var g,A=yN,I,B=1/0;A;)A._call?(B>A._time&&(B=A._time),g=A,A=A._next):(I=A._next,A._next=null,A=g?g._next=I:yN=I);Jc=g,yJ(B)}function yJ(g){if(!Vs){lc&&(lc=clearTimeout(lc));var A=g-lD;A>24?(g<1/0&&(lc=setTimeout(bH,g-Yc.now()-RN)),Mc&&(Mc=clearInterval(Mc))):(Mc||(FN=Yc.now(),Mc=setInterval(g9,TH)),Vs=1,WH(bH))}}function lN(g,A,I){var B=new Kc;return A=A==null?0:+A,B.restart(Q=>{B.stop(),g(Q+A)},A,I),B}var B9=tJ(\"start\",\"end\",\"cancel\",\"interrupt\"),Q9=[],VH=0,PH=1,YN=2,JN=3,OH=4,KN=5,qc=6;function _e(g,A,I,B,Q,C){var E=g.__transition;if(!E)g.__transition={};else if(I in E)return;C9(g,I,{name:A,index:B,group:Q,on:B9,tween:Q9,time:C.time,delay:C.delay,duration:C.duration,ease:C.ease,timer:null,state:VH})}function dc(g,A){var I=mB(g,A);if(I.state>VH)throw new Error(\"too late; already scheduled\");return I}function GQ(g,A){var I=mB(g,A);if(I.state>JN)throw new Error(\"too late; already running\");return I}function mB(g,A){var I=g.__transition;if(!I||!(I=I[A]))throw new Error(\"transition not found\");return I}function C9(g,A,I){var B=g.__transition,Q;B[A]=I,I.timer=MN(C,0,I.time);function C(D){I.state=PH,I.timer.restart(E,I.delay,I.time),I.delay<=D&&E(D-I.delay)}function E(D){var r,n,G,w;if(I.state!==PH)return e();for(r in B)if(w=B[r],w.name===I.name){if(w.state===JN)return lN(E);w.state===OH?(w.state=qc,w.timer.stop(),w.on.call(\"interrupt\",g,g.__data__,w.index,w.group),delete B[r]):+rYN&&B.state =0&&(A=A.slice(0,I)),!A||A===\"start\"})}function M9(g,A,I){var B,Q,C=R9(A)?dc:GQ;return function(){var E=C(this,g),o=E.on;o!==B&&(Q=(B=o).copy()).on(A,I),E.on=Q}}function Qf(g,A){var I=this._id;return arguments.length<2?mB(this.node(),I).on.on(g):this.each(M9(I,g,A))}function l9(g){return function(){var A=this.parentNode;for(var I in this.__transition)if(+I!==g)return;A&&A.removeChild(this)}}function Cf(){return this.on(\"end.remove\",l9(this._id))}function Ef(g){var A=this._name,I=this._id;typeof g!=\"function\"&&(g=kD(g));for(var B=this._groups,Q=B.length,C=new Array(Q),E=0;E =1e21?g.toLocaleString(\"en\").replace(/,/g,\"\"):g.toString(10)}function JD(g,A){if((I=(g=A?g.toExponential(A-1):g.toExponential()).indexOf(\"e\"))<0)return null;var I,B=g.slice(0,I);return[B.length>1?B[0]+B.slice(2):B,+g.slice(I+1)]}function Jo(g){return g=JD(Math.abs(g)),g?g[1]:NaN}function kf(g,A){return function(I,B){for(var Q=I.length,C=[],E=0,o=g[0],e=0;Q>0&&o>0&&(e+o+1>B&&(o=Math.max(1,B-e)),C.push(I.substring(Q-=o,Q+o)),!((e+=o+1)>B));)o=g[E=(E+1)%g.length];return C.reverse().join(A)}}function yf(g){return function(A){return A.replace(/[0-9]/g,function(I){return g[+I]})}}var T9=/^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;function $e(g){if(!(A=T9.exec(g)))throw new Error(\"invalid format: \"+g);var A;return new UN({fill:A[1],align:A[2],sign:A[3],symbol:A[4],zero:A[5],width:A[6],comma:A[7],precision:A[8]&&A[8].slice(1),trim:A[9],type:A[10]})}$e.prototype=UN.prototype;function UN(g){this.fill=g.fill===void 0?\" \":g.fill+\"\",this.align=g.align===void 0?\">\":g.align+\"\",this.sign=g.sign===void 0?\"-\":g.sign+\"\",this.symbol=g.symbol===void 0?\"\":g.symbol+\"\",this.zero=!!g.zero,this.width=g.width===void 0?void 0:+g.width,this.comma=!!g.comma,this.precision=g.precision===void 0?void 0:+g.precision,this.trim=!!g.trim,this.type=g.type===void 0?\"\":g.type+\"\"}UN.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?\"0\":\"\")+(this.width===void 0?\"\":Math.max(1,this.width|0))+(this.comma?\",\":\"\")+(this.precision===void 0?\"\":\".\"+Math.max(0,this.precision|0))+(this.trim?\"~\":\"\")+this.type};function Ff(g){A:for(var A=g.length,I=1,B=-1,Q;I0&&(B=0);break}return B>0?g.slice(0,B)+g.slice(Q+1):g}var RJ;function Rf(g,A){var I=JD(g,A);if(!I)return g+\"\";var B=I[0],Q=I[1],C=Q-(RJ=Math.max(-8,Math.min(8,Math.floor(Q/3)))*3)+1,E=B.length;return C===E?B:C>E?B+new Array(C-E+1).join(\"0\"):C>0?B.slice(0,C)+\".\"+B.slice(C):\"0.\"+new Array(1-C).join(\"0\")+JD(g,Math.max(0,A+C-1))[0]}function MJ(g,A){var I=JD(g,A);if(!I)return g+\"\";var B=I[0],Q=I[1];return Q<0?\"0.\"+new Array(-Q).join(\"0\")+B:B.length>Q+1?B.slice(0,Q+1)+\".\"+B.slice(Q+1):B+new Array(Q-B.length+2).join(\"0\")}var lJ={\"%\":(g,A)=>(g*100).toFixed(A),b:g=>Math.round(g).toString(2),c:g=>g+\"\",d:Nf,e:(g,A)=>g.toExponential(A),f:(g,A)=>g.toFixed(A),g:(g,A)=>g.toPrecision(A),o:g=>Math.round(g).toString(8),p:(g,A)=>MJ(g*100,A),r:MJ,s:Rf,X:g=>Math.round(g).toString(16).toUpperCase(),x:g=>Math.round(g).toString(16)};function JJ(g){return g}var Mf=Array.prototype.map,lf=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\\xB5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];function Jf(g){var A=g.grouping===void 0||g.thousands===void 0?JJ:kf(Mf.call(g.grouping,Number),g.thousands+\"\"),I=g.currency===void 0?\"\":g.currency[0]+\"\",B=g.currency===void 0?\"\":g.currency[1]+\"\",Q=g.decimal===void 0?\".\":g.decimal+\"\",C=g.numerals===void 0?JJ:yf(Mf.call(g.numerals,String)),E=g.percent===void 0?\"%\":g.percent+\"\",o=g.minus===void 0?\"\\u2212\":g.minus+\"\",e=g.nan===void 0?\"NaN\":g.nan+\"\";function D(n){n=$e(n);var G=n.fill,w=n.align,k=n.sign,F=n.symbol,h=n.zero,N=n.width,Y=n.comma,M=n.precision,l=n.trim,J=n.type;J===\"n\"?(Y=!0,J=\"g\"):lJ[J]||(M===void 0&&(M=12),l=!0,J=\"g\"),(h||G===\"0\"&&w===\"=\")&&(h=!0,G=\"0\",w=\"=\");var U=F===\"$\"?I:F===\"#\"&&/[boxX]/.test(J)?\"0\"+J.toLowerCase():\"\",x=F===\"$\"?B:/[%p]/.test(J)?E:\"\",q=lJ[J],P=/[defgprs%]/.test(J);M=M===void 0?6:/[gprs]/.test(J)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function Z(X){var L=U,j=x,m,$,NA;if(J===\"c\")j=q(X)+j,X=\"\";else{X=+X;var wA=X<0||1/X<0;if(X=isNaN(X)?e:q(Math.abs(X),M),l&&(X=Ff(X)),wA&&+X==0&&k!==\"+\"&&(wA=!1),L=(wA?k===\"(\"?k:o:k===\"-\"||k===\"(\"?\"\":k)+L,j=(J===\"s\"?lf[8+RJ/3]:\"\")+j+(wA&&k===\"(\"?\")\":\"\"),P){for(m=-1,$=X.length;++m<$;)if(NA=X.charCodeAt(m),48>NA||NA>57){j=(NA===46?Q+X.slice(m+1):X.slice(m))+j,X=X.slice(0,m);break}}}Y&&!h&&(X=A(X,1/0));var FA=L.length+X.length+j.length,JA=FA>1)+L+X+j+JA.slice(FA);break;default:X=JA+L+X+j;break}return C(X)}return Z.toString=function(){return n+\"\"},Z}function r(n,G){var w=D((n=$e(n),n.type=\"f\",n)),k=Math.max(-8,Math.min(8,Math.floor(Jo(G)/3)))*3,F=Math.pow(10,-k),h=lf[8+k/3];return function(N){return w(F*N)+h}}return{format:D,formatPrefix:r}}var SN,LN,HN;YJ({thousands:\",\",grouping:[3],currency:[\"$\",\"\"]});function YJ(g){return SN=Jf(g),LN=SN.format,HN=SN.formatPrefix,SN}function KJ(g){return Math.max(0,-Jo(Math.abs(g)))}function pJ(g,A){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jo(A)/3)))*3-Jo(Math.abs(g)))}function qJ(g,A){return g=Math.abs(g),A=Math.abs(A)-g,Math.max(0,Jo(A)-Jo(g))+1}function dJ(g){for(var A=-1,I=g.length,B,Q=g[I-1],C=0;++AA&&(I=g,g=A,A=I),function(B){return Math.max(g,Math.min(A,B))}}function Z9(g,A,I){var B=g[0],Q=g[1],C=A[0],E=A[1];return Q2?P9:Z9,e=D=null,n}function n(G){return G==null||isNaN(G=+G)?C:(e||(e=o(g.map(B),A,I)))(B(E(G)))}return n.invert=function(G){return E(Q((D||(D=o(A,g.map(B),cQ)))(G)))},n.domain=function(G){return arguments.length?(g=Array.from(G,SJ),r()):g.slice()},n.range=function(G){return arguments.length?(A=Array.from(G),r()):A.slice()},n.rangeRound=function(G){return A=Array.from(G),I=wJ,r()},n.clamp=function(G){return arguments.length?(E=G?!0:zs,r()):E!==zs},n.interpolate=function(G){return arguments.length?(I=G,r()):I},n.unknown=function(G){return arguments.length?(C=G,n):C},function(G,w){return B=G,Q=w,r()}}function HJ(){return O9()(zs,zs)}function fJ(g,A,I,B){var Q=oJ(g,A,I),C;switch(B=$e(B??\",f\"),B.type){case\"s\":{var E=Math.max(Math.abs(g),Math.abs(A));return B.precision==null&&!isNaN(C=pJ(Q,E))&&(B.precision=C),HN(B,E)}case\"\":case\"e\":case\"g\":case\"p\":case\"r\":{B.precision==null&&!isNaN(C=qJ(Q,Math.max(Math.abs(g),Math.abs(A))))&&(B.precision=C-(B.type===\"e\"));break}case\"f\":case\"%\":{B.precision==null&&!isNaN(C=KJ(Q))&&(B.precision=C-(B.type===\"%\")*2);break}}return LN(B)}function V9(g){var A=g.domain;return g.ticks=function(I){var B=A();return oN(B[0],B[B.length-1],I??10)},g.tickFormat=function(I,B){var Q=A();return fJ(Q[0],Q[Q.length-1],I??10,B)},g.nice=function(I){I==null&&(I=10);var B=A(),Q=0,C=B.length-1,E=B[Q],o=B[C],e,D,r=10;for(o 0;){if(D=rc(E,o,I),D===e)return B[Q]=E,B[C]=o,A(B);if(D>0)E=Math.floor(E/D)*D,o=Math.ceil(o/D)*D;else if(D<0)E=Math.ceil(E*D)/D,o=Math.floor(o*D)/D;else break;e=D}return g},g}function _s(){var g=HJ();return g.copy=function(){return pf(g,_s())},js.apply(g,arguments),V9(g)}function Aa(g,A,I){this.k=g,this.x=A,this.y=I}Aa.prototype={constructor:Aa,scale:function(g){return g===1?this:new Aa(this.k*g,this.x,this.y)},translate:function(g,A){return g===0&A===0?this:new Aa(this.k,this.x+this.k*g,this.y+this.k*A)},apply:function(g){return[g[0]*this.k+this.x,g[1]*this.k+this.y]},applyX:function(g){return g*this.k+this.x},applyY:function(g){return g*this.k+this.y},invert:function(g){return[(g[0]-this.x)/this.k,(g[1]-this.y)/this.k]},invertX:function(g){return(g-this.x)/this.k},invertY:function(g){return(g-this.y)/this.k},rescaleX:function(g){return g.copy().domain(g.range().map(this.invertX,this).map(g.invert,g))},rescaleY:function(g){return g.copy().domain(g.range().map(this.invertY,this).map(g.invert,g))},toString:function(){return\"translate(\"+this.x+\",\"+this.y+\") scale(\"+this.k+\")\"}};var uJ=new Aa(1,0,0);mJ.prototype=Aa.prototype;function mJ(g){for(;!g.__zoom;)if(!(g=g.parentNode))return uJ;return g.__zoom}var zg={},uN=g=>{zg={fetch:{headers:{}}},g&&(zg.fetch.headers.Authorization=`Bearer ${g}`)};var mN=(g,A)=>{g.global_base_url=A};var xN=async(g,A)=>{let I=A+\"/landscape_parameters.json\",B=await fetch(I,zg.fetch);g.landscape_parameters=await B.json()};var qf=async(g,A,I)=>{let B=`${g}/pyramid_images/${A}.dzi`,C=await(await fetch(B,I.fetch)).text(),E=new DOMParser().parseFromString(C,\"text/xml\");return{height:Number(E.getElementsByTagName(\"Size\")[0].attributes.Height.value),width:Number(E.getElementsByTagName(\"Size\")[0].attributes.Width.value),tileSize:Number(E.getElementsByTagName(\"Image\")[0].attributes.TileSize.value)}};var bN=async(g,A,I)=>{g.dimensions=await qf(A,I,zg)};function TN(g,A){if(!g)throw new Error(A||\"loader assertion failed.\")}var Yo={self:typeof self<\"u\"&&self,window:typeof window<\"u\"&&window,global:typeof global<\"u\"&&global,document:typeof document<\"u\"&&document},v9=Yo.self||Yo.window||Yo.global||{},j9=Yo.window||Yo.self||Yo.global||{},X9=Yo.global||Yo.self||Yo.window||{},z9=Yo.document||{};var Uc=!!(typeof process!=\"object\"||String(process)!==\"[object process]\"||process.browser);var df=typeof process<\"u\"&&process.version&&/v([0-9]*)/.exec(process.version),_9=df&&parseFloat(df[1])||0;var WN=globalThis,$9=globalThis.document||{},ZN=globalThis.process||{},AX=globalThis.console,Uf=globalThis.navigator||{};function PN(g){if(typeof window<\"u\"&&window.process?.type===\"renderer\"||typeof process<\"u\"&&process.versions?.electron)return!0;let A=typeof navigator<\"u\"&&navigator.userAgent,I=g||A;return!!(I&&I.indexOf(\"Electron\")>=0)}function HQ(){return!(typeof process==\"object\"&&String(process)===\"[object process]\"&&!process?.browser)||PN()}function xJ(g){return!g&&!HQ()?\"Node\":PN(g)?\"Electron\":(g||Uf.userAgent||\"\").indexOf(\"Edge\")>-1?\"Edge\":globalThis.chrome?\"Chrome\":globalThis.safari?\"Safari\":globalThis.mozInnerScreenX?\"Firefox\":\"Unknown\"}var bJ=\"4.0.7\";function IX(g){try{let A=window[g],I=\"__storage_test__\";return A.setItem(I,I),A.removeItem(I),A}catch{return null}}var ON=class{constructor(A,I,B=\"sessionStorage\"){this.storage=IX(B),this.id=A,this.config=I,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(A){if(Object.assign(this.config,A),this.storage){let I=JSON.stringify(this.config);this.storage.setItem(this.id,I)}}_loadConfiguration(){let A={};if(this.storage){let I=this.storage.getItem(this.id);A=I?JSON.parse(I):{}}return Object.assign(this.config,A),this}};function Sf(g){let A;return g<10?A=`${g.toFixed(2)}ms`:g<100?A=`${g.toFixed(1)}ms`:g<1e3?A=`${g.toFixed(0)}ms`:A=`${(g/1e3).toFixed(2)}s`,A}function Lf(g,A=8){let I=Math.max(A-g.length,0);return`${\" \".repeat(I)}${g}`}var VN;(function(g){g[g.BLACK=30]=\"BLACK\",g[g.RED=31]=\"RED\",g[g.GREEN=32]=\"GREEN\",g[g.YELLOW=33]=\"YELLOW\",g[g.BLUE=34]=\"BLUE\",g[g.MAGENTA=35]=\"MAGENTA\",g[g.CYAN=36]=\"CYAN\",g[g.WHITE=37]=\"WHITE\",g[g.BRIGHT_BLACK=90]=\"BRIGHT_BLACK\",g[g.BRIGHT_RED=91]=\"BRIGHT_RED\",g[g.BRIGHT_GREEN=92]=\"BRIGHT_GREEN\",g[g.BRIGHT_YELLOW=93]=\"BRIGHT_YELLOW\",g[g.BRIGHT_BLUE=94]=\"BRIGHT_BLUE\",g[g.BRIGHT_MAGENTA=95]=\"BRIGHT_MAGENTA\",g[g.BRIGHT_CYAN=96]=\"BRIGHT_CYAN\",g[g.BRIGHT_WHITE=97]=\"BRIGHT_WHITE\"})(VN||(VN={}));var BX=10;function Hf(g){return typeof g!=\"string\"?g:(g=g.toUpperCase(),VN[g]||VN.WHITE)}function ff(g,A,I){return!HQ&&typeof g==\"string\"&&(A&&(g=`\\x1B[${Hf(A)}m${g}\\x1B[39m`),I&&(g=`\\x1B[${Hf(I)+BX}m${g}\\x1B[49m`)),g}function uf(g,A=[\"constructor\"]){let I=Object.getPrototypeOf(g),B=Object.getOwnPropertyNames(I),Q=g;for(let C of B){let E=Q[C];typeof E==\"function\"&&(A.find(o=>C===o)||(Q[C]=E.bind(g)))}}function Sc(g,A){if(!g)throw new Error(A||\"Assertion failed\")}function YD(){let g;if(HQ()&&WN.performance)g=WN?.performance?.now?.();else if(\"hrtime\"in ZN){let A=ZN?.hrtime?.();g=A[0]*1e3+A[1]/1e6}else g=Date.now();return g}var $s={debug:HQ()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},QX={enabled:!0,level:0};function Ar(){}var mf={},xf={once:!0},$C=class{constructor({id:A}={id:\"\"}){this.VERSION=bJ,this._startTs=YD(),this._deltaTs=YD(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=A,this.userData={},this._storage=new ON(`__probe-${this.id}__`,QX),this.timeStamp(`${this.id} started`),uf(this),Object.seal(this)}set level(A){this.setLevel(A)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((YD()-this._startTs).toPrecision(10))}getDelta(){return Number((YD()-this._deltaTs).toPrecision(10))}set priority(A){this.level=A}get priority(){return this.level}getPriority(){return this.level}enable(A=!0){return this._storage.setConfiguration({enabled:A}),this}setLevel(A){return this._storage.setConfiguration({level:A}),this}get(A){return this._storage.config[A]}set(A,I){this._storage.setConfiguration({[A]:I})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(A,I){if(!A)throw new Error(I||\"Assertion failed\")}warn(A){return this._getLogFunction(0,A,$s.warn,arguments,xf)}error(A){return this._getLogFunction(0,A,$s.error,arguments)}deprecated(A,I){return this.warn(`\\`${A}\\` is deprecated and will be removed in a later version. Use \\`${I}\\` instead`)}removed(A,I){return this.error(`\\`${A}\\` has been removed. Use \\`${I}\\` instead`)}probe(A,I){return this._getLogFunction(A,I,$s.log,arguments,{time:!0,once:!0})}log(A,I){return this._getLogFunction(A,I,$s.debug,arguments)}info(A,I){return this._getLogFunction(A,I,console.info,arguments)}once(A,I){return this._getLogFunction(A,I,$s.debug||$s.info,arguments,xf)}table(A,I,B){return I?this._getLogFunction(A,I,console.table||Ar,B&&[B],{tag:EX(I)}):Ar}time(A,I){return this._getLogFunction(A,I,console.time?console.time:console.info)}timeEnd(A,I){return this._getLogFunction(A,I,console.timeEnd?console.timeEnd:console.info)}timeStamp(A,I){return this._getLogFunction(A,I,console.timeStamp||Ar)}group(A,I,B={collapsed:!1}){let Q=bf({logLevel:A,message:I,opts:B}),{collapsed:C}=B;return Q.method=(C?console.groupCollapsed:console.group)||console.info,this._getLogFunction(Q)}groupCollapsed(A,I,B={}){return this.group(A,I,Object.assign({},B,{collapsed:!0}))}groupEnd(A){return this._getLogFunction(A,\"\",console.groupEnd||Ar)}withGroup(A,I,B){this.group(A,I)();try{B()}finally{this.groupEnd(A)()}}trace(){console.trace&&console.trace()}_shouldLog(A){return this.isEnabled()&&this.getLevel()>=Tf(A)}_getLogFunction(A,I,B,Q,C){if(this._shouldLog(A)){C=bf({logLevel:A,message:I,args:Q,opts:C}),B=B||C.method,Sc(B),C.total=this.getTotal(),C.delta=this.getDelta(),this._deltaTs=YD();let E=C.tag||C.message;if(C.once&&E)if(!mf[E])mf[E]=YD();else return Ar;return I=CX(this.id,C.message,C),B.bind(console,I,...C.args)}return Ar}};$C.VERSION=bJ;function Tf(g){if(!g)return 0;let A;switch(typeof g){case\"number\":A=g;break;case\"object\":A=g.logLevel||g.priority||0;break;default:return 0}return Sc(Number.isFinite(A)&&A>=0),A}function bf(g){let{logLevel:A,message:I}=g;g.logLevel=Tf(A);let B=g.args?Array.from(g.args):[];for(;B.length&&B.shift()!==I;);switch(typeof A){case\"string\":case\"function\":I!==void 0&&B.unshift(I),g.message=A;break;case\"object\":Object.assign(g,A);break;default:}typeof g.message==\"function\"&&(g.message=g.message());let Q=typeof g.message;return Sc(Q===\"string\"||Q===\"object\"),Object.assign(g,{args:B},g.opts)}function CX(g,A,I){if(typeof A==\"string\"){let B=I.time?Lf(Sf(I.total)):\"\";A=I.time?`${g}: ${B} ${A}`:`${g}: ${A}`,A=ff(A,I.color,I.background)}return A}function EX(g){for(let A in g)for(let I in g[A])return I||\"untitled\";return\"empty\"}globalThis.probe={};var zFA=new $C({id:\"@probe.gl/log\"});var TJ=\"4.3.1\",iX=TJ[0]>=\"0\"&&TJ[0]<=\"9\"?`v${TJ}`:\"\";function oX(){let g=new $C({id:\"loaders.gl\"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=g,globalThis.loaders.version=iX,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=g,g}var WJ=oX();function ZJ(g,A){return Wf(g||{},A)}function Wf(g,A,I=0){if(I>3)return A;let B={...g};for(let[Q,C]of Object.entries(A))C&&typeof C==\"object\"&&!Array.isArray(C)?B[Q]=Wf(B[Q]||{},A[Q],I+1):B[Q]=A[Q];return B}var Zf=\"latest\";function tX(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version=\"4.3.1\"),globalThis._loadersgl_.version}var PJ=tX();function iC(g,A){if(!g)throw new Error(A||\"loaders.gl assertion failed.\")}var Ko={self:typeof self<\"u\"&&self,window:typeof window<\"u\"&&window,global:typeof global<\"u\"&&global,document:typeof document<\"u\"&&document},ERA=Ko.self||Ko.window||Ko.global||{},iRA=Ko.window||Ko.self||Ko.global||{},oRA=Ko.global||Ko.self||Ko.window||{},tRA=Ko.document||{};var XE=typeof process!=\"object\"||String(process)!==\"[object process]\"||process.browser;var Of=typeof window<\"u\"&&typeof window.orientation<\"u\",Pf=typeof process<\"u\"&&process.version&&/v([0-9]*)/.exec(process.version),eRA=Pf&&parseFloat(Pf[1])||0;var Lc=class{constructor(A,I){p(this,\"name\");p(this,\"workerThread\");p(this,\"isRunning\",!0);p(this,\"result\");p(this,\"_resolve\",()=>{});p(this,\"_reject\",()=>{});this.name=A,this.workerThread=I,this.result=new Promise((B,Q)=>{this._resolve=B,this._reject=Q})}postMessage(A,I){this.workerThread.postMessage({source:\"loaders.gl\",type:A,payload:I})}done(A){iC(this.isRunning),this.isRunning=!1,this._resolve(A)}error(A){iC(this.isRunning),this.isRunning=!1,this._reject(A)}};var gr=class{terminate(){}};var OJ=new Map;function Vf(g){iC(g.source&&!g.url||!g.source&&g.url);let A=OJ.get(g.source||g.url);return A||(g.url&&(A=eX(g.url),OJ.set(g.url,A)),g.source&&(A=vf(g.source),OJ.set(g.source,A))),iC(A),A}function eX(g){if(!g.startsWith(\"http\"))return g;let A=aX(g);return vf(A)}function vf(g){let A=new Blob([g],{type:\"application/javascript\"});return URL.createObjectURL(A)}function aX(g){return`try {\n importScripts('${g}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}function VJ(g,A=!0,I){let B=I||new Set;if(g){if(jf(g))B.add(g);else if(jf(g.buffer))B.add(g.buffer);else if(!ArrayBuffer.isView(g)){if(A&&typeof g==\"object\")for(let Q in g)VJ(g[Q],A,B)}}return I===void 0?Array.from(B):[]}function jf(g){return g?g instanceof ArrayBuffer||typeof MessagePort<\"u\"&&g instanceof MessagePort||typeof ImageBitmap<\"u\"&&g instanceof ImageBitmap||typeof OffscreenCanvas<\"u\"&&g instanceof OffscreenCanvas:!1}var vJ=()=>{},ga=class{constructor(A){p(this,\"name\");p(this,\"source\");p(this,\"url\");p(this,\"terminated\",!1);p(this,\"worker\");p(this,\"onMessage\");p(this,\"onError\");p(this,\"_loadableURL\",\"\");let{name:I,source:B,url:Q}=A;iC(B||Q),this.name=I,this.source=B,this.url=Q,this.onMessage=vJ,this.onError=C=>console.log(C),this.worker=XE?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<\"u\"&&XE||typeof gr<\"u\"&&!XE}destroy(){this.onMessage=vJ,this.onError=vJ,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(A,I){I=I||VJ(A),this.worker.postMessage(A,I)}_getErrorFromErrorEvent(A){let I=\"Failed to load \";return I+=`worker ${this.name} from ${this.url}. `,A.message&&(I+=`${A.message} in `),A.lineno&&(I+=`:${A.lineno}:${A.colno}`),new Error(I)}_createBrowserWorker(){this._loadableURL=Vf({source:this.source,url:this.url});let A=new Worker(this._loadableURL,{name:this.name});return A.onmessage=I=>{I.data?this.onMessage(I.data):this.onError(new Error(\"No data received\"))},A.onerror=I=>{this.onError(this._getErrorFromErrorEvent(I)),this.terminated=!0},A.onmessageerror=I=>console.error(I),A}_createNodeWorker(){let A;if(this.url){let B=this.url.includes(\":/\")||this.url.startsWith(\"/\")?this.url:`./${this.url}`;A=new gr(B,{eval:!1})}else if(this.source)A=new gr(this.source,{eval:!0});else throw new Error(\"no worker\");return A.on(\"message\",I=>{this.onMessage(I)}),A.on(\"error\",I=>{this.onError(I)}),A.on(\"exit\",I=>{}),A}};var Hc=class{constructor(A){p(this,\"name\",\"unnamed\");p(this,\"source\");p(this,\"url\");p(this,\"maxConcurrency\",1);p(this,\"maxMobileConcurrency\",1);p(this,\"onDebug\",()=>{});p(this,\"reuseWorkers\",!0);p(this,\"props\",{});p(this,\"jobQueue\",[]);p(this,\"idleQueue\",[]);p(this,\"count\",0);p(this,\"isDestroyed\",!1);this.source=A.source,this.url=A.url,this.setProps(A)}static isSupported(){return ga.isSupported()}destroy(){this.idleQueue.forEach(A=>A.destroy()),this.isDestroyed=!0}setProps(A){this.props={...this.props,...A},A.name!==void 0&&(this.name=A.name),A.maxConcurrency!==void 0&&(this.maxConcurrency=A.maxConcurrency),A.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=A.maxMobileConcurrency),A.reuseWorkers!==void 0&&(this.reuseWorkers=A.reuseWorkers),A.onDebug!==void 0&&(this.onDebug=A.onDebug)}async startJob(A,I=(Q,C,E)=>Q.done(E),B=(Q,C)=>Q.error(C)){let Q=new Promise(C=>(this.jobQueue.push({name:A,onMessage:I,onError:B,onStart:C}),this));return this._startQueuedJob(),await Q}async _startQueuedJob(){if(!this.jobQueue.length)return;let A=this._getAvailableWorker();if(!A)return;let I=this.jobQueue.shift();if(I){this.onDebug({message:\"Starting job\",name:I.name,workerThread:A,backlog:this.jobQueue.length});let B=new Lc(I.name,A);A.onMessage=Q=>I.onMessage(B,Q.type,Q.payload),A.onError=Q=>I.onError(B,Q),I.onStart(B);try{await B.result}catch(Q){console.error(`Worker exception: ${Q}`)}finally{this.returnWorkerToQueue(A)}}}returnWorkerToQueue(A){!XE||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(A.destroy(),this.count--):this.idleQueue.push(A),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count {}},Ia=class Ia{constructor(A){p(this,\"props\");p(this,\"workerPools\",new Map);this.props={...DX},this.setProps(A),this.workerPools=new Map}static isSupported(){return ga.isSupported()}static getWorkerFarm(A={}){return Ia._workerFarm=Ia._workerFarm||new Ia({}),Ia._workerFarm.setProps(A),Ia._workerFarm}destroy(){for(let A of this.workerPools.values())A.destroy();this.workerPools=new Map}setProps(A){this.props={...this.props,...A};for(let I of this.workerPools.values())I.setProps(this._getWorkerPoolProps())}getWorkerPool(A){let{name:I,source:B,url:Q}=A,C=this.workerPools.get(I);return C||(C=new Hc({name:I,source:B,url:Q}),C.setProps(this._getWorkerPoolProps()),this.workerPools.set(I,C)),C}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};p(Ia,\"_workerFarm\");var KD=Ia;function jJ(g,A={}){let I=A[g.id]||{},B=XE?`${g.id}-worker.js`:`${g.id}-worker-node.js`,Q=I.workerUrl;if(!Q&&g.id===\"compression\"&&(Q=A.workerUrl),A._workerType===\"test\"&&(XE?Q=`modules/${g.module}/dist/${B}`:Q=`modules/${g.module}/src/workers/${g.id}-worker-node.ts`),!Q){let C=g.version;C===\"latest\"&&(C=Zf);let E=C?`@${C}`:\"\";Q=`https://unpkg.com/@loaders.gl/${g.module}${E}/dist/${B}`}return iC(Q),Q}function XJ(g,A=PJ){iC(g,\"no worker provided\");let I=g.version;return!(!A||!I)}function zJ(g,A){return!KD.isSupported()||!XE&&!A?._nodeWorkers?!1:g.worker&&A?.worker}async function _J(g,A,I,B,Q){let C=g.id,E=jJ(g,I),e=KD.getWorkerFarm(I).getWorkerPool({name:C,url:E});I=JSON.parse(JSON.stringify(I)),B=JSON.parse(JSON.stringify(B||{}));let D=await e.startJob(\"process-on-worker\",sX.bind(null,Q));return D.postMessage(\"process\",{input:A,options:I,context:B}),await(await D.result).result}async function sX(g,A,I,B){switch(I){case\"done\":A.done(B);break;case\"error\":A.error(new Error(B.error));break;case\"process\":let{id:Q,input:C,options:E}=B;try{let o=await g(C,E);A.postMessage(\"done\",{id:Q,result:o})}catch(o){let e=o instanceof Error?o.message:\"unknown error\";A.postMessage(\"error\",{id:Q,error:e})}break;default:console.warn(`parse-with-worker unknown message ${I}`)}}function $J(g,A,I){if(I=I||g.byteLength,g.byteLengthC instanceof ArrayBuffer?new Uint8Array(C):C),I=A.reduce((C,E)=>C+E.byteLength,0),B=new Uint8Array(I),Q=0;for(let C of A)B.set(C,Q),Q+=C.byteLength;return B.buffer}async function gY(g){let A=[];for await(let I of g)A.push(I);return AY(...A)}function fc(){let g;if(typeof window<\"u\"&&window.performance)g=window.performance.now();else if(typeof process<\"u\"&&process.hrtime){let A=process.hrtime();g=A[0]*1e3+A[1]/1e6}else g=Date.now();return g}var pD=class{constructor(A,I){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=A,this.type=I,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(A){return this.sampleSize=A,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(A){return this._count+=A,this._samples++,this._checkSampling(),this}subtractCount(A){return this._count-=A,this._samples++,this._checkSampling(),this}addTime(A){return this._time+=A,this.lastTiming=A,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=fc(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(fc()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var AE=class{constructor(A){this.stats={},this.id=A.id,this.stats={},this._initializeStats(A.stats),Object.seal(this)}get(A,I=\"count\"){return this._getOrCreate({name:A,type:I})}get size(){return Object.keys(this.stats).length}reset(){for(let A of Object.values(this.stats))A.reset();return this}forEach(A){for(let I of Object.values(this.stats))A(I)}getTable(){let A={};return this.forEach(I=>{A[I.name]={time:I.time||0,count:I.count||0,average:I.getAverageTime()||0,hz:I.getHz()||0}}),A}_initializeStats(A=[]){A.forEach(I=>this._getOrCreate(I))}_getOrCreate(A){let{name:I,type:B}=A,Q=this.stats[I];return Q||(A instanceof pD?Q=A:Q=new pD(I,B),this.stats[I]=Q),Q}};var rX=\"\",zf={};function IY(g){for(let A in zf)if(g.startsWith(A)){let I=zf[A];g=g.replace(A,I)}return!g.startsWith(\"http://\")&&!g.startsWith(\"https://\")&&(g=`${rX}${g}`),g}function _f(g){return g&&typeof g==\"object\"&&g.isBuffer}function vN(g){if(_f(g))return g;if(g instanceof ArrayBuffer)return g;if(ArrayBuffer.isView(g))return g.byteOffset===0&&g.byteLength===g.buffer.byteLength?g.buffer:g.buffer.slice(g.byteOffset,g.byteOffset+g.byteLength);if(typeof g==\"string\"){let A=g;return new TextEncoder().encode(A).buffer}if(g&&typeof g==\"object\"&&g._toArrayBuffer)return g._toArrayBuffer();throw new Error(\"toArrayBuffer\")}var qD={};uB(qD,{dirname:()=>cX,filename:()=>nX,join:()=>GX,resolve:()=>wX});function $f(){if(typeof process<\"u\"&&typeof process.cwd<\"u\")return process.cwd();let g=window.location?.pathname;return g?.slice(0,g.lastIndexOf(\"/\")+1)||\"\"}function nX(g){let A=g?g.lastIndexOf(\"/\"):-1;return A>=0?g.substr(A+1):\"\"}function cX(g){let A=g?g.lastIndexOf(\"/\"):-1;return A>=0?g.substr(0,A):\"\"}function GX(...g){let A=\"/\";return g=g.map((I,B)=>(B&&(I=I.replace(new RegExp(`^${A}`),\"\")),B!==g.length-1&&(I=I.replace(new RegExp(`${A}$`),\"\")),I)),g.join(A)}function wX(...g){let A=[];for(let C=0;C =-1&&!B;C--){let E;C>=0?E=A[C]:(Q===void 0&&(Q=$f()),E=Q),E.length!==0&&(I=`${E}/${I}`,B=E.charCodeAt(0)===uc)}return I=hX(I,!B),B?`/${I}`:I.length>0?I:\".\"}var uc=47,BY=46;function hX(g,A){let I=\"\",B=-1,Q=0,C,E=!1;for(let o=0;o<=g.length;++o){if(o 2){let e=I.length-1,D=e;for(;D>=0&&I.charCodeAt(D)!==uc;--D);if(D!==e){I=D===-1?\"\":I.slice(0,D),B=o,Q=0,E=!1;continue}}else if(I.length===2||I.length===1){I=\"\",B=o,Q=0,E=!1;continue}}A&&(I.length>0?I+=\"/..\":I=\"..\",E=!0)}else{let e=g.slice(B+1,o);I.length>0?I+=`/${e}`:I=e,E=!1}B=o,Q=0}else C===BY&&Q!==-1?++Q:Q=-1}return I}var NX=g=>typeof g==\"boolean\",mc=g=>typeof g==\"function\",dD=g=>g!==null&&typeof g==\"object\",QY=g=>dD(g)&&g.constructor==={}.constructor;var Au=g=>!!g&&typeof g[Symbol.iterator]==\"function\",gu=g=>g&&typeof g[Symbol.asyncIterator]==\"function\";var zE=g=>typeof Response<\"u\"&&g instanceof Response||g&&g.arrayBuffer&&g.text&&g.json;var _E=g=>typeof Blob<\"u\"&&g instanceof Blob,Iu=g=>g&&typeof g==\"object\"&&g.isBuffer;var kX=g=>typeof ReadableStream<\"u\"&&g instanceof ReadableStream||dD(g)&&mc(g.tee)&&mc(g.cancel)&&mc(g.getReader);var yX=g=>dD(g)&&mc(g.read)&&mc(g.pipe)&&NX(g.readable),jN=g=>kX(g)||yX(g);var XN=class extends Error{constructor(I,B){super(I);p(this,\"reason\");p(this,\"url\");p(this,\"response\");this.reason=B.reason,this.url=B.url,this.response=B.response}};var FX=/^data:([-\\w.]+\\/[-\\w.+]+)(;|,)/,RX=/^([-\\w.]+\\/[-\\w.+]+)/;function CY(g,A){return g.toLowerCase()===A.toLowerCase()}function Bu(g){let A=RX.exec(g);return A?A[1]:g}function EY(g){let A=FX.exec(g);return A?A[1]:\"\"}var Qu=/\\?.*/;function Cu(g){let A=g.match(Qu);return A&&A[0]}function Ir(g){return g.replace(Qu,\"\")}function Eu(g){if(g.length<50)return g;let A=g.slice(g.length-15);return`${g.substr(0,32)}...${A}`}function UD(g){return zE(g)?g.url:_E(g)?g.name||\"\":typeof g==\"string\"?g:\"\"}function xc(g){if(zE(g)){let A=g,I=A.headers.get(\"content-type\")||\"\",B=Ir(A.url);return Bu(I)||EY(B)}return _E(g)?g.type||\"\":typeof g==\"string\"?EY(g):\"\"}function iu(g){return zE(g)?g.headers[\"content-length\"]||-1:_E(g)?g.size:typeof g==\"string\"?g.length:g instanceof ArrayBuffer||ArrayBuffer.isView(g)?g.byteLength:-1}async function zN(g){if(zE(g))return g;let A={},I=iu(g);I>=0&&(A[\"content-length\"]=String(I));let B=UD(g),Q=xc(g);Q&&(A[\"content-type\"]=Q);let C=await lX(g);C&&(A[\"x-first-bytes\"]=C),typeof g==\"string\"&&(g=new TextEncoder().encode(g));let E=new Response(g,{headers:A});return Object.defineProperty(E,\"url\",{value:B}),E}async function ou(g){if(!g.ok)throw await MX(g)}async function MX(g){let A=Eu(g.url),I=`Failed to fetch resource (${g.status}) ${g.statusText}: ${A}`;I=I.length>100?`${I.slice(0,100)}...`:I;let B={reason:g.statusText,url:g.url,response:g};try{let Q=g.headers.get(\"Content-Type\");B.reason=!g.bodyUsed&&Q?.includes(\"application/json\")?await g.json():await g.text()}catch{}return new XN(I,B)}async function lX(g){if(typeof g==\"string\")return`data:,${g.slice(0,5)}`;if(g instanceof Blob){let I=g.slice(0,5);return await new Promise(B=>{let Q=new FileReader;Q.onload=C=>B(C?.target?.result),Q.readAsDataURL(I)})}if(g instanceof ArrayBuffer){let I=g.slice(0,5);return`data:base64,${JX(I)}`}return null}function JX(g){let A=\"\",I=new Uint8Array(g);for(let B=0;B {}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},$N=class{constructor(){p(this,\"console\");this.console=console}log(...A){return this.console.log.bind(this.console,...A)}info(...A){return this.console.info.bind(this.console,...A)}warn(...A){return this.console.warn.bind(this.console,...A)}error(...A){return this.console.error.bind(this.console,...A)}};var tY={fetch:null,mimeType:void 0,nothrow:!1,log:new $N,useLocalLibraries:!1,CDN:\"https://unpkg.com/@loaders.gl\",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Uc,_nodeWorkers:!1,_workerType:\"\",limit:0,_limitMB:0,batchSize:\"auto\",batchDebounceMs:0,metadata:!1,transforms:[]},tu={throws:\"nothrow\",dataType:\"(no longer used)\",uri:\"baseUri\",method:\"fetch.method\",headers:\"fetch.headers\",body:\"fetch.body\",mode:\"fetch.mode\",credentials:\"fetch.credentials\",cache:\"fetch.cache\",redirect:\"fetch.redirect\",referrer:\"fetch.referrer\",referrerPolicy:\"fetch.referrerPolicy\",integrity:\"fetch.integrity\",keepalive:\"fetch.keepalive\",signal:\"fetch.signal\"};function eY(){globalThis.loaders=globalThis.loaders||{};let{loaders:g}=globalThis;return g._state||(g._state={}),g._state}function aY(){let g=eY();return g.globalOptions=g.globalOptions||{...tY},g.globalOptions}function Du(g,A,I,B){return I=I||[],I=Array.isArray(I)?I:[I],qX(g,I),UX(A,g,B)}function qX(g,A){eu(g,null,tY,tu,A);for(let I of A){let B=g&&g[I.id]||{},Q=I.options&&I.options[I.id]||{},C=I.deprecatedOptions&&I.deprecatedOptions[I.id]||{};eu(B,I.id,Q,C,A)}}function eu(g,A,I,B,Q){let C=A||\"Top level\",E=A?`${A}.`:\"\";for(let o in g){let e=!A&&dD(g[o]),D=o===\"baseUri\"&&!A,r=o===\"workerUrl\"&&A;if(!(o in I)&&!D&&!r){if(o in B)oY.warn(`${C} loader option '${E}${o}' no longer supported, use '${B[o]}'`)();else if(!e){let n=dX(o,Q);oY.warn(`${C} loader option '${E}${o}' not recognized. ${n}`)()}}}}function dX(g,A){let I=g.toLowerCase(),B=\"\";for(let Q of A)for(let C in Q.options){if(g===C)return`Did you mean '${Q.id}.${C}'?`;let E=C.toLowerCase();(I.startsWith(E)||E.startsWith(I))&&(B=B||`Did you mean '${Q.id}.${C}'?`)}return B}function UX(g,A,I){let Q={...g.options||{}};return SX(Q,I),Q.log===null&&(Q.log=new _N),au(Q,aY()),au(Q,A),Q}function au(g,A){for(let I in A)if(I in A){let B=A[I];QY(B)&&QY(g[I])?g[I]={...g[I],...A[I]}:g[I]=A[I]}}function SX(g,A){A&&!(\"baseUri\"in g)&&(g.baseUri=A)}function bc(g){return g?(Array.isArray(g)&&(g=g[0]),Array.isArray(g?.extensions)):!1}function Tc(g){TN(g,\"null loader\"),TN(bc(g),\"invalid loader\");let A;return Array.isArray(g)&&(A=g[1],g=g[0],g={...g,options:{...g.options,...A}}),(g?.parseTextSync||g?.parseText)&&(g.text=!0),g.text||(g.binary=!0),g}var su=()=>{let g=eY();return g.loaderRegistry=g.loaderRegistry||[],g.loaderRegistry};function DY(g){let A=su();g=Array.isArray(g)?g:[g];for(let I of g){let B=Tc(I);A.find(Q=>B===Q)||A.unshift(B)}}function ru(){return su()}var LX=/\\.([^.]+)$/;async function Gu(g,A=[],I,B){if(!wu(g))return null;let Q=nu(g,A,{...I,nothrow:!0},B);if(Q)return Q;if(_E(g)&&(g=await g.slice(0,10).arrayBuffer(),Q=nu(g,A,I,B)),!Q&&!I?.nothrow)throw new Error(hu(g));return Q}function nu(g,A=[],I,B){if(!wu(g))return null;if(A&&!Array.isArray(A))return Tc(A);let Q=[];A&&(Q=Q.concat(A)),I?.ignoreRegisteredLoaders||Q.push(...ru()),fX(Q);let C=HX(g,Q,I,B);if(!C&&!I?.nothrow)throw new Error(hu(g));return C}function HX(g,A,I,B){let Q=UD(g),C=xc(g),E=Ir(Q)||B?.url,o=null,e=\"\";return I?.mimeType&&(o=sY(A,I?.mimeType),e=`match forced by supplied MIME type ${I?.mimeType}`),o=o||uX(A,E),e=e||(o?`matched url ${E}`:\"\"),o=o||sY(A,C),e=e||(o?`matched MIME type ${C}`:\"\"),o=o||xX(A,g),e=e||(o?`matched initial data ${Nu(g)}`:\"\"),I?.fallbackMimeType&&(o=o||sY(A,I?.fallbackMimeType),e=e||(o?`matched fallback MIME type ${C}`:\"\")),e&&WJ.log(1,`selectLoader selected ${o?.name}: ${e}.`),o}function wu(g){return!(g instanceof Response&&g.status===204)}function hu(g){let A=UD(g),I=xc(g),B=\"No valid loader found (\";B+=A?`${qD.filename(A)}, `:\"no url provided, \",B+=`MIME type: ${I?`\"${I}\"`:\"not provided\"}, `;let Q=g?Nu(g):\"\";return B+=Q?` first bytes: \"${Q}\"`:\"first bytes: not available\",B+=\")\",B}function fX(g){for(let A of g)Tc(A)}function uX(g,A){let I=A&&LX.exec(A),B=I&&I[1];return B?mX(g,B):null}function mX(g,A){A=A.toLowerCase();for(let I of g)for(let B of I.extensions)if(B.toLowerCase()===A)return I;return null}function sY(g,A){for(let I of g)if(I.mimeTypes?.some(B=>CY(A,B))||CY(A,`application/x.${I.id}`))return I;return null}function xX(g,A){if(!A)return null;for(let I of g)if(typeof A==\"string\"){if(bX(A,I))return I}else if(ArrayBuffer.isView(A)){if(cu(A.buffer,A.byteOffset,I))return I}else if(A instanceof ArrayBuffer&&cu(A,0,I))return I;return null}function bX(g,A){return A.testText?A.testText(g):(Array.isArray(A.tests)?A.tests:[A.tests]).some(B=>g.startsWith(B))}function cu(g,A,I){return(Array.isArray(I.tests)?I.tests:[I.tests]).some(Q=>TX(g,A,I,Q))}function TX(g,A,I,B){if(B instanceof ArrayBuffer)return $J(B,g,B.byteLength);switch(typeof B){case\"function\":return B(g);case\"string\":let Q=rY(g,A,B.length);return B===Q;default:return!1}}function Nu(g,A=5){return typeof g==\"string\"?g.slice(0,A):ArrayBuffer.isView(g)?rY(g.buffer,g.byteOffset,A):g instanceof ArrayBuffer?rY(g,0,A):\"\"}function rY(g,A,I){if(g.byteLengthiY(Q,B.fetch):A?.fetch?A?.fetch:iY}function Ju(g,A,I){if(I)return I;let B={fetch:Ak(A,g),...g};if(B.url){let Q=Ir(B.url);B.baseUrl=Q,B.queryString=Cu(B.url),B.filename=qD.filename(Q),B.baseUrl=qD.dirname(Q)}return Array.isArray(B.loaders)||(B.loaders=null),B}function Yu(g,A){if(g&&!Array.isArray(g))return g;let I;if(g&&(I=Array.isArray(g)?g:[g]),A&&A.loaders){let B=Array.isArray(A.loaders)?A.loaders:[A.loaders];I=I?[...I,...B]:B}return I&&I.length?I:void 0}async function Wc(g,A,I,B){A&&!Array.isArray(A)&&!bc(A)&&(B=void 0,I=A,A=void 0),g=await g,I=I||{};let Q=UD(g),E=Yu(A,B),o=await Gu(g,E,I);return o?(I=Du(I,o,E,Q),B=Ju({url:Q,_parse:Wc,loaders:E},I,B||null),await OX(o,g,I,B)):null}async function OX(g,A,I,B){if(XJ(g),I=ZJ(g.options,I),zE(A)){let C=A,{ok:E,redirected:o,status:e,statusText:D,type:r,url:n}=C,G=Object.fromEntries(C.headers.entries());B.response={headers:G,ok:E,redirected:o,status:e,statusText:D,type:r,url:n}}A=await lu(A,g,I);let Q=g;if(Q.parseTextSync&&typeof A==\"string\")return Q.parseTextSync(A,I,B);if(zJ(g,I))return await _J(g,A,I,B,Wc);if(Q.parseText&&typeof A==\"string\")return await Q.parseText(A,I,B);if(Q.parse)return await Q.parse(A,I,B);throw iC(!Q.parseSync),new Error(`${g.id} loader - no parser found and worker is disabled`)}async function po(g,A,I,B){let Q,C;!Array.isArray(A)&&!bc(A)?(Q=[],C=A,B=void 0):(Q=A,C=I);let E=Ak(C),o=g;return typeof g==\"string\"&&(o=await E(g)),_E(g)&&(o=await E(g)),Array.isArray(Q)?await Wc(o,Q,C):await Wc(o,Q,C)}var Ku=\"4.2.0\";function Zc(g,A){if(!g)throw new Error(A||\"loader assertion failed.\")}var qo={self:typeof self<\"u\"&&self,window:typeof window<\"u\"&&window,global:typeof global<\"u\"&&global,document:typeof document<\"u\"&&document},VX=qo.self||qo.window||qo.global||{},vX=qo.window||qo.self||qo.global||{},jX=qo.global||qo.self||qo.window||{},XX=qo.document||{};var cY=!!(typeof process!=\"object\"||String(process)!==\"[object process]\"||process.browser);var pu=typeof process<\"u\"&&process.version&&/v([0-9]*)/.exec(process.version),zX=pu&&parseFloat(pu[1])||0;var _X=\"Queued Requests\",$X=\"Active Requests\",Az=\"Cancelled Requests\",gz=\"Queued Requests Ever\",Iz=\"Active Requests Ever\",Bz={id:\"request-scheduler\",throttleRequests:!0,maxRequests:6,debounceTime:0},Br=class{constructor(A={}){p(this,\"props\");p(this,\"stats\");p(this,\"activeRequestCount\",0);p(this,\"requestQueue\",[]);p(this,\"requestMap\",new Map);p(this,\"updateTimer\",null);this.props={...Bz,...A},this.stats=new AE({id:this.props.id}),this.stats.get(_X),this.stats.get($X),this.stats.get(Az),this.stats.get(gz),this.stats.get(Iz)}scheduleRequest(A,I=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(A))return this.requestMap.get(A);let B={handle:A,priority:0,getPriority:I},Q=new Promise(C=>(B.resolve=C,B));return this.requestQueue.push(B),this.requestMap.set(A,Q),this._issueNewRequests(),Q}_issueRequest(A){let{handle:I,resolve:B}=A,Q=!1,C=()=>{Q||(Q=!0,this.requestMap.delete(I),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,B?B({done:C}):Promise.resolve({done:C})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let A=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(A!==0){this._updateAllRequests();for(let I=0;II.priority-B.priority)}_updateRequest(A){return A.priority=A.getPriority(A.handle),A.priority<0?(A.resolve(null),!1):!0}};var Qz=globalThis.loaders?.parseImageNode,GY=typeof Image<\"u\",wY=typeof ImageBitmap<\"u\",Cz=!!Qz,hY=cY?!0:Cz;function qu(g){switch(g){case\"auto\":return wY||GY||hY;case\"imagebitmap\":return wY;case\"image\":return GY;case\"data\":return hY;default:throw new Error(`@loaders.gl/images: image ${g} not supported in this environment`)}}function du(){if(wY)return\"imagebitmap\";if(GY)return\"image\";if(hY)return\"data\";throw new Error(\"Install '@loaders.gl/polyfills' to parse images under Node.js\")}function Ez(g){let A=iz(g);if(!A)throw new Error(\"Not an image\");return A}function Uu(g){switch(Ez(g)){case\"data\":return g;case\"image\":case\"imagebitmap\":let A=document.createElement(\"canvas\"),I=A.getContext(\"2d\");if(!I)throw new Error(\"getImageData\");return A.width=g.width,A.height=g.height,I.drawImage(g,0,0),I.getImageData(0,0,g.width,g.height);default:throw new Error(\"getImageData\")}}function iz(g){return typeof ImageBitmap<\"u\"&&g instanceof ImageBitmap?\"imagebitmap\":typeof Image<\"u\"&&g instanceof Image?\"image\":g&&typeof g==\"object\"&&g.data&&g.width&&g.height?\"data\":null}var oz=/^data:image\\/svg\\+xml/,tz=/\\.svg((\\?|#).*)?$/;function gk(g){return g&&(oz.test(g)||tz.test(g))}function Su(g,A){if(gk(A)){let B=new TextDecoder().decode(g);try{typeof unescape==\"function\"&&typeof encodeURIComponent==\"function\"&&(B=unescape(encodeURIComponent(B)))}catch(C){throw new Error(C.message)}return`data:image/svg+xml;base64,${btoa(B)}`}return NY(g,A)}function NY(g,A){if(gk(A))throw new Error(\"SVG cannot be parsed directly to imagebitmap\");return new Blob([new Uint8Array(g)])}async function Ik(g,A,I){let B=Su(g,I),Q=self.URL||self.webkitURL,C=typeof B!=\"string\"&&Q.createObjectURL(B);try{return await ez(C||B,A)}finally{C&&Q.revokeObjectURL(C)}}async function ez(g,A){let I=new Image;return I.src=g,A.image&&A.image.decode&&I.decode?(await I.decode(),I):await new Promise((B,Q)=>{try{I.onload=()=>B(I),I.onerror=C=>{let E=C instanceof Error?C.message:\"error\";Q(new Error(E))}}catch(C){Q(C)}})}var az={},Lu=!0;async function Hu(g,A,I){let B;gk(I)?B=await Ik(g,A,I):B=NY(g,I);let Q=A&&A.imagebitmap;return await Dz(B,Q)}async function Dz(g,A=null){if((sz(A)||!Lu)&&(A=null),A)try{return await createImageBitmap(g,A)}catch(I){console.warn(I),Lu=!1}return await createImageBitmap(g)}function sz(g){for(let A in g||az)return!1;return!0}function fu(g){return!Gz(g,\"ftyp\",4)||!(g[8]&96)?null:rz(g)}function rz(g){switch(nz(g,8,12).replace(\"\\0\",\" \").trim()){case\"avif\":case\"avis\":return{extension:\"avif\",mimeType:\"image/avif\"};default:return null}}function nz(g,A,I){return String.fromCharCode(...g.slice(A,I))}function cz(g){return[...g].map(A=>A.charCodeAt(0))}function Gz(g,A,I=0){let B=cz(A);for(let Q=0;Q =24&&A.getUint32(0,Uo)===2303741511?{mimeType:\"image/png\",width:A.getUint32(16,Uo),height:A.getUint32(20,Uo)}:null}function Nz(g){let A=Oc(g);return A.byteLength>=10&&A.getUint32(0,Uo)===1195984440?{mimeType:\"image/gif\",width:A.getUint16(6,Pc),height:A.getUint16(8,Pc)}:null}function kz(g){let A=Oc(g);return A.byteLength>=14&&A.getUint16(0,Uo)===16973&&A.getUint32(2,Pc)===A.byteLength?{mimeType:\"image/bmp\",width:A.getUint32(18,Pc),height:A.getUint32(22,Pc)}:null}function yz(g){let A=Oc(g);if(!(A.byteLength>=3&&A.getUint16(0,Uo)===65496&&A.getUint8(2)===255))return null;let{tableMarkers:B,sofMarkers:Q}=Fz(),C=2;for(;C+9 !!Bk(new DataView(g))],options:Jz};var Yz=new $C({id:\"deck\"}),HA=Yz;var yY={};function xu(g){yY=g}function AB(g,A,I,B){HA.level>0&&yY[g]&&yY[g].call(null,A,I,B)}function Kz(g){let A=g[0],I=g[g.length-1];return A===\"{\"&&I===\"}\"||A===\"[\"&&I===\"]\"}var bu={dataType:null,batchType:null,id:\"JSON\",name:\"JSON\",module:\"\",version:\"\",options:{},extensions:[\"json\",\"geojson\"],mimeTypes:[\"application/json\",\"application/geo+json\"],testText:Kz,parseTextSync:JSON.parse};function pz(){let g=\"9.0.35\",A=globalThis.deck&&globalThis.deck.VERSION;if(A&&A!==g)throw new Error(`deck.gl - multiple versions detected: ${A} vs ${g}`);return A||(HA.log(1,`deck.gl ${g}`)(),globalThis.deck={...globalThis.deck,VERSION:g,version:g,log:HA,_registerLoggers:xu},DY([bu,[kY,{imagebitmap:{premultiplyAlpha:\"none\"}}]])),g}var FY=pz();function So(g,A){if(!g)throw new Error(A||\"shadertools: assertion failed.\")}var RY={number:{type:\"number\",validate(g,A){return Number.isFinite(g)&&typeof A==\"object\"&&(A.max===void 0||g<=A.max)&&(A.min===void 0||g>=A.min)}},array:{type:\"array\",validate(g,A){return Array.isArray(g)||ArrayBuffer.isView(g)}}};function Wu(g){let A={};for(let[I,B]of Object.entries(g))A[I]=qz(B);return A}function Zu(g,A,I){let B={};for(let[Q,C]of Object.entries(A))g&&Q in g&&!C.private?(C.validate&&So(C.validate(g[Q],C),`${I}: invalid ${Q}`),B[Q]=g[Q]):B[Q]=C.value;return B}function qz(g){let A=Tu(g);if(A!==\"object\")return{value:g,...RY[A],type:A};if(typeof g==\"object\")return g?g.type!==void 0?{...g,...RY[g.type],type:g.type}:g.value===void 0?{type:\"object\",value:g}:(A=Tu(g.value),{...g,...RY[A],type:A}):{type:\"object\",value:null};throw new Error(\"props\")}function Tu(g){return Array.isArray(g)||ArrayBuffer.isView(g)?\"array\":typeof g}var Pu=`#ifdef MODULE_LOGDEPTH\nlogdepth_adjustPosition(gl_Position);\n#endif\n`,Ou=`#ifdef MODULE_MATERIAL\ngl_FragColor = material_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_LIGHTING\ngl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_FOG\ngl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_PICKING\ngl_FragColor = picking_filterHighlightColor(gl_FragColor);\ngl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n#ifdef MODULE_LOGDEPTH\nlogdepth_setFragDepth();\n#endif\n`;var dz={vertex:Pu,fragment:Ou},Vu=/void\\s+main\\s*\\([^)]*\\)\\s*\\{\\n?/,vu=/}\\n?[^{}]*$/,MY=[],Vc=\"__LUMA_INJECT_DECLARATIONS__\";function ju(g){let A={vertex:{},fragment:{}};for(let I in g){let B=g[I],Q=Uz(I);typeof B==\"string\"&&(B={order:0,injection:B}),A[Q][I]=B}return A}function Uz(g){let A=g.slice(0,2);switch(A){case\"vs\":return\"vertex\";case\"fs\":return\"fragment\";default:throw new Error(A)}}function vc(g,A,I,B=!1){let Q=A===\"vertex\";for(let C in I){let E=I[C];E.sort((e,D)=>e.order-D.order),MY.length=E.length;for(let e=0,D=E.length;e e+o));break;case\"vs:#main-end\":Q&&(g=g.replace(vu,e=>o+e));break;case\"fs:#decl\":Q||(g=g.replace(Vc,o));break;case\"fs:#main-start\":Q||(g=g.replace(Vu,e=>e+o));break;case\"fs:#main-end\":Q||(g=g.replace(vu,e=>o+e));break;default:g=g.replace(C,e=>e+o)}}return g=g.replace(Vc,\"\"),B&&(g=g.replace(/\\}\\s*$/,C=>C+dz[A])),g}var Sz=1,Qr=class g{constructor(A){p(this,\"name\");p(this,\"vs\");p(this,\"fs\");p(this,\"getModuleUniforms\");p(this,\"dependencies\");p(this,\"deprecations\");p(this,\"defines\");p(this,\"injections\");p(this,\"uniforms\",{});p(this,\"uniformTypes\",{});let{name:I,vs:B,fs:Q,dependencies:C=[],uniformTypes:E={},uniformPropTypes:o={},getUniforms:e,deprecations:D=[],defines:r={},inject:n={}}=A;So(typeof I==\"string\"),this.name=I,this.vs=B,this.fs=Q,this.getModuleUniforms=e,this.dependencies=g.instantiateModules(C),this.deprecations=this._parseDeprecationDefinitions(D),this.defines=r,this.injections=ju(n),this.uniformTypes=E,o&&(this.uniforms=Wu(o))}static instantiateModules(A){return A.map(I=>{if(I instanceof g)return I;So(typeof I!=\"string\",`Shader module use by name is deprecated. Import shader module '${JSON.stringify(I)}' and use it directly.`),I.name||(console.warn(\"shader module has no name\"),I.name=`shader-module-${Sz++}`);let B=new g(I);return B.dependencies=g.instantiateModules(I.dependencies||[]),B})}getModuleSource(A){let I;switch(A){case\"vertex\":I=this.vs||\"\";break;case\"fragment\":I=this.fs||\"\";break;default:So(!1)}let B=this.name.toUpperCase().replace(/[^0-9a-z]/gi,\"_\");return`// ----- MODULE ${this.name} ---------------\n\n#define MODULE_${B}\n${I}\n\n`}getUniforms(A,I){return this.getModuleUniforms?this.getModuleUniforms(A,I):Zu(A,this.uniforms,this.name)}getDefines(){return this.defines}checkDeprecations(A,I){this.deprecations.forEach(B=>{B.regex?.test(A)&&(B.deprecated?I.deprecated(B.old,B.new)():I.removed(B.old,B.new)())})}_parseDeprecationDefinitions(A){return A.forEach(I=>{switch(I.type){case\"function\":I.regex=new RegExp(`\\\\b${I.old}\\\\(`);break;default:I.regex=new RegExp(`${I.type} ${I.old};`)}}),A}_defaultGetUniforms(A={}){let I={},B=this.uniforms;for(let Q in B){let C=B[Q];Q in A&&!C.private?(C.validate&&So(C.validate(A[Q],C),`${this.name}: invalid ${Q}`),I[Q]=A[Q]):I[Q]=C.value}return I}};function lY(g){if(g.source&&g.platformInfo.type===\"webgpu\")return{...g,vs:void 0,fs:void 0};if(!g.vs)throw new Error(\"no vertex shader\");let A=Xu(g.platformInfo,g.vs),I;return g.fs&&(I=Xu(g.platformInfo,g.fs)),{...g,vs:A,fs:I}}function Xu(g,A){if(typeof A==\"string\")return A;switch(g.type){case\"webgpu\":if(A?.wgsl)return A.wgsl;throw new Error(\"WebGPU does not support GLSL shaders\");default:if(A?.glsl)return A.glsl;throw new Error(\"WebGL does not support WGSL shaders\")}}function SD(g){let A=Qr.instantiateModules(g);return Lz(A)}function Lz(g){let A={},I={};return zu({modules:g,level:0,moduleMap:A,moduleDepth:I}),Object.keys(I).sort((B,Q)=>I[Q]-I[B]).map(B=>A[B])}function zu(g){let{modules:A,level:I,moduleMap:B,moduleDepth:Q}=g;if(I>=5)throw new Error(\"Possible loop in shader dependency graph\");for(let C of A)B[C.name]=C,(Q[C.name]===void 0||Q[C.name]